RFR: JDK-8234729: Javac should eagerly change code generation for method references to avert IllegalAccessError in future.

Srikanth srikanth.adayapalam at oracle.com
Mon Nov 25 11:09:19 UTC 2019

JBS ticket: https://bugs.openjdk.java.net/browse/JDK-8234729
Webrev link: 

[1] Hidden Classes JEP: http://openjdk.java.net/jeps/8220607
[2] Corresponding JBS ticket: 
[3] Nestmates branch specific fix: 

Scenario: Javac's code generation for method references that target a 
protected method declared in a superclass in a different package.


When Hidden Classes JEP [1] eventually makes its way into mainline via 
[2], due to stricter enforcement of access control, code compiled using 
earlier compilers that uses method references that target a protected 
method of a super class in a different package may trigger an 

This was discovered in the nestmates work in Valhalla and was fixed 
locally there via [3].

The present task JDK-8234729 is to bring forward the fix in JDK-8227415 
[3] to jdk/jdk ahead of time, so as to minimize compatibility risks. If 
[2] and [3] were released together, then any code compiled using older 
compilers that involves the scenario may trigger an IAE and will have to 

More detailed description in 

The proposed fix passes all langtools tests and JCK tests.


More information about the compiler-dev mailing list