RFR: JDK-8198945: Invalid RuntimeVisibleTypeAnnotations for annotation on anonymous class type parameter

Liam Miller-Cushon cushon at google.com
Wed Jul 11 00:44:39 UTC 2018

On Fri, Jul 6, 2018 at 7:24 PM Werner Dietl <wdietl at gmail.com> wrote:

> Does this sound good to you?

Yes, I agree with your summary. Thanks for the corrections and

In particular I agree that speaking of 'duplicating' annotations is
incorrect, 'propagating' seems to be a better word. Parts of the annotation
structures are copied when propagating annotations from the anonymous class
supertype to the new expression (e.g. the element value pair structure),
but not the target_type or type_path.

I updated the fix to only propagate annotations from the top-level
supertype. For example, given `new @A Outer. @B Inner<@C Object>() {}` we
propagate only `@B`. When the annotations are propagated an appropriate
location is generated with one or more INNER_TYPE entries to place the
annotation on the anonymous' class synthetic declaration type.

Here's the latest webrev:

While continuing to investigate this I think I discovered a couple of
related bugs:
* https://bugs.openjdk.java.net/browse/JDK-8207017
* https://bugs.openjdk.java.net/browse/JDK-8207018

I can continue to iterate on the fix to try to fix those issues as well,
but they might be distinct enough to be worth dealing with separately.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20180710/18246787/attachment.html>

More information about the compiler-dev mailing list