Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 325369 - JAXB: Useless method in AnnotationsProcessor should be removed
Summary: JAXB: Useless method in AnnotationsProcessor should be removed
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-15 11:37 EDT by David McCann CLA
Modified: 2022-06-09 10:06 EDT (History)
0 users

See Also:


Attachments
Proposed fix. (2.66 KB, patch)
2010-09-22 11:37 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-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