RFR: JDK-8306112 Implementation of JEP 445: Unnamed Classes and Instance Main Methods (Preview) [v10]
Jim Laskey
jlaskey at openjdk.org
Fri May 5 18:32:30 UTC 2023
On Fri, 5 May 2023 18:15:20 GMT, Vicente Romero <vromero at openjdk.org> wrote:
>> Jim Laskey has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Typo
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/launcher/Main.java line 466:
>
>> 464: } catch (ClassNotFoundException e) {
>> 465: throw new Fault(Errors.CantFindClass(mainClassName));
>> 466: } catch (NoSuchMethodException e) {
>
> `getDeclaredConstructor` can also throw a NSME but this error message would still say that the main method couldn't be found unless at this point we are sure that the class must have a no-args constructor
I was avoiding moving things so not to change behaviour when not in preview, but I think I really need to break it down into separate try blocks; get method, get constructor, execute method. Let me attempt.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13689#discussion_r1186390633
More information about the core-libs-dev
mailing list