Apart the fact that the method should be called packages(), no :) Also the implementation makes the order of the calls important, i.e. contains() has to be called after all the other methods. If you move the code that checks that a package can not be at the same time in concealed packages and in opens or exports in build(), the problem disappear.
thanks, Rémi ----- Mail original ----- > De: "Alan Bateman" <alan.bate...@oracle.com> > À: fo...@univ-mlv.fr > Cc: "jigsaw-dev" <jigsaw-dev@openjdk.java.net> > Envoyé: Samedi 19 Novembre 2016 19:38:39 > Objet: Re: Configuration.resolveRequires want providers of services to be in > an exported package > On 19/11/2016 18:02, fo...@univ-mlv.fr wrote: >> Ok, find the bug, obvious in retrospect, >> there is no way to declare a concealed package using the >> ModuleDescriptor.Builder so my configuration miss concealed packages thus the >> configuration that i try to verify is ill formed. >> >> The builder should be able to declare concealed packages or all packages. >> > Is there any reason why you can't use the `contains` method, as in : > ModuleDescriptor.module("m1").requires("m2").exports("p").contains("p.internal").build(); > > -Alan.