Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 360039 - FacetProjectCreationDataModelProvider should have a null check for model in dispose method
Summary: FacetProjectCreationDataModelProvider should have a null check for model in d...
Status: RESOLVED FIXED
Alias: None
Product: WTP Common Tools
Classification: WebTools
Component: wst.common (show other bugs)
Version: 3.2.5   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.3.2   Edit
Assignee: Roberto Sanchez Herrera CLA
QA Contact: Carl Anderson CLA
URL:
Whiteboard:
Keywords:
Depends on: 357846 359927
Blocks:
  Show dependency tree
 
Reported: 2011-10-05 16:15 EDT by Roberto Sanchez Herrera CLA
Modified: 2011-10-24 17:06 EDT (History)
0 users

See Also:
ccc: review+


Attachments
Proposed patch for 3.3.2 and 3.4 (1.25 KB, patch)
2011-10-10 16:51 EDT, Roberto Sanchez Herrera CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.