mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-09 15:41:26 +07:00
Fixes IDEA-294215 Inspection "Constant conditions & exceptions" does not report all unreachable switch labels GitOrigin-RevId: 6f1e493b6a665221c1978a5c918028638ec23c09
18 lines
529 B
Java
18 lines
529 B
Java
class Test {
|
|
enum Colors {
|
|
RED,
|
|
GREEN,
|
|
BLUE,
|
|
YELLOW,
|
|
}
|
|
public Test(Colors color) {
|
|
if (color == Colors.RED || color == Colors.GREEN) {
|
|
switch (color) {
|
|
case RED -> System.out.println("Red");
|
|
case <warning descr="Switch label 'BLUE' is unreachable">BLUE</warning> -> System.out.println("Blue");
|
|
case GREEN -> System.out.println("Green");
|
|
case <warning descr="Switch label 'YELLOW' is unreachable">YELLOW</warning> -> System.out.println("Yellow");
|
|
}
|
|
}
|
|
}
|
|
} |