Status of retrieving annotations on type parameters?

Joe Darcy joe.darcy at
Thu Mar 28 11:49:16 PDT 2013

On 03/28/2013 07:59 AM, Joel Borggrén-Franck wrote:
> Hi All,
> On 27 mar 2013, at 09:43, Joel Borggrén-Franck <joel.franck at> wrote:
>> On 03/26/2013 10:10 PM, Joe Darcy wrote:
>>> 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
> This is due to type annotations being stored as
> 1)  type attributes since they are going to be emitted in Runtime[In}VisibleTypeAnnotations
> and
> 2) the type attributes are stored on the owning class or method symbol.
> I made a quick fix for this, see inline patch. I'm not sure this is the proper way and I don't have time at the moment to find out, but if it is urgent to you you should be able to work with this patch. If it isn't that urgent I will fix this week after next.

Hi Joel,

Thanks for the patch! With the patch and some quick hacks to the javac 
implementation of javax.lang.model.util.Elements, I'm able to make 
progress on coding up the annotation processing machinery to account for 
annotations on type parameters.


More information about the type-annotations-dev mailing list