checkers.nullness.quals
Annotation Type NonNullOnEntry
@Documented
@Retention(value=RUNTIME)
public @interface NonNullOnEntry
Indicates a method postcondition: the method expects the specified
variables (typically field references) to be non-null when the annotated
method is invoked.
For example:
@Nullable Object field1;
@Nullable Object field2;
@NonNullOnEntry("field1")
void method1() {
field1.toString(); // OK, field1 is known to be non-null
field2.toString(); // error, might throw NullPointerException
}
void method2() {
field1 = new Object();
method1(); // OK, satisfies method precondition
field1 = null;
method1(); // error, does not satisfy method precondition
}
value
public abstract String[] value