IDEA-160991 Returning null should result in a warning in @TypeQualifierDefault notnull method

This commit is contained in:
peter
2016-09-19 18:05:40 +02:00
parent f3aa224c01
commit ca8004bfea
7 changed files with 23 additions and 15 deletions
@@ -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
@@ -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