报告任何不必要的分号,包括在类成员之间、块语句内部或类定义之后使用的分号。

尽管这些分号在 Java 中有效,但它们是冗余的,可以被删除。

示例:


  class C {
    ;
    void m() throws Exception {
        try (AutoCloseable r1 = createAutoCloseable();) {
          ;
        }
    }
    ;
  }

在应用快速修复后:


  class C {
    void m() throws Exception {
      try (AutoCloseable r1 = createAutoCloseable()) {
      }
    }
  }