resources.report.rules.pmd.EmptyStatementNotInLoop.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sanity4j Show documentation
Show all versions of sanity4j Show documentation
Sanity4J was created to simplify running multiple static code
analysis tools on the Java projects. It provides a single entry
point to run all the selected tools and produce a consolidated
report, which presents all findings in an easily accessible
manner.
EmptyStatementNotInLoop
EmptyStatementNotInLoop
An empty statement (or a semicolon by itself) that is not used as the sole body of a ‘for’ or ‘while’ loop is probably a bug. It could also be a double semicolon, which has no purpose and should be removed.
//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(s):
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");;
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy