-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
module lookup on behalf of automatic modules #2764
Comments
…2749) Unit test: This test represents a combination of explicit and auto modules with shared package prefixes which triggers the compiler to add a SplitPackageBinding as child of a PlainPackageBinding which should never happen. Fix: When combining packages bindings from different modules, an auto-module should consider all modules declaring the package, because it implicitly reads all modules and getAllRequiredModules() only works with explicit dependencies. Pending follow-up: #2764 fixes #2748 --------- Signed-off-by: Paul Pazderski <[email protected]> Co-authored-by: Paul Pazderski <[email protected]> Co-authored-by: Stephan Herrmann <[email protected]>
I played a bit with this but am no longer sure there's much to be gained here. First attempt: Invent a new flavor of At this point some module tests claimed foul indeed, but the way this surfaced was the dreaded "The type {0} cannot be resolved. It is indirectly referenced from required .class files". Simply hiding types required by binary types is never nice. In particular when the requesting binary type was compiled on the classpath, where the reference was legal! And when the classfile actually exists on the build path. Next I tried to add a
Now the message send Here's what javac reports in this situation:
Also this isn't wrong, but users will ask: why didn't you find it, it's right there! For lack of ideas how to report this without annoying users I'll let it rest. |
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:
In previous bugs like bug 518282 we worked from a version that said
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.
The text was updated successfully, but these errors were encountered: