mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
28 lines
476 B
Java
28 lines
476 B
Java
import foo.*;
|
|
|
|
class Test {
|
|
|
|
public void test() {
|
|
|
|
@NotNull
|
|
String a = notNull(getNullable());
|
|
|
|
@NotNull
|
|
String b = <warning descr="The call to notNull always fails, according to its method contracts">notNull</warning>(null);
|
|
}
|
|
|
|
@Nullable
|
|
public String getNullable() {
|
|
return null;
|
|
}
|
|
|
|
@NotNull
|
|
private static <T> T notNull(@Nullable T value) {
|
|
|
|
if (value == null) {
|
|
throw new RuntimeException("null");
|
|
}
|
|
|
|
return value;
|
|
}
|
|
} |