Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 325493 - JAXB: AnnotationsProcessor should not add duplicate classes to Array of classes to process
Summary: JAXB: AnnotationsProcessor should not add duplicate classes to Array of class...
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: David McCann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-16 12:47 EDT by David McCann CLA
Modified: 2022-06-09 10:08 EDT (History)
0 users

See Also:


Attachments
Contains proposed fix (1.97 KB, patch)
2010-09-16 12:54 EDT, David McCann CLA
no flags Details | Diff
Contains proposed fix. (5.19 KB, patch)
2010-09-17 11:21 EDT, David McCann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David McCann CLA 2010-09-16 12:47:29 EDT
In the case where the user hands in a TypeMappingInfo for a given class, and there is also an ObjectFactory with a create method for that class, we should not add the duplicate entry to our classesToProcess array when processing the ObjectFactory.  The code currently tries to guard against this with an List.contains() call, but this will not work for our JavaClass instances.  XMLProcessor has a convenience method that handles this, (classExistsInArray) and should be made static such that it can be accessed from AnnotationsProcessor.
Comment 1 David McCann CLA 2010-09-16 12:54:58 EDT
Created attachment 179051 [details]
Contains proposed fix

The List.contains() check is insufficient in this case.  The existing convenience method on XmlProcessor is now used to guard against duplicate classes being added to the List of classes to process.
Comment 2 David McCann CLA 2010-09-17 11:21:08 EDT
Created attachment 179126 [details]
Contains proposed fix.
Comment 3 David McCann CLA 2010-09-17 11:31:50 EDT
reviewed by:  matt.macivor@oracle.com
tests:  all unit tests pass as expected
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:08:34 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink