mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-08 21:52:48 +07:00
GitOrigin-RevId: 88bf0c45eb23406f29f693659c8495b286512d36
23 lines
678 B
Java
23 lines
678 B
Java
import org.jetbrains.annotations.Nullable;
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
class Test {
|
|
static void nullable(String s) {
|
|
switch (s) {
|
|
case "xyz" -> System.out.println("xyz");
|
|
case null, default -> System.out.println("else");
|
|
}
|
|
}
|
|
|
|
static void notNullable(String s) {
|
|
switch (s) {
|
|
case "xyz" -> System.out.println("xyz");
|
|
default -> System.out.println("else");
|
|
}
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
nullable(<warning descr="Passing 'null' argument to non-annotated parameter">null</warning>);
|
|
notNullable(<warning descr="Passing 'null' argument to parameter annotated as @NotNull">null</warning>);
|
|
}
|
|
} |