RFR: JDK-8234729: Javac should eagerly change code generation for method references to avert IllegalAccessError in future.
srikanth.adayapalam at oracle.com
Mon Nov 25 12:00:18 UTC 2019
Just as a curiosity/academic exercise, I instrumented javac to gather
statistics on how many method references are encountered in a clean
build of OpenJDK mainline tip and how many of those would trigger the
Total method references encountered: 1715
Ones that would trigger the problem scenario: 0
On 25/11/19 4:39 PM, Srikanth wrote:
> JBS ticket: https://bugs.openjdk.java.net/browse/JDK-8234729
> Webrev link:
>  Hidden Classes JEP: http://openjdk.java.net/jeps/8220607
>  Corresponding JBS ticket:
>  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  eventually makes its way into mainline via
> , 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 IllegalAccessError.
> This was discovered in the nestmates work in Valhalla and was fixed
> locally there via .
> The present task JDK-8234729 is to bring forward the fix in
> JDK-8227415  to jdk/jdk ahead of time, so as to minimize
> compatibility risks. If  and  were released together, then any
> code compiled using older compilers that involves the scenario may
> trigger an IAE and will have to recompiled.
> More detailed description in
> The proposed fix passes all langtools tests and JCK tests.
More information about the compiler-dev