This rule is defined by the following XPath expression:
//EmptyStatement [not( ../../../ForStatement or ../../../WhileStatement or ../../../BlockStatement/ClassOrInterfaceDeclaration or ../../../../../../ForStatement/Statement[1] /Block[1]/BlockStatement[1]/Statement/EmptyStatement or ../../../../../../WhileStatement/Statement[1] /Block[1]/BlockStatement[1]/Statement/EmptyStatement) ]
Example:
public class MyClass { public void doit() { // this is probably not what you meant to do ; // the extra semicolon here this is not necessary System.out.println("look at the extra semicolon");; } }