On Wed, 25 Mar 2026 20:40:52 GMT, Chen Liang <[email protected]> wrote:

>> src/java.base/share/classes/jdk/internal/reflect/AccessFlagSet.java line 99:
>> 
>>> 97:     /// Users no longer have to explicitly assign access flags to their 
>>> correct bit positions.
>>> 98:     static AccessFlag[] createDefinition(AccessFlag... known) {
>>> 99:         var ret = new AccessFlag[Character.SIZE];
>> 
>> Character.SIZE is misleadingly named or used, implying something related 
>> Characters.
>> Short.SIZE would be more appropriate and aligns better with the class file 
>> ushort in hotspot.
>
> This is somewhat an open question - char is equivalent to u2; Class uses char 
> to represent modifiers and classFileAccessFlags, which was presumably due to 
> its zero-extension behavior. I want to hear more voices on this topic.

No quibble with using char; though It would more natural to define your own 
constant for 16
avoiding any relation to characters.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/30248#discussion_r2998403363

Reply via email to