Since Checkstyle 3.1
Detects empty statements (standalone ";" semicolon).
Empty statements often introduce bugs that are hard to spot
To configure the check:
<module name="Checker">
<module name="TreeWalker">
<module name="EmptyStatement"/>
</module>
</module>
Example:
public class Example1 {
public void foo() {
int i = 5;
if(i > 3); // violation
i++;
for (i = 0; i < 5; i++); // violation
i++;
while (i > 10)
i++;
}
}
All messages can be customized if the default message doesn't suit you. Please see the documentation to learn how to.
com.puppycrawl.tools.checkstyle.checks.coding