-
Notifications
You must be signed in to change notification settings - Fork 142
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
Add a preference to ignore the unnamed module for split packages #424
Conversation
This is to control whether the error 'The package xxx is accessible from more than one module' will be reported. In https://openjdk.org/projects/jigsaw/spec/sotms/#the-unnamed-module says If a package is defined in both a named module and the unnamed module then the package in the unnamed module is ignored. This preserves reliable configuration even in the face of the chaos of the class path, ensuring that every module still reads at most one module defining a given package. Signed-off-by: Sheng Chen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please find some nitpicks inline.
org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SplitPackageBinding.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SplitPackageBinding.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Sheng Chen <[email protected]>
See: eclipse-jdt/eclipse.jdt.core#424 Signed-off-by: Sheng Chen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're getting closer, great!
With more diligence applied, here's the next round of comments
org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaCorePreferenceInitializer.java
Outdated
Show resolved
Hide resolved
...ore.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/UnnamedModuleTest.java
Outdated
Show resolved
Hide resolved
Hi @stephan-herrmann, I've updated the PR, would you have time to take a look? :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All looks well now. Thanks!
Thank you @stephan-herrmann :) |
…ipse-jdt#424) * Add a preference to ignore unnamed module for split package This is to control whether the error 'The package xxx is accessible from more than one module' will be reported, if the conflict goes away when the unnamed module is ignored. In https://openjdk.org/projects/jigsaw/spec/sotms/#the-unnamed-module says If a package is defined in both a named module and the unnamed module then the package in the unnamed module is ignored. This preserves reliable configuration even in the face of the chaos of the class path, ensuring that every module still reads at most one module defining a given package. Signed-off-by: Sheng Chen <[email protected]>
@stephan-herrmann @jdneo I just came across the preference
but it is quite hard to discover and I was not aware about this only after some google-search with a lot of unhelpful results. Do you think it would be useful to enhance the error message with a hint to the property? e.g
|
Can this option also be set when using |
I've never heard the name "eclipsec" 😄 but ecj should understand the option via |
Thank you 🙏 It does not complain about some unknown option, but it does not seem to help with the split package error either. I think I'm having the same issue as here. |
@xnhp You should ask at the supportforum of your tool (IntelliJ) how to set compiler settings for the Eclipse Compiler there. |
public class Test {
javax.xml.transform.Transformer transformer;
} Here's a transcript of how to make the error appear and then disappear again:
|
Signed-off-by: Sheng Chen [email protected]
Hi team! 👋
I was trying to make a draft to illustrate the idea mentioned in #415. It will be great and helpful if anyone from the team can take a look and let me know if this idea is acceptable, thanks!
What it does
Add a preference to control whether the unnamed module should be ignored when it comes to a split package.
In https://openjdk.org/projects/jigsaw/spec/sotms/#the-unnamed-module says
How to test
Sample: test1.zip
In
.settings/org.eclipse.jdt.core.prefs
, iforg.eclipse.jdt.core.compiler.ignoreUnnamedModuleForSplitPackage
is set toenabled
. After import the sample project, everything looks fine. If the preference is set todisabled
,The package xxx is accessible from more than one module
can be observed.Author checklist