| Summary: | JdtClasspathUriResolver doesn't resolve files from JAR's root. | ||
|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Moritz Eysholdt <moritz.eysholdt> |
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | sebastian.zarnekow |
| Version: | 1.0.1 | Flags: | sebastian.zarnekow:
kepler+
|
| Target Milestone: | M7 | ||
| Hardware: | PC | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
|
Description
Moritz Eysholdt
Seems to be a problem in JDT's PackageFragmentRoot not returning the nonJavResources for the default package. added a test case : org.eclipse.xtext.ui.tests.core.util.JdtClasspathUriResolverTest.testClasspathUriForFileInRootInJarInWorkspaceWithFragment() This looks clearly strange to me:
public Object[] getNonJavaResources() throws JavaModelException {
if (isDefaultPackage()) {
// We don't want to show non java resources of the default package (see PR #1G58NB8)
return JavaElementInfo.NO_NON_JAVA_RESOURCES;
} else {
return storedNonJavaResources();
}
}
We could hijack this method reflectively, though.
protected Object[] storedNonJavaResources() throws JavaModelException {
return ((JarPackageFragmentInfo) getElementInfo()).getNonJavaResources();
}
Turns out that org.eclipse.jdt.core.IPackageFragmentRoot.getNonJavaResources() is the way to go for the default package. Pushed to review. Requested via bug 522520. -M. |