RFR: JDK-8315458 Implement JEP 463: Implicitly Declared Classes and Instance Main Method (Second Preview) [v19]

Jim Laskey jlaskey at openjdk.org
Wed Nov 15 15:57:49 UTC 2023


On Tue, 14 Nov 2023 13:35:46 GMT, Jim Laskey <jlaskey at openjdk.org> wrote:

>> Address changes from JEP 445 to JEP 463.
>> 
>> - Move from a SYNTHETIC unnamed class to a MANDATED implicit class.
>> 
>> - Don't mark class on read.
>> 
>> - Remove reflection and annotation processing related to unnamed classes.
>> 
>> - Simplify main method search.
>
> Jim Laskey has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Filter abstract main methods and search interfaces for default main methods.

Look at the spec https://bugs.openjdk.org/browse/JDK-8319252 under 7.3 Compilation Units.

- It is not abstract (8.1.1.1 ⇗).
- It is final (8.1.1.2 ⇗).
- It is a member of an unnamed package (7.4.2 ⇗) and **has package access**. Its direct superclass is Object (8.1.4 ⇗).
- It does not have any direct superinterfaces (8.1.5 ⇗).
- The body of the class contains every ClassMemberDeclaration (these are declarations of fields (8.3 ⇗), methods (8.4 ⇗), member classes (8.5 ⇗), and member interfaces (9.1.1.3 ⇗)) from the simple compilation unit. It is not possible for a simple compilation unit to declare an instance initializer (8.6 ⇗), static initializer (8.7 ⇗), or constructor (8.8 ⇗).
-It has an implicitly declared default constructor (8.8.9 ⇗).

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

PR Comment: https://git.openjdk.org/jdk/pull/16461#issuecomment-1812796001


More information about the compiler-dev mailing list