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

Bug 344539

Summary: Properties of type Object are always treated as @XmlElement
Product: z_Archived Reporter: Blaise Doughan <blaise.doughan>
Component: EclipselinkAssignee: Blaise Doughan <blaise.doughan>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipselink.oxm-inbox
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
MOXy - Fix
none
MOXy - Test Cases
none
MOXy - Fix none

Description Blaise Doughan CLA 2011-05-03 04:50:55 EDT
In the following use case MOXy is always treating the bar field as an @XmlElement even when it is annotated with @XmlAttribute.

@XmlAccessorType(XmlAccessType.FIELD)
public class Foo {

    @XmlAttribute
    private Object bar;

}
Comment 1 Blaise Doughan CLA 2011-05-03 04:54:03 EDT
Created attachment 194555 [details]
MOXy - Fix
Comment 2 Blaise Doughan CLA 2011-05-03 11:18:25 EDT
Created attachment 194598 [details]
MOXy - Test Cases
Comment 3 Blaise Doughan CLA 2011-05-03 11:24:50 EDT
Created attachment 194599 [details]
MOXy - Fix
Comment 4 Blaise Doughan CLA 2011-05-03 12:12:05 EDT
Fix checked into trunk at rev:  9298
Fix checked into 2.2.1 at rev:  9299

Code Reviewed By:  Matt MacIvor

Fix Description:
When field/property is of type Object, check to see if it is mapped as an @XmlAttribute before making an XMLCompositeObjectMapping.
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:06:01 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 6 Eclipse Webmaster CLA 2022-06-09 10:07:30 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink