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

Bug 325369

Summary: JAXB: Useless method in AnnotationsProcessor should be removed
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
Proposed fix. none

Description David McCann CLA 2010-09-15 11:37:31 EDT
The following method creates a list of JavaClasses but does nothing with it, and therefore should be removed.  Any place it is called should be replaced with 'checkForCallbackMethods()'.

public void processJavaClasses(JavaClass[] classes) {
    ArrayList<JavaClass> classesToProcess = new ArrayList<JavaClass>();
    for (JavaClass javaClass : classes) {
        classesToProcess.add(javaClass);
    }
    checkForCallbackMethods();
}
Comment 1 David McCann CLA 2010-09-22 11:15:29 EDT
Since this is a public method, we should not remove it.  Any useless code should be removed.
Comment 2 David McCann CLA 2010-09-22 11:37:06 EDT
Created attachment 179387 [details]
Proposed fix.

1 - Removed useless code that creates an array of JavaClass instances that is never used.

2 - Changed two spots that call into the method (XMLProcessor and AnnotationsProcessor) to pass in null instead of a JavaClass[] since it is never used.

3 - Updated method comments.
Comment 3 David McCann CLA 2010-09-22 12:23:13 EDT
reviewed by: matt.macivor@oracle.com
tests:  all unit tests pass as expected
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:06:23 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink