Community
Participate
Working Groups
Build ID: I20070601-1539 Steps To Reproduce: 1. Create Java project A 2. Create a folder named "resources" in project A 3. Create Java Project B 4. Add the "resources" folder from A as Classes folder to Project B 5. Now every file you put in resources will not show up in the package explorer in Project A. One have to either close/open Project B to get changes (refresh does not work) or close/open the package explorer. This is hurting us alot since we put e.g. the WebContent folder of a web project on to a test project to make sure it can pick up web-inf in it's classpath. This is something we only starting having issues with in 3.3.1 More information:
I forgot a point 6. 6) But all changes will be shown inside the "Referenced libraries" node on Project B. Originally found in our work with JBoss Tools/RHDS (http://jira.jboss.com/jira/browse/JBIDE-1057) but this is reproducable on a bare eclipse 3.3.1 installation just using the normal file creation wizards.
Putting a blocker since this is a big usability and regression bug.
Correction: It is also reproducible on Eclipse 3.3.0 (on some machines :(
Moving to JDT/UI
The delta the package explorer gets is: Java Model[*]: {CHILDREN} B[*]: {CHILDREN} /A/resources[*]: {CONTENT} ResourceDelta(/A/resources/ff)[+] I think also A should get a delta.
I verified that this bug didn't exist in 3.0.2, but it existed in 3.1.2, 3.2.2, 3.3.1. So this is really not new.
The weird thing is that the issue is not *always* present. Any known workarounds for avoiding this would be *much* appreciated. We need to have a folder from another project on the classpath; is there any way we can get that without the changes getting lost in the view ? It sometime also works fine in the other views (e.g. navigator and project explorer) but not package explorer.
(In reply to comment #7) A workaround would be to put "resources" on the buildpath of A as well (e.g. as a class folder).
Not possible since the usecase is to put the WebContent in a WTP project onto the classpath of a test java project (so tests can lookup resources found in WEB-INF/, e.g. faces-config.xml, web.xml, componets.xml etc.) If I add WebContent I get a "Cannot nest <prj>/WebContent/WEB-INF/classes" inside library '<prj>/WeBcontent' because of the Web App libraries classpath container. If I remove Web App libraries then it also results in webcontent to be inside referenced libraries and thus not visible unless I expand the referenced libraries node and the package explorer becomes untangible. I also tried to write a custom library container but that resulted in the same issues ;( Any other ideas ?
The biggest issue is also that Refresh does not even force a refresh. Anyone that can tell which operations we could perform programmatically to force a refresh without having to close/open the Package Explorer ?
Another "workaround" is to not enable "Show 'Reference Libraries' Node" in package explorer. As soon as that is of things work as expected.
But again not a real usefull workaround since it makes tree unmanagable when using many libraries.
Ok - so this only a bug that is triggered when Show Referenced Libraries Node is enabled. When not enabled everything works fine. I'm now looking at PackageExplorerContentProvider to see if there is any resource modification/touch I can do to trigger a proper update. If I find that I can install a resource change listener and trigger the modification to make the package explorer update. Any ideas would be appreciated ;)
After fixing the Java delta problem (see bug 207441), the Package Explorer updates on the first file addition, but if you add a second file to /A/resources, it doesn't update. Moving back to JDT/UI for further investigation.
(accidently posted this in the partly fix bug - putting it here where it belongs) btw. the best workaround i've found until now is to touch all META-INF and MANIFEST.MF files in the related project when a resource is changed - then the tree is actually updated in 3.3.1 (but of course less inefficient) project.accept(new IResourceProxyVisitor() { public boolean visit(IResourceProxy proxy) throws CoreException if(proxy.getName().equals("MANIFEST-MF") || proxy.getName().equals("META-INF")) { proxy.requestResource().touch(monitor); } return true; } }, IResource.DEPTH_INFINITE); This triggers the isManifestChange method in PackageExplorerContentProvider.
fixed > 20071025
From the JDT.UI standpoint we could provide the fix also for 3.3.2. But it only makes sense if bug 207441 is ported to 3.3.2 as well.
Fix for bug 207441 has now been backported to R3_3_maintenance.
Just to be sure - this fix have also been applied to Eclipse 3.2.x correct ? The releated bug have been applied to 3.2.x, but this bug just says 3.3
forget it - I read the numbers wrong ;(
Verified in I20071031-0010. Filed bug 208208 for backporting this to 3.3.2