SwitchStmtsShouldHaveDefault

Switch statements should have a default label.

This rule is defined by the following XPath expression:

                  
//SwitchStatement[not(SwitchLabel[@Default='true'])]
                  
              

Example:

                

public class Foo {
 public void bar() {
  int x = 2;
  switch (x) {
   case 2: int j = 8;
  }
 }
}