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:11:28 UTC 2023
On Fri, 5 May 2023 16:18:42 GMT, Jim Laskey <jlaskey at openjdk.org> wrote:
>> Add flexible main methods and anonymous main classes to the Java language.
>
> Jim Laskey has updated the pull request incrementally with one additional commit since the last revision:
>
> Recommended changes #2
src/java.base/share/classes/jdk/internal/misc/MainMethodFinder.java line 138:
> 136: * @param mainClass main class
> 137: *
> 138: * @throws NoSuchMethodException when not and preview and no method found
wording here? `when not and preview`?
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
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13689#discussion_r1186299301
PR Review Comment: https://git.openjdk.org/jdk/pull/13689#discussion_r1186323116
More information about the build-dev
mailing list