1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
import org.checkerframework.checker.nullness.qual.*;
import org.checkerframework.framework.qual.DefaultQualifier;
import org.checkerframework.framework.qual.TypeUseLocation;
class MyGenClass<T extends @Nullable Object> {}
@DefaultQualifier(value = Nullable.class, locations = TypeUseLocation.UPPER_BOUND)
class Varargs {
void test() {
ignore(newInstance());
}
static void ignore(MyGenClass<?>... consumer) {}
static <T> MyGenClass<T> newInstance() {
return new MyGenClass<T>();
}
}
|