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

Bug 325493

Summary: JAXB: AnnotationsProcessor should not add duplicate classes to Array of classes to process
Product: z_Archived Reporter: David McCann <david.mccann>
Component: EclipselinkAssignee: David McCann <david.mccann>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Contains proposed fix
none
Contains proposed fix. none

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