On Tue, 16 Dec 2025 16:41:50 GMT, Chen Liang <[email protected]> wrote:

> Fixes the inconsistency observed by @Arraying for this test.

We have some test setups with and without preview that use an alternative 
structure without `-Dpreview` by making use of `@enablePreview`, as follows:

/*
 * @test id=NoPreview
 * @bug 8161013
 * @summary Verify that anonymous class binaries have the correct flags set
 * @modules java.base/jdk.internal.misc
 * @comment Ensure that that this test is skipped if the test is run on a 
preview enabled
            VM as the compiled test class has not been forced into preview mode.
            Valhalla affects the outcome.
 * @requires !java.enablePreview
 * @run main AnonymousClassFlags
 */

/*
 * @test id=Preview
 * @bug 8161013
 * @summary Verify that anonymous class binaries have the correct flags set
 * @modules java.base/jdk.internal.misc
 * @enablePreview
 * @compile -XDforcePreview AnonymousClassFlags.java
 * @run main AnonymousClassFlags
 */

Personally I think the above style is a bit cleaner, and we definitely run this 
PR's test without `--enable-preview` in tier1, so both tests would get executed 
in tier1. What do you think? I'm not super fussed about it.

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

PR Comment: https://git.openjdk.org/valhalla/pull/1807#issuecomment-3661499257

Reply via email to