RFR: JDK-8220702: compiling in the context of an automatic module disallows --add-modules ALL-MODULE-PATH

Alan Bateman Alan.Bateman at oracle.com
Wed Apr 10 20:24:03 UTC 2019

On 10/04/2019 19:51, Alex Buckley wrote:
> :
> There is a question to be answered: When the compiler compiles code in 
> an automatic module (due to the code being observed in a directory 
> that is specified to --patch-module), then what is the _default set of 
> root modules_ for the automatic module?
> I expect the answer is: the same as the default set of root modules 
> for the unnamed module.
This isn't the case at run-time. If the initial module is an automatic 
module, and there are no additional roots specified with --add-modules, 
then the automatic module will be the sole root. Whether it is patched 
or not via --patch-module doesn't change that of course. The module 
descriptor created for the automatic module will require (mandated) 
java.base so minimally the automatic module + java.base will be in the 
module graph. Run-time does service binding and java.base uses a lot of 
services so the module graph will have ~25 modules when using a JDK 
run-time image. The addition of service binding at run-time probably 
means few would notice the difference but if the right answer is the 
default set of root modules when we should probably change run-time too.


More information about the compiler-dev mailing list