Repeating annotations and TYPE_USE

Alex Buckley alex.buckley at oracle.com
Tue Mar 12 12:21:12 PDT 2013


Actually there is "legacy code", because JSR 308 defines TYPE_USE as all 
uses of types plus those locations where TYPE and TYPE_PARAMETER are 
applicable. The goal is to allow a TYPE annotation type to be broadened 
to TYPE_USE, but it would be terribly surprising if AnnotatedElement 
methods on type declarations then started "looking through".

Even if TYPE_USE locations were disjoint from other locations, it would 
still be undesirable to introduce inconsistency in the AnnotatedElement 
methods.

Alex

On 3/12/2013 10:47 AM, Paul Benedict wrote:
> Since there's no such thing as legacy code for TYPE_USE, should any special
> consideration be given to always "looking through" the container
> application for this kind of @Target?
>
> Example:
> public @A @A String foo() { return "foo"; }
>
> Paul
>



More information about the enhanced-metadata-spec-discuss mailing list