Status of retrieving annotations on type parameters?

Joel Borggrén-Franck joel.franck at
Wed Mar 27 01:43:46 PDT 2013

Hi Joe,

While I haven't looked into this in detail I'm not surprised if the behavior 
for declaration annotations on Type Parameters isn't behaving 100% just yet. 
It feels like the odd case.


On 03/26/2013 10:10 PM, Joe Darcy wrote:
> On 03/26/2013 01:18 PM, Alex Buckley wrote:
>> On 3/26/2013 10:26 AM, Joe Darcy wrote:
>>> Related to updating the annotation processing specification to account
>>> for JSR 308, I wanted to quickly double-check on the implementation
>>> status of retrieving declaration annotations on type parameters.
>>> Is this functionally currently supported in either the javax.lang.model
>>> API or in core reflection?
>> The JBS bugs for type annotations reflection are:
>>   JDK-8004698 Implement Core Reflection for Type Annotations
>>   JDK-8007803 Implement javax.lang.model API for Type Annotations
>> For core reflection, the actions called for in [1] have been implemented.
>> j.l.r.TypeVariable has a new method getAnnotatedBounds(), and the
>> implementation of TypeVariable implements AnnotatedElement fully.
>> For the language model, the actions called for in [1] are still applicable
>> even with the placement of annotations directly on Element's and
>> TypeMirror's [2]. I don't see changes to getTypeParameters() in the
>> langtools changeset linked from JDK-8007803.
>> Alex
>> [1]
>> [2]
> When using the tip of TL with some local changes, the behavior I'm seeing is
> that declaration annotations on type parameters are *not* being retrieved
> from the AnnotedConstruct methods when called on a TypeParameterElement. I
> wanted to double check if this was the expected behavior right now or if I
> should continue to look for operator error on my part. (I see there are some
> langtools tests which reference TYPE_PARAMETER, but I haven't traced through
> what they test.)
> -Joe

More information about the type-annotations-dev mailing list