Examples:
abstract class A {
@NotNull abstract String m();
}
class B extends A {
String m() { return "empty string"; }
}
@NotNull int myFoo; @Nullable and @NotNull are present on the same member: @Nullable @NotNull String myFooString;
void testList(List<@Nullable String> nullableList) {
List<@NotNull String> list2 = nullableList;
}
Use the Configure Annotations button to specify nullability annotations. The options are grouped into three sections — overriding methods and parameters, generic types, and declarations and annotations — to fine-tune where the inspection should provide warnings. Each option has a ? icon that explains what it reports.
This inspection only reports if the language level of the project or module is 5 or higher, and nullability annotations are available on the classpath.