Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 330521

Summary: Attempts to provide content for Flexible projects during deletes fail
Product: [WebTools] WTP Java EE Tools Reporter: Carl Anderson <ccc>
Component: jst.j2eeAssignee: Carl Anderson <ccc>
Status: RESOLVED FIXED QA Contact: Chuck Bridgham <cbridgha>
Severity: normal    
Priority: P3 CC: dimitar.giormov, jsholl, kaloyan
Version: 3.2Flags: cbridgha: review+
Target Milestone: 3.2.3   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Ensure it is a Flexible Project none

Description Carl Anderson CLA 2010-11-17 16:26:59 EST
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.
Comment 1 Carl Anderson CLA 2010-11-17 16:28:19 EST
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)
Comment 2 Carl Anderson CLA 2010-11-17 16:29:42 EST
Created attachment 183353 [details]
Ensure it is a Flexible Project
Comment 3 Dimitar Giormov CLA 2010-11-18 03:12:56 EST
There is similar bug for 3.2.3

https://bugs.eclipse.org/bugs/show_bug.cgi?id=329501
Comment 4 Carl Anderson CLA 2010-11-18 11:00:11 EST
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.
Comment 5 Jason Sholl CLA 2010-11-19 15:48:09 EST
Code checked into 32M and HEAD for WTP 3.2.3 and 3.3
Comment 6 Chuck Bridgham CLA 2010-11-24 13:25:55 EST
approved