@Documented @Retention(value=RUNTIME) @Target(value={METHOD,CONSTRUCTOR}) @InheritedAnnotation public @interface EnsuresNonNull
This postcondition annotation is useful for methods that initialize a field:
@EnsuresNonNull("theMap")
public static void initialize() {
theMap = new HashMap<>();
}
It can also be used for a method that fails if a given expression is null:
/** Throws an exception if the argument is null. */
@EnsuresNonNull("#1")
void assertNonNull(Object arg) { ... }
NonNull
,
NullnessChecker
public abstract java.lang.String[] value
NonNull
on successful method termination.