QualifierDefaults had a // TODO: should AnnotatedFor apply to subpackages?? comment from #708 until #1331 removed it. The question was never answered, and modelling JSpecify's @NullMarked now requires thinking about it.
In #1304, I want to add aliasing between @AnnotatedFor("nullness") and @Nullmarked.
@DefaultQualifier on a package applies to subpackages, and had applyToSubpackages element (default true) so a default can opt out. @AnnotatedFor has no such element.
JSpecify specifies that @NullMarked on a package does not cover its subpackages, and #1304 aliases @NullMarked to both annotations:
@DefaultQualifier(NonNull, locations=UPPER_BOUND, applyToSubpackages=false) — can opt out, and does.
@AnnotatedFor("nullness") — cannot opt out, so the scope reaches subpackages.
Should we change @AnnotatedFor's behaviour or document this inconsistency with @Nullmarked semantics?
@wmdietl Do you have ideas on how to deal with this issue?
QualifierDefaults had a
// TODO: should AnnotatedFor apply to subpackages??comment from #708 until #1331 removed it. The question was never answered, and modelling JSpecify's@NullMarkednow requires thinking about it.In #1304, I want to add aliasing between
@AnnotatedFor("nullness")and@Nullmarked.@DefaultQualifieron a package applies to subpackages, and hadapplyToSubpackages element (default true)so a default can opt out.@AnnotatedForhas no such element.JSpecify specifies that
@NullMarkedon a package does not cover its subpackages, and #1304 aliases@NullMarkedto both annotations:@DefaultQualifier(NonNull, locations=UPPER_BOUND, applyToSubpackages=false)— can opt out, and does.@AnnotatedFor("nullness")— cannot opt out, so the scope reaches subpackages.Should we change
@AnnotatedFor's behaviour or document this inconsistency with@Nullmarkedsemantics?@wmdietl Do you have ideas on how to deal with this issue?