mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-30 08:41:59 +07:00
GitOrigin-RevId: 5f856519e56e61818e95cf63766fb6a54c6283ad
12 lines
375 B
Java
12 lines
375 B
Java
// "Replace with 'switch' expression" "true-preview"
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
class X {
|
|
private static void test(@Nullable Object object) {
|
|
String r = switch (object) {
|
|
case Integer i -> "int = " + i;
|
|
case String s when s.length() > 3 -> s.substring(0, 3);
|
|
case null, default -> "default";
|
|
};
|
|
}
|
|
} |