mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-01 03:12:15 +07:00
GitOrigin-RevId: 5f856519e56e61818e95cf63766fb6a54c6283ad
17 lines
576 B
Java
17 lines
576 B
Java
// "Replace with enhanced 'switch' statement" "true-preview"
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
class X {
|
|
private static void test(@NotNull Object object) {
|
|
switch (object) {
|
|
case Integer i ->
|
|
// line contains no height
|
|
System.out.println(i + 1);
|
|
case String s when !s.isEmpty() ->
|
|
// line contains no code
|
|
System.out.println("Goodbye.");
|
|
case null -> System.out.println("c");
|
|
default -> System.out.println("default");
|
|
}
|
|
}
|
|
} |