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

Bug 334712

Summary: AccessType.NONE can lead to properties being processed twice
Product: z_Archived Reporter: Blaise Doughan <blaise.doughan>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipselink.oxm-inbox
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
URL: http://stackoverflow.com/questions/4726764/jaxb-provider-eclipselink-moxy-ignores-xmlaccessortypexmlaccesstype-none
Whiteboard:
Bug Depends on: 334681    
Bug Blocks: 344762    
Attachments:
Description Flags
MOXy - Test Cases
none
MOXy - Fix
none
MOXy - Fix none

Description Blaise Doughan CLA 2011-01-18 16:17:28 EST
When AccessType is set to NONE we preserve a types fields and properties since we don't know which might be enabled in an XML override.  This is leading to a duplication of mappings.

To reproduce check modify the following classes by removing @XmlTransient from the fields:

- org.eclipse.persistence.testing.jaxb.xmlaccessortype.none.Mapped
- org.eclipse.persistence.testing.jaxb.xmlaccessortype.none.Root
Comment 1 Blaise Doughan CLA 2011-01-20 11:18:24 EST
Created attachment 187205 [details]
MOXy - Test Cases
Comment 2 Blaise Doughan CLA 2011-01-20 11:19:14 EST
Created attachment 187207 [details]
MOXy - Fix
Comment 3 Blaise Doughan CLA 2011-01-20 13:56:15 EST
Created attachment 187224 [details]
MOXy - Fix
Comment 4 Blaise Doughan CLA 2011-01-21 13:59:52 EST
Fix checked into trunk at rev:  8863

Code reviewed by:  Matt MacIvor

Fix Description:
In AnnotationsProcessor.getNoAccessTypePropertiesForClass we no longer add both the field and property:
- If the field is annotated then add it.
- If the property is annotated then add it.
- If the property is not annotated then add it only if there isn't a corresponding field.
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:23:18 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink