Draft Spec for Preview of Module Import Declarations (JEP 476)

Gavin Bierman gavin.bierman at oracle.com
Tue Apr 30 11:35:04 UTC 2024


Thanks Alex. I updated the online version.

> On 26 Apr 2024, at 17:34, Alex Buckley <alex.buckley at oracle.com> wrote:
> 
> A few small things:
> 
> - 7.5 says "A single-module-import declaration (7.5.5) imports all the accessible classes and interfaces, as needed, from every package exported by a given module."  The "every package" makes me a little nervous because there might be qualified exports which are not importable by the s-m-i declaration. That is, we don't want 7.5 to conflict with 7.5.5's "The packages exported by the module M ***to the current module.***"  Recommend: "A single-module-import declaration (7.5.5) imports all the accessible classes and interfaces of the packages exported by a given module, as needed."  Unlike the preceding four bullets, we don't mention the canonical name of the module, because at present modules don't have canonical names; that's probably still OK.

Done, thanks.

> 
> - Example 7.5.5-1 mentions "All simple compilation units implicitly import the module java.base (7.3)." which should be a normative statement, not an informative one. (I'm sure it will move/relate to a new section on Simple Compilation Units in future, but for now we shouldn't lose it in an example.)

Oops - that sentence shouldn’t appear at all. Removed.

> 
> - I recommend having Example 7.5.5-1 be "Single-Module-Import in Ordinary Compilation Units", forking off Example 7.5.5-2 "Single-Module-Import in Modular Compilation Units" at "Import declarations can also appear in a modular compilation unit." Eventually there will be an Example of "S-M-I in Simple Compilation Units”.

Yes, good idea, thanks. Done.

Gavin





More information about the amber-spec-observers mailing list