Community
Participate
Working Groups
Attach the JAR with this bug in your Eclipse Java project (add it to your classpath) When Package Explorer is in Flat presentation mode you can see the contents of the JAR file. Now switch the Package Explorer to hierarchical and notice that the contents of the JAR file disapears.
Created attachment 41903 [details] Example of a JAR file which produces the bug
Move to JDT/UI
This is a very tricky... The JAR contains a folder with dots in the name. The Java model returns that folder as a package. The hierarchical content provider makes the assumption that when it gets a package 'a.b.c', it will also get the package 'a' and 'a.b' This isn't the case here as there are no such folder. I didn't find a way to detect this: In a JAR I can't get any information about the underlying resources / jar entries. I think the Java model is wrong to return this as a package at all. Shouln't this be returned as a folder? Packages aren't allowed to contain '.' in the name. Moving to jdt.core for comments.
Changed JarPackageFragmentRoot#computeChildren(...) to add zip entries that have not a valid package name as non-Java resources instead of package fragments. Updated tests in JavaProjectTests to reflect this change. Released for 3.3 M1 in HEAD.
Note that the is still a rendering problem of non-Java directories in .jar files. I entered bug 148657 to capture this.
Added regression test JavaProjectTests#testPackageFragmentNonJavaResources6() for this very bug.
Verified for 3.3 M1 using build I20060807-0010.
NOTE: this is not yet fully fixed, see bug 148944.