Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 329026 - BasicEMap is not deserializable
Summary: BasicEMap is not deserializable
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: Core (show other bugs)
Version: 2.6.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Ed Merks CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-29 06:52 EDT by Caspar D. CLA
Modified: 2010-12-14 23:29 EST (History)
1 user (show)

See Also:
caspar_d: review? (Ed.Merks)


Attachments
Stacktrace (927 bytes, text/plain)
2010-10-29 06:52 EDT, Caspar D. CLA
no flags Details
Testcase (as zipped plugins) (78.39 KB, application/zip)
2010-10-29 06:55 EDT, Caspar D. CLA
no flags Details
Patch (2.41 KB, patch)
2010-11-01 05:08 EDT, Caspar D. CLA
no flags Details | Diff
Other way of addressing the issue. (1.69 KB, patch)
2010-11-05 07:04 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 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!