Debian Codegraph @

checker/tests/nullness/generics/Issue783a.java

raw
1 // Test case for issue #783:
2 // https://github.com/typetools/checker-framework/issues/783
3
4 // This file suffers no type-checking warning, but Issue783b.java does, and
5 // it differs only in the import statement.
6
7 // You may find it helpful to run this as:
8 // $ch/bin/javac -cp $ch/dist/checker.jar -processor nullness -AprintVerboseGenerics Issue783b.java
9
10 import org.checkerframework.checker.nullness.qual.Nullable;
11
12 public class Issue783a<T> {
13 private @Nullable T val;
14
15 public void set(@Nullable T val) {
16 this.val = val;
17 }
18
19 public @Nullable T get() {
20 return val;
21 }
22 }