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

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



EmptySwitchStatements


EmptySwitchStatements

Avoid empty switch statements.

This rule is defined by the following XPath expression:


//SwitchStatement[count(*) = 1]
 
              

Example:

                
  
public class Foo {
 public void bar() {
  int x = 2;
  switch (x) {
   // once there was code here
   // but it's been commented out or something
  }
 }
}
      
            




© 2015 - 2025 Weber Informatics LLC | Privacy Policy