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

Bug 345318

Summary: Incorrect declaredtype on JAXBElement unmarshalling with inheritance
Product: z_Archived Reporter: Denise Smith <denise.mahar>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipselink.oxm-inbox
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Proposed changes and test none

Description Denise Smith CLA 2011-05-10 14:58:36 EDT
If class B extends class A and the xml is something with xsi:type = classB when
we unmarshal with unmarshal(source, classA.class)  the resulting object is a JAXBElement with a value of class B and declared type of ClassB.  The declaredType on the JAXBElement should instead be ClassA.
Comment 1 Denise Smith CLA 2011-05-11 09:48:44 EDT
Created attachment 195349 [details]
Proposed changes and test
Comment 2 Denise Smith CLA 2011-05-11 09:53:37 EDT
Now the declaredType is set to whatever Class is given to the unmarshal if one is specified.
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:28:34 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink