use of com.puppycrawl.tools.checkstyle.bcel.classfile.MethodDefinition in project contribution by checkstyle.
the class UnusedMethodCheck method leaveSet.
/**
* @see com.puppycrawl.tools.checkstyle.bcel.IObjectSetVisitor
*/
public void leaveSet(Set aJavaClasses) {
final Iterator it = aJavaClasses.iterator();
while (it.hasNext()) {
final JavaClass javaClass = (JavaClass) it.next();
final String className = javaClass.getClassName();
final JavaClassDefinition classDef = findJavaClassDef(javaClass);
final MethodDefinition[] methodDefs = classDef.getMethodDefs();
for (int i = 0; i < methodDefs.length; i++) {
if (!classDef.hasReference(methodDefs[i], getReferenceDAO())) {
final Method method = methodDefs[i].getMethod();
if (!ignore(className, method)) {
log(javaClass, 0, "unused.method", new Object[] { methodDefs[i] });
}
}
}
}
}
Aggregations