Files
Tagir Valeev dd689d3a39 [java-inspections] More tests for preview
GitOrigin-RevId: 6b6405ee4491ad1d58947547c40df6fb2d291ab7
2022-07-29 17:54:59 +00:00

29 lines
644 B
Java

// "Extract side effect" "true-preview"
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();
}
}
}