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".

Alex

Reply via email to