JDK-8191112: javac OutOfMemoryError caused by "-Xlint:exports" option
Jan Lahoda
jan.lahoda at oracle.com
Tue Nov 14 19:16:04 UTC 2017
Hi Alex,
On 14.11.2017 20:03, Alex Buckley wrote:
> On 11/14/2017 5:17 AM, Jan Lahoda wrote:
>> ---
>> module mod {
>> requires transitive ext1;
>> exports api;
>> }
>> ---
>>
>> "dep.Dep" is accessible using requires transitive edges of the automatic
>> modules, hence the warning/lint is not printed.
>>
>> That does not seem quite right, an explicit "requires transitive dep"
>> dependency would be better, otherwise the changes in the module path can
>> lead to surprising behavior.
>>
>> The suggested patch is to simply ignore the dependencies of automatic
>> modules in the check - that should avoid the infinite loop and print the
>> warning in the "requires transitive ext1" case.
>
> Good idea to make -Xlint:exports be more sophisticated w.r.t. automatic
> modules ... but for the very last point, are you saying that a warning
> is given for "requires transitive ext1" because of "transitive" or
> because of "ext1"? That is, would a warning be printed for just
> "requires ext1" ? I think it should be; the "transitive" in "requires
> transitive ext1" is for the benefit of consumers of mod, which is not
> germane to mod's barely-visible consumption of dep via ext1's implicit
> "requires transitive dep1".
(For completeness, there are other checks that inspect dependencies on
automatic modules, but this one is not specific to automatic modules, it
warns about using possibly inaccessible types in exported API.)
With the proposed patch, the warning would be printed for all "requires
transitive ext1", "requires ext1" and "requires dep", but not for
"requires transitive dep", as in the last case depending on "mod" will
make exported types from dep available to the client (which may be also
true for "requires transitive ext1", but that depends on how the module
path is constructed). If "ext1" would be an explicit module, which would
have "requires transitive dep", then the warning would not be printed
for "requires transitive ext1". If ext1 would contain only "requires
dep", then the warning would be printed.
Jan
>
> Alex
More information about the jigsaw-dev
mailing list