Affects PMD Version: 7.6.0
Rule: NonCaseLabelInSwitchStatement
Description:
It currently only considers switch statements, but switch expressions could also have non case labels.
Code Sample demonstrating the issue:
public class Foo {
void bar(int x) {
x = switch (x) {
case 2: int y=8;
somelabel: // violation expected
yield y;
default:
int j=8;
yield j;
};
}
}
Expected outcome:
PMD should report a violation at line 5, but doesn't. This is a false-negative.
Affects PMD Version: 7.6.0
Rule: NonCaseLabelInSwitchStatement
Description:
It currently only considers switch statements, but switch expressions could also have non case labels.
Code Sample demonstrating the issue:
Expected outcome:
PMD should report a violation at line 5, but doesn't. This is a false-negative.