classFieldMap.clear(); superclassFieldMap.clear(); finalClassFieldSet.clear();
classFields.clear();
	public void visit(JavaClass obj) {		if (obj.isInterface())			return;		classFieldMap.clear();		superclassFieldMap.clear();		finalClassFieldSet.clear();		// Build map of fields in this class		Field[] fields = obj.getFields();		String fieldName;		for (int f = 0; f < fields.length; f++) {			FieldAnnotation fa = FieldAnnotation.fromBCELField(obj.getClassName(), fields[f]);			classFieldMap.put(fa.getFieldName(), fa);			if (fields[f].isFinal())				finalClassFieldSet.add(fa.getFieldName());		}		// Build map of visible instance fields in superclasses		// FIXME: would be nice to store these in a persistent data		// structure, rather than recreating them for each		// subclass.		try {				JavaClass[] superClasses = org.apache.bcel.Repository.getSuperClasses(obj);			for (int c = 0; c < superClasses.length; c++) {				Field[] superFields = superClasses[c].getFields();				for (int f = 0; f < superFields.length; f++) {					Field superfield = superFields[f];					// Only want instance fields that are guaranteed to be visible					// FIXME: doesn't handle package-protected fields, which					// might be obscured by another class in the same package					if (superfield.isStatic() || !(superfield.isPublic() || superfield.isProtected()))						continue;					// Have we seen a superclass field with this name yet?					if (superclassFieldMap.get(superfield.getName()) != null)						continue;					// Add it					FieldAnnotation faSuper =						FieldAnnotation.fromBCELField(superClasses[c].getClassName(), superfield);					superclassFieldMap.put(superfield.getName(), faSuper);				}			}		} catch (ClassNotFoundException e) { 			bugReporter.reportMissingClass(e);		}		// Masked fields are the intersection of the fields defined		// by the class and the visible superclass fields.		Map<String, FieldAnnotation> intersection = new HashMap<String, FieldAnnotation>(superclassFieldMap);		intersection.keySet().retainAll(classFieldMap.keySet());		for (Iterator<FieldAnnotation> i = intersection.values().iterator(); i.hasNext(); ) {			FieldAnnotation fa = i.next();			// Report final fields, String fields, and primitive value fields			// as low priority, and everything else as medium.			int priority = NORMAL_PRIORITY;			if (finalClassFieldSet.contains(fa.getFieldName())				|| (fa.getFieldSignature().length() == 1 && "ZBCSIJFD".indexOf(fa.getFieldSignature()) >= 0)				|| fa.getFieldSignature().equals("Ljava/lang/String;"))				priority = LOW_PRIORITY;			bugReporter.reportBug(new BugInstance("MF_CLASS_MASKS_FIELD", priority)				.addClass(this)				.addField(fa).describe("FIELD_SUPER"));		}		super.visit(obj);	}