Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 345318 - Incorrect declaredtype on JAXBElement unmarshalling with inheritance
Summary: Incorrect declaredtype on JAXBElement unmarshalling with inheritance
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-10 14:58 EDT by Denise Smith CLA
Modified: 2022-06-09 10:28 EDT (History)
1 user (show)

See Also:


Attachments
Proposed changes and test (2.14 KB, patch)
2011-05-11 09:48 EDT, Denise Smith CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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