eclipse-jdt / eclipse.jdt.core

Eclipse Public License 2.0
160 stars 129 forks source link

module lookup on behalf of automatic modules #2764

Open stephan-herrmann opened 2 months ago

stephan-herrmann commented 2 months ago

Debugging #2749 for #2748 I was puzzled by the following:

We have a few code locations where we differentiate if we should look for all observable modules or only for all named modules.

JLS §7 introduces automatic modules without any mention of what an auto module can read.

JEP 261 has nothing helpful in this regard.

Javadoc of ModuleFinder.of() defines how an auto module is identified, and what it exports, but no word on what it reads.

Finally the Javadoc of package java.lang.module declares:

If B is an automatic module, then A "reads" every other enumerated automatic module. (It is "as if" an automatic module has 'requires transitive' directives for every other enumerated automatic module).

In previous bugs like bug 518282 we worked from a version that said

For each enumerated module X that is automatic: X "reads" every other enumerated module

where no restriction to automatic modules was present. I have no record of what "specification" we worked from in those days. I only vividly recall that we had a tremendously hard time to gather any sufficient set of specifications.

At the same time we might want to check for similar loose ends regarding the unnamed module.