| package test; |
| |
| public class MyGenericImpl<T extends Comparable<T>> { |
| |
| T field; |
| // The field field may not have been initialized, whereas its type 'T' |
| // is a free type variable that may represent a '@NonNull' type |
| |
| public T get() { |
| return null; |
| // Null type mismatch (type annotations): 'null' |
| // is not compatible to the free type variable 'T' |
| } |
| |
| public int compareTo(T other) { |
| return field.compareTo(other); |
| // Potential null pointer access: the expression has type 'T', |
| // a free type variable that may represent a '@Nullable' type |
| } |
| } |