Debian Codegraph @

checker/tests/nullness/generics/Issue339.java

raw
1 // Test case for Issue 339:
2 // https://github.com/typetools/checker-framework/issues/339
3
4 import org.checkerframework.checker.nullness.qual.*;
5
6 class Issue339<S> {
7 static <T> @NonNull T checkNotNull(T p) {
8 throw new RuntimeException();
9 }
10
11 void m(@Nullable S s) {
12 @NonNull S r1 = Issue339.<@Nullable S>checkNotNull(s);
13 @NonNull S r2 = Issue339.checkNotNull(s);
14 @NonNull S r3 = Issue339.checkNotNull(null);
15 }
16 }