Community
Participate
Working Groups
Context: org.eclipse.xtext.ui.util.JdtClasspathUriResolver To reproduce: Put plugins/org.eclipse.xtext_1.0.1.v201008112031.jar on the classpath. It contains: /model/parsetree.ecore and /parsetree.ecore Use JdtClasspathUriResolver to resolve "classpath:/model/parsetree.ecore" and "classpath:/parsetree.ecore". It works in the first case, it doesn't in the second.
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.