On Tue, 11 Aug 2026 16:10:35 GMT, Chris Plummer <[email protected]> wrote:

>> We can see following errors when we run `make test` with 
>> `JTREG="VALUE_CLASS_PLUGIN=true;VM_OPTIONS=--enable-preview"`:
>> 
>> TestInstanceKlassSize
>> 
>>  stderr: [Exception in thread "main" java.lang.UnsupportedClassVersionError:
>>  Preview features are not enabled for jdk/test/whitebox/WhiteBox (class file
>>  version 72.65535). Try running with '--enable-preview'
>>         at java.base/java.lang.ClassLoader.findBootstrapClass(Native Method)
>>         at java.base/java.lang.ClassLoader.findBootstrapClassOrNull(ClassLoa
>> der.java:1244)
>>         at java.base/java.lang.System$1.findBootstrapClassOrNull(System.java
>> :2068)
>>         at java.base/jdk.internal.loader.ClassLoaders$BootClassLoader.loadCl
>> assOrNull(ClassLoaders.java:138)
>>         at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(
>> BuiltinClassLoader.java:639)
>>         at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(
>> BuiltinClassLoader.java:615)
>>         at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(
>> BuiltinClassLoader.java:639)
>>         at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(
>> BuiltinClassLoader.java:615)
>>         at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Builti
>> nClassLoader.java:578)
>>         at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:502)
>>         at TestInstanceKlassSize.<clinit>(TestInstanceKlassSize.java:65)
>> ]
>>  exitValue = 1
>> 
>> java.lang.RuntimeException: Expected to get exit value of [0], exit value is
>> : [1]
>>         at jdk.test.lib.process.OutputAnalyzer.shouldHaveExitValue(OutputAna
>> lyzer.java:602)
>>         at TestInstanceKlassSize.startMeWithArgs(TestInstanceKlassSize.java:
>> 100)
>>         at TestInstanceKlassSize.main(TestInstanceKlassSize.java:152)
>>         at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(
>> DirectMethodHandleAccessor.java:104)
>>         at java.base/java.lang.reflect.Method.invoke(Method.java:583)
>>         at com.sun.javatest.regtest.agent.MainMethodHelper.executeModernMain
>> Class(MainMethodHelper.java:55)
>>         at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapp
>> er.java:138)
>>         at java.base/java.lang.Thread.run(Thread.java:1527)
>> 
>> 
>> TestInstanceKlassSizeForInterface
>> 
>>  stderr: [Exception in thread "main" java.lang.UnsupportedClassVersionError: 
>> Preview features are not enabled for jdk/test/whitebox/WhiteBox (class file 
>> version 72.65535). Try running wit...
>
> I think your fix is correct, but there is still the question of why this does 
> not impact other tests that use `createLimitedTestJavaProcessBuilder`. The 
> only difference I could find that might explain it is that this test uses 
> "@build jdk.test.whitebox.WhiteBox". It looks like WhiteBox.class is marked 
> as preview-dependent, probably because it is referencing a class that uses 
> preview features even though WhiteBox itself is not using preview features. 
> So likely the `@build` part of this is not relevant. It's only relevant that 
> the the test needs the class and the class is marked preview-dependent.
> 
> There is risk that a more commonly used JDK class could in the future get 
> marked as preview-dependent, causing more tests that use 
> `createLimitedTestJavaProcess` to start failing in the same way, so this is 
> an argument for moving this to `createLimitedTestJavaProcess`. However, I'm 
> fine for now with the just being done for these two tests, and we can address 
> moving it to `createLimitedTestJavaProcess` with another CR.

@plummercj 
Thanks for your approval and comments!

> we can address moving it to createLimitedTestJavaProcess with another CR.

(I believe you mean moving to "createTestJavaProcessBuilder")
Yes, I think we should do it on follow up CR (will be created by Paul).

-------------

PR Comment: https://git.openjdk.org/jdk/pull/32262#issuecomment-5260610214

Reply via email to