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

Bug 359927

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.2.5   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 360039    
Attachments:
Description Flags
Proposed fix none

Description Roberto Sanchez Herrera CLA 2011-10-04 17:44:56 EDT
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-04 17:48:56 EDT
Created attachment 204555 [details]
Proposed fix
Comment 2 Roberto Sanchez Herrera CLA 2011-10-05 16:11:55 EDT
Code committed to R3_2_maintenance for WTP 3.2.5.
Comment 3 Roberto Sanchez Herrera CLA 2011-10-05 16:14:36 EDT
This code cannot be committed to HEAD until bug 357846 is resolved. So, I will clone this bug, make the clone depending on bug 357846, and resolve this bug.