What is a language construct?
David M. Lloyd
david.lloyd at redhat.com
Fri Dec 23 11:14:15 PST 2011
On 12/23/2011 12:52 PM, Jesse Glick wrote:
> On 12/23/2011 11:59 AM, Alex Buckley wrote:
>> to align the language with the module system, the scope
>> of observability will grow to encompass module dependences
>> and the scope of accessibility will grow to encompass module exports.
>
> I fail to see how the tradition of the JLS forces such a system to
> represent modules directly in Java source files. Following the style of
> chapter 7, the JLS could simply say something to the effect of:
>
> - A host system may group compilation units [or types?] into sets called
> "modules". The host system must then determine which other modules are
> observable from a given module, and may specify that some types [or
> packages? or individual elements?] within those modules are to be
> considered inaccessible despite the other provisions in the section
> "Access Control".
It would be even better if this could be refined to draw a 1:0..1
equivalence between a class loader and a module, and define the access
control in terms of the class loader. This also expands the visibility
rule to non-modular code which could be quite useful, and closely
matches existing package accessibility rules as well.
The only reason given to allow multiple modules to share a class loader
is for the purposes of code which expects JDK classes to have a "null"
class loader. But I don't see this as a serious hurdle - there are many
reasons that code may need updating after Java 8 and singling out this
one as the one unacceptable change seems a bit unrealistic.
--
- DML
More information about the jigsaw-dev
mailing list