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

Vicente Romero vromero at openjdk.org
Fri May 5 17:38:25 UTC 2023


On Fri, 5 May 2023 17:22:03 GMT, Rémi Forax <forax at openjdk.org> wrote:

>> 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.

good point

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

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


More information about the core-libs-dev mailing list