Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 327561 - [OXM] XMLAdapter gets lost when property is defined in OXM
Summary: [OXM] XMLAdapter gets lost when property is defined in OXM
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-12 10:38 EDT by Rick Barkhouse CLA
Modified: 2022-06-09 10:20 EDT (History)
1 user (show)

See Also:


Attachments
Test Case demonstrating bug. (8.32 KB, application/zip)
2010-10-12 10:39 EDT, Rick Barkhouse CLA
no flags Details
Proposed fix and readded test case (5.88 KB, patch)
2010-11-05 12:51 EDT, Matt MacIvor CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rick Barkhouse CLA 2010-10-12 10:38:52 EDT
Please see attached test case.

The OXM file specifies that the ComputerAdapter should handle marshalling/unmarshalling fields of type Computer (this is a package-level XMLAdapter).  We set up the XMLAdapter on the property, but because the 'computer' element is defined in the OXM, the property gets overwritten and the XMLAdapter information is lost.

If the 'computer' element definition is removed from the OXM, the correct result is marshalled:

<?xml version="1.0" encoding="UTF-8"?>
<ns0:person ...>
   <person-name>Jim Watson</person-name>
   <computer>121531298::48261593::C</computer>
</ns0:person>

Note that in addition, the the Dynamic case, we must make sure that the type information from the OXM is applied before we process the XMLAdapter, so that the proper type information will be in place (otherwise all attributes will still be typed as Object).
Comment 1 Rick Barkhouse CLA 2010-10-12 10:39:49 EDT
Created attachment 180674 [details]
Test Case demonstrating bug.
Comment 2 Matt MacIvor CLA 2010-11-05 12:51:15 EDT
Created attachment 182497 [details]
Proposed fix and readded test case
Comment 3 Matt MacIvor CLA 2010-11-05 12:54:01 EDT
Attached patch checked into SVN
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:20:42 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink