Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 364370 - Null Pointer Exception in deserializer when using annotation fields that are defined as nullable array
Summary: Null Pointer Exception in deserializer when using annotation fields that are ...
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-21 11:24 EST by Paul Harmon CLA
Modified: 2017-02-23 14:15 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Harmon CLA 2011-11-21 11:24:52 EST
Compile the following:

record BugAnn type annotation {
	targets=[FieldMbr]
}
	value int[]?;
end

library lib1
	field1 string {BugAnn = [1,2,3]};
end


Then attempt to deserialize lib1. You will get a NPE in the XMLDeserializer. This is because InternalEObject.init() does not initialze fields that are defined as nullable. So, when the deserializer attempts to add the value to the field's list, a NPE is thrown, because the field's value is null.

A fix needs to be added to XMLDeserializer so that we instantiate an EList in the case where the field is a nullable array.
Comment 1 Paul Harmon CLA 2012-02-24 08:21:40 EST
XmlDesrializer has been updated to fix this scenerio
Comment 2 Paul Harmon CLA 2012-06-22 10:52:01 EDT
verified