Annotations on Type

Werner Dietl wdietl at
Thu Dec 5 14:08:53 PST 2013

Hi all,

I just noticed that the following test is @ignored:


The test doesn't have a valid bug ID, so I couldn't check whether
anyone is working on it.
I found this mailing list discussion, which I think was the start for
this test case:

In the type-annotations repository, I've added more test cases that
illustrate another aspect of this issue.

If you have a generic type like "List<@TA String>" the type annotation
@TA is correctly put into the String tree.type field (in Worker()
{...}.run()), however, this happens after the type for List is
The List tree only has type "List<String>" instead of "List<@TA String>".
The later modification of the type of String obviously doesn't modify
the type argument list for the "List" type. only
takes the un-annotated type.
When creates
the list of actuals, it stores these un-annotated types. Later updates
to the type argument Trees are then not reflected here.

In a previous iteration, we created an AnnotatedType with empty
annotations and later filled in the actual annotations. This ensured
that all locations that referenced the AnnotatedType were updated, but
had other drawbacks.

Is somebody working on fixing this test case?
Any ideas for how we can fix this?

I pushed the extended test case to the type-annotations repository:

I also performed a few cleanups:

- get rid of all "unused import" warnings in langtools javax packages:

- typo fix:

- improve an error message:

- don't build an error String for a simple null check:

- don't create unused local variable:

All feedback and reviews for pushing to TL welcome!

cu, WMD.


More information about the type-annotations-dev mailing list