On Mon, 1 May 2023 13:06:24 GMT, Jim Laskey <[email protected]> wrote:
>> Add flexible main methods and anonymous main classes to the Java language.
>
> Jim Laskey has updated the pull request incrementally with two additional
> commits since the last revision:
>
> - Anonymous main classes renamed to unnamed classes
> - Add test
src/java.base/share/classes/jdk/internal/misc/MainMethodFinder.java line 70:
> 68: correctArgs(method) &&
> 69: // Only statics in the declaring class
> 70: (!isStatic(method) || declc == refc)
Should this also exclude `abstract` and `native` methods named `main`?
src/java.base/share/classes/jdk/internal/misc/MainMethodFinder.java line 134:
> 132:
> 133: /**
> 134: * {@return priority main method or null if none found}
I think this javadoc is perhaps outdated? The current implementation of this
method throws a `NoSuchMethodException` when it can't find any eligible main
method.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13689#discussion_r1185896198
PR Review Comment: https://git.openjdk.org/jdk/pull/13689#discussion_r1185898281