Thanks Archie and Tagir. I have updated the spec.

Gavin

On 3 May 2023, at 15:23, Archie Cobbs <[email protected]> wrote:

I think this will be a nice addition.

On Tue, May 2, 2023 at 5:17 PM Gavin Bierman 
<[email protected]<mailto:[email protected]>> wrote:
The first draft of the spec change document for the feature Unnamed classes and 
instance main methods [1] (the "on-ramp" feature) is now available at:

https://cr.openjdk.org/~gbierman/jep445/latest/

1. Minor nit: "An unnamed top level class compilation unit implicitly declares 
an class..." -  should be "a class".

2. Just to clarify my own understanding, is this correct? "Unnamed top level 
class" is a source code only concept; given a class file, it is not possible to 
definitively say whether it came from an "unnamed top level class".

3. The JEP shows an example of compiling a class "HelloWorld.java" into a class 
file "HelloWorld.java" and states "In this case the compiler chooses HelloWorld 
for the class name as an implementation detail". So far, so good. But then in 
the spec it says:

In simple implementations of the Java SE Platform, where compilation units are 
stored in files, the binary name of an unnamed top level class would typically 
be the name of the file containing the unnamed top level class compilation unit 
(7.3<https://cr.openjdk.org/~gbierman/jep445/jep445-20230502/specs/unnamed-classes-instance-main-methods-jls.html#jls-7.3>).

That would imply that the binary name of the JEP example would be 
"HelloWorld.java", not "HelloWorld". So maybe to clarify this should say "the 
name of the file (minus the ".java" suffix) containing the unnamed top level 
class compilation unit".

-Archie

--
Archie L. Cobbs

Reply via email to