Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/convertSwitchToIf/beforeRuleMultilabels.java
Anna Kozlova bd1a21a02a bump highest language level to 14, prepare to remove 13_preview
GitOrigin-RevId: ec42a9047ba63b0cbaddd8357d11ae2ed56ed6b6
2020-04-01 12:31:42 +00:00

16 lines
361 B
Java

// "Replace 'switch' with 'if'" "true"
class Test {
void foo(int x) {
switch<caret> (x) {
case 0,1 -> throw new IllegalArgumentException();
case 2,3 -> {
if (Math.random() > 0.5) break;
System.out.println("two or three");
}
case 4 -> System.out.println("four");
default -> {
break;
}
}
}
}