Comments (1)
The build path page decides the JRE is on the module path with this stack trace:
"main" #1 prio=6 os_prio=0 cpu=7618.77ms elapsed=2454.16s tid=0x00007f6560015440 nid=0x3e19 runnable [0x00007f65647fc000]
java.lang.Thread.State: RUNNABLE
at org.eclipse.jdt.internal.ui.wizards.buildpaths.CPListElement.addModuleNodes(CPListElement.java:214)
at org.eclipse.jdt.internal.ui.wizards.buildpaths.CPListElement.<init>(CPListElement.java:178)
at org.eclipse.jdt.internal.ui.wizards.buildpaths.CPListElement.create(CPListElement.java:772)
at org.eclipse.jdt.internal.ui.wizards.buildpaths.CPListElement.create(CPListElement.java:710)
at org.eclipse.jdt.internal.ui.wizards.buildpaths.BuildPathsBlock.getCPListElements(BuildPathsBlock.java:446)
at org.eclipse.jdt.internal.ui.wizards.buildpaths.BuildPathsBlock.init(BuildPathsBlock.java:341)
at org.eclipse.jdt.internal.ui.preferences.BuildPathsPropertyPage.createWithJava(BuildPathsPropertyPage.java:170)
at org.eclipse.jdt.internal.ui.preferences.BuildPathsPropertyPage.createContents(BuildPathsPropertyPage.java:88)
at org.eclipse.jface.preference.PreferencePage.createControl(PreferencePage.java:244)
at org.eclipse.jdt.internal.ui.preferences.BuildPathsPropertyPage.createControl(BuildPathsPropertyPage.java:99)
at org.eclipse.jface.preference.PreferenceDialog.createPageControl(PreferenceDialog.java:1434)
at org.eclipse.jface.preference.PreferenceDialog$8.run(PreferenceDialog.java:1197)
With this code:
private boolean addModuleNodes(IClasspathEntry containerEntry, IClasspathEntry pseudoEntry) {
boolean modulesAdded= false;
if (containerEntry != null) {
IPackageFragmentRoot[] fragmentRoots= fProject.findPackageFragmentRoots(containerEntry);
if (fragmentRoots != null) {
// detect if system library:
boolean addChildren= false;
if (fragmentRoots.length > 0) {
IModuleDescription module= fragmentRoots[0].getModuleDescription();
if (module != null && module.isSystemModule())
addChildren= true;
isSystemModule()
is implemented here: org.eclipse.jdt.internal.core.BinaryModule.isSystemModule()
:
@Override
public boolean isSystemModule() {
IPackageFragmentRoot pfr = (IPackageFragmentRoot) getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT);
return pfr instanceof JrtPackageFragmentRoot;
}
@Overri
I guess we can add code like that in JavaSearchNameEnvironment
.
It would be good to know where the compiler does this as well, since the compiler also adds the JRE on the module path... Likely its done with the instanceof JrtPackageFragmentRoot
statements in org.eclipse.jdt.internal.core.SearchableEnvironment
.
from eclipse.jdt.core.
Related Issues (20)
- No completion on generic anonymous class instance objects HOT 6
- [BUG] `Syntax error, modifiers are not allowed here` on a `@deprecated` javadoc tag in package-info.java HOT 5
- [formatting] Add line wrapping setting for placing each right brace/parenthesis on a single line
- How to get help HOT 1
- Import static with protected base class yiels wrong class reference compiled in resulting classfile HOT 11
- Wrong (warning) text: Access to enclosing method emulated by a synthetic accessor method
- False positive "The static method X from the type Y should be accessed directly" HOT 8
- Organize Imports produces impossible imports HOT 8
- JDT confused by Java version mismatch in compiler settings HOT 4
- Remove left overs from implementing version 0.7.0 of the JSR 305 specification HOT 2
- Call hierarchy incomplete for method of private inner type implementing public interface HOT 5
- [20] Code select does not work for pattern variables in enhanced for with record patterns HOT 1
- AIOOBE during search for references HOT 3
- IOOBE when moving JUnit5 classpath container from module path to classpath
- Newline character literal with unicode-escaped single quotes incorrectly parses as single-quote character constant HOT 1
- Incomplete type hierarchy when using method reference HOT 2
- Autocomplete blows up when trying to list the members for java.util.Optional.of(true ? 0 : "") HOT 3
- [20] Record pattern in foreach leaks the secret recordPatternVar in UI
- Incorrect type shown when hovering over method call.
- Unexpected cast compile error for generic type argument HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eclipse.jdt.core.