Change for 8248135: Build microbenchmarks with --enable-preview makes other non-preview JMH benchmarks to fail

David Holmes david.holmes at oracle.com
Tue Jul 7 08:13:04 UTC 2020


Hi Peter,

cc Claes

On 7/07/2020 5:59 pm, Peter Levart wrote:
> Hi,
> 
> 
> Recently I proposed and pushed a change for [1] which adds 
> --enable-preview option to javac compilation of JMH microbenchmarks in 
> general to enable running a benchmark that uses preview feature 
> (Records). This makes the class files produced marked with version 
> 60.65535. The benchmark that uses preview feature executes without 
> problems because it explicitly specifies the following in its code:
> 
> 
> @Fork(value = 1, warmups = 0, jvmArgsAppend = "--enable-preview")
> 
> 
> Recently I wanted to run JMH benchmarks for Stream ops with:
> 
> 
> make test TEST="micro:java.util.stream.ops"
> 
> 
> ...but all of them fail to run with the following exception:
> 
> 
> java.lang.UnsupportedClassVersionError: Preview features are not enabled 
> for 
> org/openjdk/bench/java/util/stream/ops/value/generated/NoneMatchShort_seq_start_jmhTest 
> (class file version 60.65535). Try running with '--enable-preview'
> 
> 
> What shall we do? Add similar annotation to all of them? Is there a way 
> to specify that all micro benchmarks should be run with --enable-preview 
> option passed to java?

So this breaks running all non-preview using benchmarks? If so I say we 
need to backout the change for 8248135 while a proper solution is found.

David
-----

> 
> [1] https://bugs.openjdk.java.net/browse/JDK-8248135
> 
> 
> Regards, Peter
> 
> 



More information about the build-dev mailing list