All Downloads are FREE. Search and download functionalities are using the official Maven repository.

resources.report.rules.pmd.ForLoopsMustUseBraces.html Maven / Gradle / Ivy



ForLoopsMustUseBraces


ForLoopsMustUseBraces

Avoid using 'for' statements without using curly braces.

This rule is defined by the following XPath expression:

 
//ForStatement[not(Statement/Block)]
 
                 

Example:

                

public void foo() {
 for (int i=0; i<42;i++)
   foo();
}

       
            




© 2015 - 2025 Weber Informatics LLC | Privacy Policy