Accessing type annotations via annotation processor

Gunnar Morling gunnar at
Thu Aug 14 07:00:39 UTC 2014

2014-08-11 20:20 GMT+02:00 Joe Darcy <joe.darcy at>:

> On 08/11/2014 03:22 AM, Gunnar Morling wrote:
>> Hi,
>> I'm looking for a way to obtain annotations given on type uses using a
>> JSR 269 annotation processor.
>> E.g. I'd like to obtain the @NotNull annotation from the following field
>> declaration:
>>     ...
>>     private List<@NotNull String> values;
>> Based on a post of Joe [1] I assumed this to be possible, but a
>> discussion on this list now makes me believe this cannot be done as of Java
>> 8. Is this true? If so, will this be the case in SE 9?
>> On a tangent, Joe referenced a diff of the JavaDocs of two versions of
>> the JSR 269 API, containing nicely colored mark-up highlighting the
>> changes. What's the tool used for creating this diff?
> On the last point, I used a tool called "specdiff." This tool was
> developed by Sun and Oracle, but is not currently available externally.

Ah, I see.

Too bad that it's not available, this tool seems very useful also for other
specs. It would be great to see it published at some point.

> -Joe


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the compiler-dev mailing list