Empty statements, i.e. ;, are usually introduced by mistake, for example because:
;;.
void doSomething() {
; // Noncompliant - was used as a kind of TODO marker
}
void doSomethingElse() {
System.out.println("Hello, world!");; // Noncompliant - double ;
...
for (int i = 0; i < 3; System.out.println(i), i++); // Noncompliant - Rarely, they are used on purpose as the body of a loop. It is a bad practice to have side-effects outside of the loop body
...
}
void doSomething() {}
void doSomethingElse() {
System.out.println("Hello, world!");
...
for (int i = 0; i < 3; i++){
System.out.println(i);
}
...
}