Configuration checks on uses service is too strict

forax at univ-mlv.fr forax at univ-mlv.fr
Sun Nov 20 13:39:37 UTC 2016


Sorry, again, not a bug,
i've forgotten to add java.base by default,
i was thinking that the ModuleDescriptor.Builder was adding it by default but this is not the case.

Rémi

----- Mail original -----
> De: "Alan Bateman" <Alan.Bateman at oracle.com>
> À: "Remi Forax" <forax at univ-mlv.fr>, "jigsaw-dev" <jigsaw-dev at openjdk.java.net>
> Envoyé: Samedi 19 Novembre 2016 23:12:16
> Objet: Re: Configuration checks on uses service is too strict

> On 19/11/2016 20:39, Remi Forax wrote:
> 
>> Ok, i may have a found bug.
>>
>> The spec says (section 1.1.3)
>> "The service interface may be declared in the current module or in another
>> module. If the service interface is not declared in the current module, then
>> the service interface must be accessible to code in the current module, or a
>> compile-time error occurs."
>> but the check in Resolve.checkExportSuppliers is this one:
>>      // uses S
>>      for (String service : descriptor1.uses()) {
>>          String pn = packageName(service);
>>          if (!packageToExporter.containsKey(pn)) {
>>              fail("Module %s does not read a module that exports %s",
>>                   descriptor1.name(), pn);
>>          }
>>       }
>> which doesn't take care of the case of a service interface declared in another
>> module.
>>
> I don't see a bug here. If m1 `uses p.S` and m1 reads m2 that exports p
> to at least m1 then this map will contain p -> m2.
> 
> -Alan.


More information about the jigsaw-dev mailing list