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

Bug 360039

Summary: FacetProjectCreationDataModelProvider should have a null check for model in dispose method
Product: [WebTools] WTP Common Tools Reporter: Roberto Sanchez Herrera <shr31223>
Component: wst.commonAssignee: Roberto Sanchez Herrera <shr31223>
Status: RESOLVED FIXED QA Contact: Carl Anderson <ccc>
Severity: major    
Priority: P3 Flags: ccc: review+
Version: 3.2.5   
Target Milestone: 3.3.2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 357846, 359927    
Bug Blocks:    
Attachments:
Description Flags
Proposed patch for 3.3.2 and 3.4 none

Description Roberto Sanchez Herrera CLA 2011-10-05 16:15:53 EDT
+++ This bug was initially created as a clone of Bug #359927 +++

While fixing bug 357558, I added some clean up code in the dispose method of class FacetProjectCreationDataModelProvider, that included removing a listener from nestedProjectDM and setting the data model to null. But there can be cases in which the FacetProjectCreationDataModelProvider is disposed twice, and in those cases, a NPE will be thrown when running this line: 

IDataModel nestedProjectDM = model.getNestedModel(NESTED_PROJECT_DM);

A null check should be added to protect the method from throwing the NPE if the FacetProjectCreationDataModelProvider is disposed twice. 

Marking as major because is affecting an adopter.
Comment 1 Roberto Sanchez Herrera CLA 2011-10-05 16:16:32 EDT
This bug is to commit code to WTP 3.3.2 and 3.4.0
Comment 2 Roberto Sanchez Herrera CLA 2011-10-10 16:51:34 EDT
Created attachment 204910 [details]
Proposed patch for 3.3.2 and 3.4

The patch was generated using R3_3_maintenance (3.3.2) but I verified it can be applied to HEAD (3.4) also.
Comment 3 Roberto Sanchez Herrera CLA 2011-10-24 12:24:01 EDT
Just pinging to remind about the pending review.
Comment 4 Roberto Sanchez Herrera CLA 2011-10-24 17:06:56 EDT
Code committed to R3_3_maintenance and HEAD for WTP 3.3.2 and 3.4. Resolving bug.