checkers.nullness.quals
Annotation Type LazyNonNull


@Documented
@Retention(value=RUNTIME)
@Target(value=FIELD)
@TypeQualifier
@SubtypeOf(value=Nullable.class)
public @interface LazyNonNull

Indicates that a field is lazily initialized to a non-null value. Once the field becomes non-null, it never becomes null again. There is no guarantee that the field ever becomes non-null, however.

Lazily initialized fields have these two properties:

  1. The field may be assigned only non-null values.
  2. The field may be re-assigned as often as desired.
When the field is first read withn a method, the field cannot be assumed to be non-null. The benefit of LazyNonNull over Nullable is its different interaction with flow-sensitive type qualifier refinement. After a check of a LazyNonNull field, all subsequent accesses within that method can be assumed to be NonNull, even after arbitrary external method calls that have access to the given field.

This annotation is associated with the NullnessChecker.

See Also:
Nullable, NullnessChecker
checker.framework.manual
#nullness-checker Nullness Checker