Compiling with automatic modules
Alex Buckley
alex.buckley at oracle.com
Tue May 30 19:42:24 UTC 2017
On 5/26/2017 4:12 AM, Jochen Theodorou wrote:
> On 26.05.2017 01:04, Alex Buckley wrote:
> [...]
>> The semantics of an observed JAR without module-info.class are specified
>> as part of JPMS resolution, and JLS 7.3 explicitly defers to that, so I
>> believe it is clear how a compiler must behave when a modular
>> compilation unit 'requires' a module that turns out to be automatic. (Of
>> course a big part of the migration story is that the requirer is unaware
>> of whether the requiree is automatic or explicit.)
>
> Isn't the consequence that I can write a compiler which does only allow
> named modules?
You mean a compiler that understands named module and does not
understand unnamed modules? No, per JLS 7.7.5: "An implementation of the
Java SE Platform must support at least one unnamed module." The
mandates for unnamed modules in 7.7.5 are essentially identical to the
historical mandates for unnamed packages in 7.4.2.
Alex
More information about the jigsaw-dev
mailing list