| 1 |
// Test case for issue #783: |
| 2 |
// https://github.com/typetools/checker-framework/issues/783 |
| 3 |
|
| 4 |
// Note that Issue783a.java, which differs only in the import statement, |
| 5 |
// suffers no type-checking warning. |
| 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 javax.annotation.Nullable; |
| 11 |
|
| 12 |
public class Issue783b<T> { |
| 13 |
private @Nullable T val; |
| 14 |
|
| 15 |
public void set(@Nullable T val) { |
| 16 |
this.val = val; |
| 17 |
} |
| 18 |
|
| 19 |
@Nullable public T get() { |
| 20 |
return val; |
| 21 |
} |
| 22 |
} |