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

Bug 327561

Summary: [OXM] XMLAdapter gets lost when property is defined in OXM
Product: z_Archived Reporter: Rick Barkhouse <rick.barkhouse>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: matt.macivor
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Test Case demonstrating bug.
none
Proposed fix and readded test case none

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