RFR: JDK-8220702: compiling in the context of an automatic module disallows --add-modules ALL-MODULE-PATH
Alex Buckley
alex.buckley at oracle.com
Wed Apr 10 22:07:27 UTC 2019
On 4/10/2019 2:51 PM, Jonathan Gibbons wrote:
> On 4/10/19 11:51 AM, 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.
>
> I would not expect the fact that you're compiling code in one or more
> automatic modules to have any effect on the module graph. The fact that
> the definitions of some types have been "patched in" using source code
> via --patch-module is (or should be) irrelevant.
I'm not sure how anyone compiles code as if in an automatic module,
since the automatic module is solely a JAR file, but Jan suggests that
it's possible to patch an automatic module's content with the source
files being compiled. So, I looked in JEP 261 to see how javac would
treat those source files:
"If a module descriptor in the form of a module-info.java or
module-info.class file is specified on the command line [NO], or is
found on the source path [NO] or the class path [NO], then source files
will be compiled as members of the module named by that descriptor and
that module will be the sole root module. Otherwise if the --module
<module> option is present [NO] then source files will be compiled as
members of <module>, which will be the root module. Otherwise [I GUESS
WE'RE HERE] source files will be compiled as members of the unnamed
module, and the root modules will be computed as described above."
Alex
More information about the jigsaw-dev
mailing list