Bug 221793 - EMF2DOMAdapter throws npe if only mof adapter is removed
Summary: EMF2DOMAdapter throws npe if only mof adapter is removed
Status: CLOSED FIXED
Alias: None
Product: WTP Java EE Tools
Classification: WebTools
Component: jst.j2ee (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 critical (vote)
Target Milestone: 3.0 M6   Edit
Assignee: Jason Peterson CLA
QA Contact: Chuck Bridgham CLA
URL:
Whiteboard: Review
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2008-03-07 02:28 EST by Jason Peterson CLA
Modified: 2008-05-01 13:59 EDT (History)
1 user (show)

See Also:
cbridgha: review+


Attachments
patch (1.26 KB, patch)
2008-03-07 02:28 EST, Jason Peterson CLA
no flags Details | Diff
patch (1.02 KB, patch)
2008-03-07 03:09 EST, Jason Peterson CLA
bjorn.freeman-benson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Peterson CLA 2008-03-07 02:28:55 EST
Created attachment 91842 [details]
patch

Having two major issues when removeMofValue(x,y) is called.

1.  A MOF object's adapter is removed before a check is even done to see
if this adapter can be removed from the DOM node as well.  I am having cases where I am left with an adapter on a DOM node that has a target set to null.  This is because the adapter was removed from the MOF object, but was not found on the DOM node; thus not removed from the DOM node.  NPEs are thrown whenever attempts are made to set the MOF value of the translator.  

2.  An unload is then done on this invalid object as part of removeMofValue(x, y) even though the adapter was not removed from the DOM node.  This causes a completely different NPE whenever a get and set feature is attempted on this proxy object. 

The solution was to first check to see if the DOM node even had the adapter.  If not then return from removeMofValue(x, y).  Do not remove the MOF object and attempt the unload if the adapter cannot be removed from the DOM node.
Comment 1 Jason Peterson CLA 2008-03-07 03:09:31 EST
Created attachment 91845 [details]
patch
Comment 2 Chuck Bridgham CLA 2008-03-11 18:28:55 EDT
This patch looks good - applying.....
Comment 3 David Williams CLA 2008-04-24 00:44:00 EDT
mass change to add 'contributed' keyword based on bugzilla query, please correct if that's not accurate (by marking patches as obsolete and removing the 'contributed' keyword. 
Comment 4 Carl Anderson CLA 2008-05-01 13:59:20 EDT
This change was actually backed out, since the real change needed was done in bug 225196.  I have verified that the problem reported in this bug is fixed.