RFR: 8242451: ensure semantics of non-capturing lambdas are preserved independent of execution mode [v3]

Mandy Chung mchung at openjdk.java.net
Fri Sep 11 18:22:56 UTC 2020

On Wed, 9 Sep 2020 16:41:22 GMT, Mandy Chung <mchung at openjdk.org> wrote:

>> Gilles Duboscq has updated the pull request incrementally with one additional commit since the last revision:
>>   Remove disableEagerInitialization concerns from BridgeMethod.java
> Looks good.   I agree with Jan's suggestion that it's good to move the test to test/jdk/java/lang/invoke/lambda which
> is a better home for it.

Thanks for updating BridgeMethod.java.

I expected that the new LambdaEagerInitTest.java will be updated to verify the capturing
 lambda case that does not have the static `LAMBDA_INSTANCE$` field.  BTW,
this new regression test should be moved to `test/jdk/java/lang/invoke/lambda/`
instead of `test/jdk/java/lang/invoke`.  The test uses `assert`.   Note that java
assertion is not enabled by default.  So regression tests should do an explicit check
and throw runtime exception when the test fails.    You can also use the JDK test
library `jdk.test.lib.Asserts` or make this a testng test to use TestNG Asserts API.

I updated and improved the test for your reference (send you separately).


PR: https://git.openjdk.java.net/jdk/pull/93

More information about the compiler-dev mailing list