[JSR308] 3.2 Default annotation specification differs from implementation of DefaultQualifier
Hamlet D'Arcy
hamletdrc at gmail.com
Wed Dec 31 15:25:57 EST 2008
The JSR 308 version 0.8.4, the checkers.quals.DefaultQualifier
annotation with a locations field, like so:
public @interface DefaultQualifier {
String value();
DefaultLocation[] locations() default {DefaultLocation.ALL};
}
Section 3.2 of the specification (Default annotation), 3rd bullet
point, instructs you to turn on the "Non-null except locals" default
with the following usage:
@DefaultQualifier(value="checkers.nullness.quals.NonNull",
types={DefaultLocation.ALL_EXCEPT_LOCALS})
The example won't compile, of course, because the annotation
declaration says "locations" and the example says "types". Either the
DefaultQualifier can have "locations" changed to "types", or the
specification example can have the "types" changed to "locations".
Which one is correct? Personally, I prefer locations() because the
term seems less overloaded than "types"... especially in a feature
that is all about types (in the type system sense).
--
Hamlet D'Arcy
hamletdrc at gmail.com
More information about the JSR308
mailing list