mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-05 16:36:56 +07:00
12 lines
365 B
Java
12 lines
365 B
Java
// "Replace with 'switch' expression" "true"
|
|
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 && s.length() > 3 -> s.substring(0, 3);
|
|
case null, default -> "default";
|
|
};
|
|
}
|
|
} |