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

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



IfStmtsMustUseBraces


IfStmtsMustUseBraces

Avoid using if statements without using curly braces.

This rule is defined by the following XPath expression:

                   
//IfStatement[count(*) < 3][not(Statement/Block)]
                   
               

Example:

                
 
 public class Foo {
   public void bar() {
     int x = 0;
     if (foo) x++;
   }
 }
 
     
            




© 2015 - 2025 Weber Informatics LLC | Privacy Policy