Community
Participate
Working Groups
In an adopter product, we've run into a scenario where JEE5ContentProvider tries to create a new content provider instance on a project that is being deleted. We need to check to ensure that a project is still a Flexible Project before creating a new content provider instance for it.
Here's part of the stack when this problem occurs: at org.eclipse.jst.jee.ui.internal.navigator.Web25ContentProvider.getNewContentProviderInstance(Web25ContentProvider.java:69) at org.eclipse.jst.jee.ui.internal.navigator.JEE5ContentProvider.getCachedContentProvider(JEE5ContentProvider.java:87) at org.eclipse.jst.jee.ui.internal.navigator.Web25ContentProvider.getChildren(Web25ContentProvider.java:35) at org.eclipse.ui.internal.navigator.extensions.SafeDelegateTreeContentProvider.getChildren(SafeDelegateTreeContentProvider.java:96) at org.eclipse.ui.internal.navigator.NavigatorContentServiceContentProvider$1.run(NavigatorContentServiceContentProvider.java:150)
Created attachment 183353 [details] Ensure it is a Flexible Project
There is similar bug for 3.2.3 https://bugs.eclipse.org/bugs/show_bug.cgi?id=329501
Bug 329501 is similar, but not identical. Please note that in the stack trace that is provided, project.isAccessible() is a condition that passes. To explain a little more of the scenario, a Web and a Web Fragment project are created, used for a bit, and then deleted. However, before the entire delete happens (but after the component file is deleted), the call into getCachedContentProvider() happens, and the groupContentProviders.get(project) returns a non-null value (since this project previously had valid content). In the scenario for bug 329501, since the project was renamed, the call to groupContentProviders.get(project) returns null (since the new incarnation of the project does not exist yet in the groupContentProviders Map), and project.isAccessible() fails. Therefore, I believe that both fixes are necessary.
Code checked into 32M and HEAD for WTP 3.2.3 and 3.3
approved