尽管这些分号在 Java 中有效,但它们是冗余的,可以被删除。
示例:
class C {
;
void m() throws Exception {
try (AutoCloseable r1 = createAutoCloseable();) {
;
}
}
;
}
在应用快速修复后:
class C {
void m() throws Exception {
try (AutoCloseable r1 = createAutoCloseable()) {
}
}
}