RFR: JDK-8306112 Implementation of JEP 445: Unnamed Classes and Instance Main Methods (Preview) [v8]
Jim Laskey
jlaskey at openjdk.org
Fri May 5 15:24:50 UTC 2023
On Fri, 5 May 2023 09:30:54 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:
>> 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 142:
>
>> 140:
>> 141: if (mainMethod.getDeclaringClass() != mainClass) {
>> 142: System.err.println("WARNING: static main in super class will be deprecated.");
>
> Similarly, this warning would have to be logged only if the method is `static`. Furthermore, do you think we should include the declaring class in the log message to provide some context on what's causing this warning? Something like:
>> WARNING: static main(String[]) in super class foo.bar.Parent will be deprecated.
Yes this is an oversight on my part.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13689#discussion_r1186223626
More information about the core-libs-dev
mailing list