IDEA-65566 Allow 'NotNull' as the default element behavior for a given class or package

This commit is contained in:
peter
2014-01-17 17:25:13 +01:00
parent 0b9321bc2f
commit 9ffaba9293
4 changed files with 66 additions and 3 deletions
@@ -0,0 +1,25 @@
import foo.*;
class Some {
void foo() {
NotNullClass.foo(<warning descr="Passing 'null' argument to parameter annotated as @NotNull">null</warning>);
NotNullClass.foo("a");
NullableClass.foo(null);
NullableClass.foo("a");
AnotherPackageNotNull.foo(<warning descr="Passing 'null' argument to parameter annotated as @NotNull">null</warning>);
AnotherPackageNotNull.foo("a");
}
}
@javax.annotation.ParametersAreNonnullByDefault
class NotNullClass {
static void foo(String s) {}
}
@javax.annotation.ParametersAreNullableByDefault
class NullableClass {
static void foo(String s) {}
}