RFR: 8362885: A more formal way to mark javac's Flags that belong to a specific Symbol type only [v2]
Jan Lahoda
jlahoda at openjdk.org
Fri Jul 25 13:46:02 UTC 2025
On Fri, 25 Jul 2025 09:20:20 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> Jan Lahoda has updated the pull request incrementally with three additional commits since the last revision:
>>
>> - Fixing toString value for flags that have ACC_ overloaded flags.
>> - Review feedback: marking ACC flags with the @Use annotation, forces split of the TYPE target into CLASS/MODULE/PACKAGE/TYPE_VARIABLE.
>> - Reflecting review feedback:
>> - when conflict is detected, the generator fails
>> - adding runtime checks
>> - using constants for number of bits
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/code/Flags.java line 127:
>
>> 125: // for example.
>> 126: @NotFlag
>> 127: public static final int ACC_SUPER = 0x0020;
>
> Why didn't we add annotation on these ACC ones? After all, they _also_ overlap with previous flags -- e.g. ACC_SUPER overlaps with SYNCHRONIZED, and it works because the former goes on types and the latter on methods. So, isn't this the same trick we're pulling?
Done.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26452#discussion_r2231121152
More information about the compiler-dev
mailing list