Community
Participate
Working Groups
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(); }
Since this is a public method, we should not remove it. Any useless code should be removed.
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.
reviewed by: matt.macivor@oracle.com tests: all unit tests pass as expected
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink