Files
Andrey.Cherkasov 8cfde5e798 [java-intentions] ConvertSwitchToIf: don't add explicit null check if the selector expression is not null
IDEA-300120

GitOrigin-RevId: d49fa3356b23ec87c8f493fc4cdacb0655e4b600
2022-08-18 20:46:01 +00:00

16 lines
354 B
Java

// "Replace 'switch' with 'if'" "true-preview"
import org.jetbrains.annotations.NotNull;
class Test {
void foo(@NotNull Object o) {
if (o instanceof String) {
System.out.println("one");
} else if (o instanceof Integer) {
System.out.println("two");
} else {
System.out.println("default");
}
}
}