On Wed, 15 Nov 2023 15:54:26 GMT, Jim Laskey <jlas...@openjdk.org> wrote:
>> 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 ⇗). @JimLaskey, in my experiments for JDK-8308715 (Create a mechanism for Implicitly Declared Class javadoc), I found that `javax.lang.model.util.Elements.getOrigin` reports `Origin.EXPLICIT` for the implicitly declared class and `Origin.MANDATED` for that class' constructor. Shouldn't they both be `Origin.MANDATED` because the elements are created from source, not class files, which have some limitations on `ACC_MANDATED`? ------------- PR Comment: https://git.openjdk.org/jdk/pull/16461#issuecomment-1820659000