mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-17 07:20:53 +07:00
A 'default' label dominates a case label with a case pattern, and it also dominates a case label with a 'null' case constant. IDEA-309549 GitOrigin-RevId: 6877992c530e41a1200ea7c20d6405da4be0324b
11 lines
351 B
Java
11 lines
351 B
Java
// "Make 'default' the last case" "true-preview"
|
|
class X {
|
|
void test(Object obj) {
|
|
switch (obj) {
|
|
case null, default -> System.out.println("null or default");
|
|
case Integer i -> System.out.println("Integer");
|
|
case String s when s.isEmpty()<caret> -> System.out.println("empty String");
|
|
}
|
|
}
|
|
}
|