mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-160991 Returning null should result in a warning in @TypeQualifierDefault notnull method
This commit is contained in:
@@ -10,12 +10,12 @@ enum TestNonnull {
|
||||
if (<warning descr="Condition 'aObject == null' is always 'false'">aObject == null</warning>) {
|
||||
return new Object();
|
||||
}
|
||||
return <warning descr="'null' is returned by the method declared as @NotNull">null</warning>;
|
||||
return <warning descr="'null' is returned by the method declared as @Nonnull">null</warning>;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object testWithoutAnnotation(Object aObject) {
|
||||
return <warning descr="'null' is returned by the method declared as @NotNull">null</warning>;
|
||||
return <warning descr="'null' is returned by the method declared as @NonnullByDefault">null</warning>;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -27,7 +27,7 @@ enum TestNonnull {
|
||||
}
|
||||
|
||||
public Object testReturn() {
|
||||
return <warning descr="'null' is returned by the method declared as @NotNull">null</warning>;
|
||||
return <warning descr="'null' is returned by the method declared as @NonnullByDefault">null</warning>;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
+5
-1
@@ -21,7 +21,11 @@ class NotNullClass {
|
||||
static native Object foo(String s);
|
||||
|
||||
public Object foo() {
|
||||
return <warning descr="'null' is returned by the method declared as @NotNull">null</warning>;
|
||||
return <warning descr="'null' is returned by the method declared as @MethodsAreNotNullByDefault">null</warning>;
|
||||
}
|
||||
|
||||
private Object privateFoo() {
|
||||
return <warning descr="'null' is returned by the method declared as @MethodsAreNotNullByDefault">null</warning>;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
Reference in New Issue
Block a user