Files
openide/java/java-tests/testData/inspection/switchExpressionMigration/beforeEmptyDefault.java
Alexandr Suhinin 4e3e882736 IDEA-273242 replace switch with enhanced switch: suggest with empty default branch
GitOrigin-RevId: ec8d6e47f488d009a94092fe02bb5cc214a1f0dc
2021-07-19 16:59:21 +00:00

19 lines
468 B
Java

// "Replace with enhanced 'switch' statement" "true"
import org.jetbrains.annotations.Nullable;
class X {
private static void test(@Nullable Object object) {
String r;
swi<caret>tch (object) {
case Integer i:
r = "int = " + i;
break;
case String s && s.length() > 3:
r = s.substring(0, 3);
break;
case null:
default:
}
}
}