On Wed, 15 Jul 2026 17:57:27 GMT, Jaikiran Pai <[email protected]> wrote:

>> TestEnableNativeAccessJarManifest has a `@enablePreview` jtreg directive. 
>> This test was added in the commit where FFM became a permanent feature, so 
>> its omission was likely an oversight.
>> 
>> Now, this test declares a record, which makes all its class files preview 
>> with JEP 401. As a consequence, the command line arguments are no longer 
>> sufficient to run the test. We can simply remove `@enablePreview` to clear 
>> this butterfly effect.
>> 
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Hello Chen,
> 
>> Now, this test declares a record, which makes all its class files preview 
>> with JEP 401. As a consequence, the command line arguments are no longer 
>> sufficient to run the test.
> 
> I don't fully follow what the issue is, especially the part about command 
> line arguments being no longer sufficient. Which command line arguments are 
> those? The exact error(s) this test generates against a JDK that has JEP-401 
> implementation will be useful to see.

@jaikiran See example excerpt from 
https://github.com/liach/valhalla/actions/runs/29372000486/job/87221798714#step:10:1993

Error: LinkageError occurred while loading main class 
TestEnableNativeAccessJarManifest$Reinvoker
        java.lang.UnsupportedClassVersionError: Preview features are not 
enabled for TestEnableNativeAccessJarManifest$Reinvoker (class file version 
72.65535). Try running with '--enable-preview'


In openjdk/valhalla#2643, since this test is `@enablePreview` and declares a 
`static record`, the class files produced by this test are all dependent on 
preview features, including that for 
`TestEnableNativeAccessJarManifest$Reinvoker`. This test tries to invoke this 
main class without `--enable-preview` to the Java launcher, causing this test 
to fail.

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

PR Comment: https://git.openjdk.org/jdk/pull/31916#issuecomment-4983846199

Reply via email to