Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi!
I would like to propose an alternative strategy for getting the lambda class bytes. Starting with JDK 9, class file transformers are not invoked for generated lambda classes anymore [1], which is the reason Retrolambda currently fails when run with Java 11 with the
-javaagent
option. This PR makes Retrolambda patch JDK'sInnerClassLambdaMetafactory
instead, getting the bytes directly from itsspinInnerClass
method. This way, one can run Retrolambda with both Java 8 as well as Java 11 (input classes must still be compiled to Java 8 of course).The primary motivation for this change was to be able to run a Maven build with Java 11 (with
--release 8
or-source 8 -target 8
) and have the Retrolambda Maven plugin transform the classes to Java 6 bytecode, without needing to also have JDK 8 available and passing its path in the<java8home>
plugin configuration option.[1] http://mail.openjdk.java.net/pipermail/core-libs-dev/2016-January/038199.html