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

Bug 364370

Summary: Null Pointer Exception in deserializer when using annotation fields that are defined as nullable array
Product: z_Archived Reporter: Paul Harmon <pharmon>
Component: EDTAssignee: Project Inbox <edt.mofmodel-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: svihovec
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

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