Annotation Type HoldsForDefaultValue
- 
@Documented @Retention(RUNTIME) @Target(ANNOTATION_TYPE) public @interface HoldsForDefaultValueA meta-annotation that indicates that the qualifier can be applied to the default value of every relevant Java type (as perRelevantJavaTypes). It is used by the Initialization Checker to know which fields that are not initialized can still be considered initialized.This meta-annotation should not be applied to the top qualifier in a hierarchy, as the top qualifier must always respect this property by default. It should also not be applied to monotonic or polymorphic qualifiers.
For example, the default value of every class-typed variable is
null. Thus, in a nullness types system,Nullableholds for default values (but should not be annotated with this meta-annotation, since it is the top qualifier), butNonNulldoes not. For another example, the default value for numerical primitive types is0. Thus, in a type system with qualifiersEven,Odd, andUnknown, the top qualifierUnknownholds for default values (but should not be annotated with this meta-annotation),Evenholds for default values and should be annotated, andOdddoes not hold for default values and should not be annotated.Unannotated qualifiers are treated conservatively. Therefore,
HoldsForDefaultValuesannotations can be added to qualifiers once the Initialization Checker is used by a type system to suppress false positive warnings.This is a trusted meta-annotation, meaning that it is not checked whether a qualifier actually holds for the default value.