use of com.puppycrawl.tools.checkstyle.bcel.classfile.FieldDefinition in project contribution by checkstyle.
the class UnreadFieldCheck 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 FieldDefinition[] fieldDefs = classDef.getFieldDefs();
for (int i = 0; i < fieldDefs.length; i++) {
if (fieldDefs[i].getReadReferenceCount() == 0) {
final Field field = fieldDefs[i].getField();
if (!field.isFinal() && (!ignore(className, field))) {
log(javaClass, 0, "unread.field", new Object[] { fieldDefs[i] });
}
}
}
}
}
Aggregations