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

Liam Miller-Cushon cushon at google.com
Tue Jul 3 02:34:03 UTC 2018


On Mon, Jul 2, 2018 at 7:14 PM Werner Dietl <wdietl at gmail.com> wrote:

> Class Test$1 has no type arguments, so I would find having NEW type
> annotations on a type argument confusing.
>

Ah, right. Thanks for the catch.


> So I would be for either no NEW type annotations for anonymous class
> instantiations, or duplicating only the top-level type annotations.
> For method f() this would generate three type annotations:
>
>       RuntimeInvisibleTypeAnnotations:
>         0: #22(): NEW, offset=9
>           Test$TA
>         1: #23(): NEW, offset=9, location=[TYPE_ARGUMENT(0)]
>           Test$TB
>         2: #22(): NEW, offset=0
>           Test$TA
>
> Duplicating only the top-level type annotations would be my slight
> preference over no NEW annotations at all.


I revised the fix to only duplicate top-level annotations:
http://cr.openjdk.java.net/~cushon/8198945/webrev.02
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20180702/fcd8189c/attachment.html>


More information about the compiler-dev mailing list