RFR JDK-8191969: javac produces incorrect RuntimeInvisibleTypeAnnotations length attribute

Srikanth srikanth.adayapalam at oracle.com
Tue Nov 28 11:45:42 UTC 2017


Hello,

JDK-8191969 is a JDK8u backport task created for JDK-8144185 which was 
pushed for JDK10
here: http://hg.openjdk.java.net/jdk10/jdk10/langtools/rev/0b32afcabef4

We have a request from asm tool maintainers and also from other sources 
through the sustenance channel for a backport.

Synopsis:

Basically problem arises when metadata that models the type annotations 
on a captured outer local are shared with the lambda implementation 
method's formal parameter that corresponds to the
captured outer local.

Any changes to one will invalidate the other. This is in fact what 
causes grief for asm.

However, as per the spec clarification spelled out here: 
http://mail.openjdk.java.net/pipermail/compiler-dev/2015-December/009866.html 
we should not be transmitting the annotations from the captured outer 
locals to any formal parameter that represents/reifies the captured 
outer local in a synthetic lambda implementation method.

Thus aligning to the spec, makes the problem vanish automatically.

8u webrev:

http://cr.openjdk.java.net/~sadayapalam/JDK-8191969/webrev.00/

(This is essentially the same fix pushed for jdk10, with the patch 
manually applied to jdk8u-dev)

All relevant tests are green. Please review.
Thanks in advance.
Srikanth




More information about the compiler-dev mailing list