src/main/java/com/github/koraktor/mavanagaiata/mojo/CheckMojoException.java
Switch statements should have a default label Open
Open
switch (type) {
case UNCLEAN:
message = "The worktree is in an unclean state. Please stash " +
"or commit your changes.";
break;
- Read upRead up
- Exclude checks
SwitchStmtsShouldHaveDefault
Since: PMD 1.0
Priority: Medium
Categories: Style
Remediation Points: 50000
All switch statements should include a default option to catch any unspecified values.
Example:
public void bar() {
int x = 2;
switch (x) {
case 1: int j = 6;
case 2: int j = 8;
// missing default: here
}
}