[module-import] Modules transitively requiring module java.base

Remi Forax forax at univ-mlv.fr
Wed Sep 25 10:25:48 UTC 2024


> From: "Tagir Valeev" <amaembo at gmail.com>
> To: "Gavin Bierman" <gavin.bierman at oracle.com>
> Cc: "amber-dev" <amber-dev at openjdk.org>, "amber-spec-experts"
> <amber-spec-experts at openjdk.org>
> Sent: Wednesday, September 25, 2024 11:44:12 AM
> Subject: Re: [module-import] Modules transitively requiring module java.base

> I support this change, thank you!

> Tagir

I agree, this is a useful addition. 

Rémi 

> On Wed, Sep 25, 2024, 11:30 Gavin Bierman < [ mailto:gavin.bierman at oracle.com |
> gavin.bierman at oracle.com ] > wrote:

>> Dear all,

>> People playing with JEP 476 - Module Import Declarations - have been surprised
>> when importing an aggregator module such as ` [ http://java.se/ | java.se ] `,
>> that they also needed to `import module java.base`. This is because the ` [
>> http://java.se/ | java.se ] ` module which, as an aggregator module, consists
>> of only `requires transitive` directives, does not contain the directive
>> `requires transitive java.base`. Currently Java forbids any module declaring a
>> transitive dependence on the `java.base` module.

>> This restriction was sensible in the original module system design as all
>> modules have an implicit dependence on `java.base`, and so such a directive was
>> pointless. But with the module import feature where module declarations are
>> used to derive a set of packages to be imported, this directive is useful and
>> so should be allowed.

>> We propose in the next preview of this feature to lift the language restriction
>> on `requires transitive java.base`, and also to change the implementation of
>> the ` [ http://java.se/ | java.se ] ` module so that it `requires transitive
>> java.base`. (I have updated the draft JEP: [ https://openjdk.org/jeps/8335987 |
>> https://openjdk.org/jeps/8335987 ] )

>> Let me know your thoughts on this proposal either on this list, or direct to me.

>> Thanks,
>> Gavin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-spec-experts/attachments/20240925/5b6e793d/attachment.htm>


More information about the amber-spec-experts mailing list