[9] Review request : JDK-8057719: Develop new tests for LambdaForm Reduction and Caching feature

Paul Sandoz paul.sandoz at oracle.com
Thu Sep 11 13:12:27 UTC 2014

On Sep 5, 2014, at 7:52 PM, Konstantin Shefov <konstantin.shefov at oracle.com> wrote:

> Hello,
> Please review the new tests for the feature "Lambda Form Reduction and Caching" https://bugs.openjdk.java.net/browse/JDK-8046703
> JBS task: https://bugs.openjdk.java.net/browse/JDK-8057719
> Webrev: http://cr.openjdk.java.net/~kshefov/8057719/webrev.00/
> These tests also depend on testlibrary change: https://bugs.openjdk.java.net/browse/JDK-8057707
> Webrev of the testlib change: http://cr.openjdk.java.net/~kshefov/8057707/webrev.00/

Generally looks good. It would be interesting see code-coverage results.

Are you sure the LFMultiThreadCachingTest is sufficiently testing the thread-safety of j.l.invoke classes? It might be that more threads need to be generated (== #cores), and the test repeatedly performed in a loop to increase the chance of stuff stomping on each other. (I see you have iterations in the outer loop of runTests, that might be sufficient, but you might need a tighter loop specific to each test in LFMultiThreadCachingTest).

A general comment, feel free to ignore. It's easy to use EnumSet to obtain a collection of enum values:

  Set<TestMethods> tms = EnumSet.allOf(TestMethods.class)

and filtered:

  Set<TestMethods> tms = EnumSet.complementOf(EnumSet.of(TestMethods.IDENTITY, TestMethods.CONSTANT))

(Quite concise with a static import.)

Change LambdaFormTestCase.runTests to accept a Collection<TestMethods> and you are good to go :-)


More information about the core-libs-dev mailing list