Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/emptyStatement/afterIfSwitchConditionJava12Preview.java
Tagir Valeev 5d4a0b8197 Basic support of switch expressions in StatementExtractor/SideEffectChecker
Fixes IDEA-204138 Exception in "statement with empty body" inspection with switch expression
Fixes EA-133610 - REWA: StatementExtractor.createNode
2018-12-13 17:42:28 +07:00

29 lines
636 B
Java

// "Extract side effect" "true"
class Z {
void z() {
switch (0) {
case 0 -> {
}
case 1 -> {
System.out.println("oops");
}
case 2 -> {
System.out.println("bar");
if (Math.random() > 0.5) {
new Foo().getBar();
}
}
case 3 -> {
if (Math.random() > 0.5) {
} else {
}
}
case 4 -> {
if (Math.random() > 0.5) break;
System.out.println("four");
}
default -> new Foo();
}
}
}