Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 344539 - Properties of type Object are always treated as @XmlElement
Summary: Properties of type Object are always treated as @XmlElement
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Blaise Doughan CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-03 04:50 EDT by Blaise Doughan CLA
Modified: 2022-06-09 10:07 EDT (History)
1 user (show)

See Also:


Attachments
MOXy - Fix (947 bytes, patch)
2011-05-03 04:54 EDT, Blaise Doughan CLA
no flags Details | Diff
MOXy - Test Cases (4.95 KB, patch)
2011-05-03 11:18 EDT, Blaise Doughan CLA
no flags Details | Diff
MOXy - Fix (948 bytes, patch)
2011-05-03 11:24 EDT, Blaise Doughan CLA
no flags Details | Diff

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