RFR: JDK-8283730: Improve discussion of modeling of packages and modules

Alex Buckley alex.buckley at oracle.com
Mon Mar 28 17:06:38 UTC 2022


On 3/28/2022 9:50 AM, Joe Darcy wrote:
> On 3/28/2022 9:08 AM, Alex Buckley wrote:
>> Wait, what are "named packages without explicit declarations"?
>>
> A package without a package-info file, but with classes or interfaces 
> declared to be in that package.

Those classes and interfaces are thus declared in a compilation unit 
_that also contains a package declaration_. `package p;` is a 
first-class, full-strength, 100%-explicit package declaration whether it 
appears in Foo.java or package-info.java. I think the Language Model API 
is seeking the idea of "a named package with a _standalone_ declaration, 
i.e., the package declaration occurs in an otherwise empty compilation 
unit. Typically, this package declaration occurs in a source file called 
package-info.java."

Alex


More information about the compiler-dev mailing list