mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
report when notnull type is instantiated with unknown nullity (IDEA-CR-21203)
This commit is contained in:
+3
-7
@@ -3,13 +3,9 @@ import java.util.*;
|
||||
|
||||
class MyList<T extends @NotNull Number> extends ArrayList<T> {}
|
||||
|
||||
class SubList extends MyList<<warning descr="Nullable type argument where non-null one is expected">@Nullable Integer</warning>> {
|
||||
MyList<<warning descr="Nullable type argument where non-null one is expected">@Nullable Integer</warning>> myList;
|
||||
class SubList extends MyList<<warning descr="Non-null type argument is expected">@Nullable Integer</warning>> {
|
||||
MyList<<warning descr="Non-null type argument is expected">@Nullable Integer</warning>> myList;
|
||||
}
|
||||
|
||||
class MyNonNullGenericClass<T extends @NotNull Object> {
|
||||
public static void test() {
|
||||
MyNonNullGenericClass<<warning descr="Nullable type argument where non-null one is expected">@Nullable String</warning>> foo = new MyNonNullGenericClass<>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
import typeUse.*;
|
||||
import java.util.*;
|
||||
|
||||
class MyNonNullGenericClass<T extends @NotNull Object> {
|
||||
public static void test() {
|
||||
MyNonNullGenericClass<<warning descr="Non-null type argument is expected">@Nullable String</warning>> foo = new MyNonNullGenericClass<>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
class Parent<A extends @Nullable Object, B extends @NotNull Object> { }
|
||||
class Child<A, B> extends Parent<B, <warning descr="Non-null type argument is expected">A</warning>> {
|
||||
void test2() {
|
||||
Parent<@Nullable String, <warning descr="Non-null type argument is expected">@Nullable String</warning>> p = new Parent<>();
|
||||
Child<@Nullable String, @Nullable String> c = new Child<>();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user