On Tue, 16 Dec 2025 16:54:20 GMT, Paul Hübner <[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.

@Arraying Yes. javac and javap should not exhibit consistent behavior when 
their underlying runtime enables preview or not.

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

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

Reply via email to