On Thu, 11 Jun 2026 12:32:28 GMT, Chen Liang <[email protected]> wrote:

>> test/jdk/java/lang/invoke/defineHiddenClass/BasicTest.java line 310:
>> 
>>> 308:         assertTrue(hc.isHidden());
>>> 309:         // ACC_SUPER bit may appear spuriously if preview is enabled
>>> 310:         assertEquals(hc.getModifiers() & (~ACC_SUPER), (ACC_PUBLIC | 
>>> accessFlags));
>> 
>> Chen - do you remember why this comment was added? The method source 
>> emptyClasses doesn't have any value classes so I expect IDENTITY to be set 
>> for empty classes that aren't interfaces when preview is enabled. Asking 
>> about "spuriously" suggests something random is going on.
>
> I think this is just bad wording from my part - this should really be 
> `assertEquals(hc.getModifiers(), ACC_PUBLIC | (Number.class.isValue() ? 
> ACC_IDENTITY : 0) | accessFlags);` so we don't need to query 
> `PreviewFeatures`.

Incorporated a fix in https://github.com/openjdk/valhalla/pull/2536

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

PR Review Comment: https://git.openjdk.org/jdk/pull/31123#discussion_r3396245796

Reply via email to