[java] TooFewBranchesForSwitch false-positive with switch using list of case constants #5287
Closed
Description
Affects PMD Version:
7.7.0
Rule:
TooFewBranchesForSwitch.
Description:
Having multiple labels in a single case
should be considered the same as multiple cases. So no TooFewBranchesForSwitch
should be triggered for the code below:
Code Sample demonstrating the issue:
return switch (someEnumValue) {
case A, B, C -> 1;
default -> 0;
};
Expected outcome:
No violation.
Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other]
Gradle