Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 334712 - AccessType.NONE can lead to properties being processed twice
Summary: AccessType.NONE can lead to properties being processed twice
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: Nobody - feel free to take it CLA
QA Contact:
URL: http://stackoverflow.com/questions/47...
Whiteboard:
Keywords:
Depends on: 334681
Blocks: 344762
  Show dependency tree
 
Reported: 2011-01-18 16:17 EST by Blaise Doughan CLA
Modified: 2022-06-09 10:23 EDT (History)
1 user (show)

See Also:


Attachments
MOXy - Test Cases (958 bytes, patch)
2011-01-20 11:18 EST, Blaise Doughan CLA
no flags Details | Diff
MOXy - Fix (2.41 KB, patch)
2011-01-20 11:19 EST, Blaise Doughan CLA
no flags Details | Diff
MOXy - Fix (2.62 KB, patch)
2011-01-20 13:56 EST, 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-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