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

Bug 329026

Summary: BasicEMap is not deserializable
Product: [Modeling] EMF Reporter: Caspar D. <caspar_d>
Component: CoreAssignee: Ed Merks <Ed.Merks>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: saulius.tvarijonas
Version: 2.6.0Flags: caspar_d: review? (Ed.Merks)
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Stacktrace
none
Testcase (as zipped plugins)
none
Patch
none
Other way of addressing the issue. none

Description Caspar D. CLA 2010-10-29 06:52:03 EDT
Created attachment 182029 [details]
Stacktrace

Deserialiation of a BasicEMap will invoke readObject(ObjectInputStream),
which repeatedly calls put(key,value), which expects the delegateEList
field to be initalized. But it's null, giving an NPE, see attached stack-
trage. Seems readObject should call initializeDelegateEList() as the
constructor does.
Comment 1 Caspar D. CLA 2010-10-29 06:55:07 EDT
Created attachment 182030 [details]
Testcase (as zipped plugins)

Run EmapSerializationProblem_Test as a Junit test case.
Comment 2 Caspar D. CLA 2010-11-01 05:08:38 EDT
Created attachment 182132 [details]
Patch

Seems there was a bit more amiss than just the delegateEList not
being initialized, but I think this patch fixes it.
Comment 3 Ed Merks CLA 2010-11-05 07:04:42 EDT
Created attachment 182462 [details]
Other way of addressing the issue.

I think this approach is simpler and also fixes the problem, right?
Comment 4 Caspar D. CLA 2010-11-05 07:16:23 EDT
Hehe, yes, so it seems :-)

Either patch is fine for me.

Thanks!
Comment 5 Ed Merks CLA 2010-11-05 08:17:36 EDT
The fixes are committed to CVS for 2.7.
Comment 6 Ed Merks CLA 2010-12-13 16:42:45 EST
The fixes are available in a published build.
Comment 7 Ed Merks CLA 2010-12-14 23:28:07 EST
Try again to resolve as fixed (and available in a build).
Comment 8 Ed Merks CLA 2010-12-14 23:29:44 EST
Oh, I guess I have to close them!