Unnecessary semicolon
Reports any unnecessary semicolons, including semicolons that are used between class members, inside block statements, or after class definitions.
Even though these semicolons are valid in Java, they are redundant and may be removed.
Example:
class C {
;
void m() throws Exception {
try (AutoCloseable r1 = createAutoCloseable();) {
;
}
}
;
}
After the quick-fix is applied:
class C {
void m() throws Exception {
try (AutoCloseable r1 = createAutoCloseable()) {
}
}
}
Inspection options
Option | Type | Default |
---|---|---|
Ignore unnecessary semicolons after enum constants | Checkbox | false |
Inspection Details | |
---|---|
Available in: | IntelliJ IDEA 2023.3, Qodana for JVM 2023.3 |
Plugin: | Java, 233.SNAPSHOT |
Last modified: 13 July 2023