Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 326404 - EMF Change cannot load change description (NullPointerException)
Summary: EMF Change cannot load change description (NullPointerException)
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Ed Merks CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-28 08:34 EDT by Koen Yskout CLA
Modified: 2010-12-14 23:29 EST (History)
0 users

See Also:


Attachments
Test case demonstrating the bug (4.41 KB, text/x-java)
2010-09-28 08:35 EDT, Koen Yskout CLA
no flags Details
Changes to address the issue (1.29 KB, patch)
2010-09-29 14:02 EDT, Ed Merks CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Koen Yskout CLA 2010-09-28 08:34:13 EDT
Build Identifier: 20100917-0705

After upgrading to Helios SR1, I get a NullPointerException when loading an EMF change description. I think this is related to bug 315753 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=315753), which was recently fixed.

I attached a test case that demonstrates the bug.

The NPE is caused by the line
feature = ((EObjectToChangesMapEntryImpl)eContainer()).getTypedKey().eClass().getEStructuralFeature(featureName);
in getFeature() from FeatureChangeImpl.
Apparently, the FeatureChange's container (when using the particular setup from the test case) does not have its (typed) key set (yet?) at the time setReferenceValue() is called when loading the XMI, so getTypedKey() returns null.

Skipping this line while the key is not set seems to resolve the issue.
I don't think there is an easy workaround.

Reproducible: Always

Steps to Reproduce:
See the attached test code.
Comment 1 Koen Yskout CLA 2010-09-28 08:35:04 EDT
Created attachment 179734 [details]
Test case demonstrating the bug
Comment 2 Ed Merks CLA 2010-09-29 14:02:31 EDT
Created attachment 179875 [details]
Changes to address the issue

We should always have been guarding those calls but didn't notice until now. :-(
Comment 3 Ed Merks CLA 2010-11-05 06:05:11 EDT
The fix is committed to CVS for 2.7.
Comment 4 Ed Merks CLA 2010-11-05 06:05:21 EDT
Fixed.
Comment 5 Ed Merks CLA 2010-12-13 16:42:47 EST
The fixes are available in a published build.
Comment 6 Ed Merks CLA 2010-12-14 23:28:09 EST
Try again to resolve as fixed (and available in a build).
Comment 7 Ed Merks CLA 2010-12-14 23:29:46 EST
Oh, I guess I have to close them!