RFR: JDK-8306112 Implementation of JEP 445: Unnamed Classes and Instance Main Methods (Preview) [v9]

Rémi Forax forax at openjdk.org
Fri May 5 17:31:31 UTC 2023


On Fri, 5 May 2023 17:08:35 GMT, Vicente Romero <vromero at openjdk.org> wrote:

>> Jim Laskey has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Recommended changes #2
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java line 3999:
> 
>> 3997:         Name name = names.fromString(simplename);
>> 3998:         JCModifiers anonMods = F.at(primaryPos)
>> 3999:                 .Modifiers(Flags.FINAL|Flags.MANDATED|Flags.SYNTHETIC|Flags.UNNAMED_CLASS, List.nil());
> 
> I wonder if testing if a class has flags: `Flags.FINAL|Flags.MANDATED|Flags.SYNTHETIC` should be enough to know if it is unnamed or not and we don't need to use the new `UNNAMED_CLASS` flag

`Flags.MANDATED` on a class is currently enough to know if it's a unnamed class or not, but it's not enough for classes not produced by javac.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13689#discussion_r1186335538



More information about the build-dev mailing list