bugReporter.reportBug(new BugInstance(this, bugType, priority) .addClass(className) .addField(className, fieldName, fieldSig, true));
BugInstance bug = new BugInstance(this, bugType, priority) .addClass(className) .addField(className, fieldName, fieldSig, true); SourceLineAnnotation firstPC = firstFieldUse.get(className + "." + fieldName); if (firstPC != null) bug.addSourceLine(firstPC); bugReporter.reportBug(bug);
	public void report() {		/*		for(Iterator i = unsafeValue.iterator(); i.hasNext(); ) {			System.out.println("Unsafe: " + i.next());			}		*/		for (FieldRecord f : seen) {			boolean isFinal = f.isFinal;			String className = f.className;			String fieldSig = f.signature;			String fieldName = f.name;			String name = className + "." + fieldName;			boolean couldBeFinal = !isFinal					&& !notFinal.contains(name);			boolean isPublic = f.isPublic;			boolean couldBePackage = !outsidePackage.contains(name);			boolean movedOutofInterface = couldBePackage &&					interfaces.contains(className);			boolean isHashtable = fieldSig.equals("Ljava.util.Hashtable;");			boolean isArray = fieldSig.charAt(0) == '['					&& unsafeValue.contains(name);			/*			              System.out.println(className + "."  + fieldName						              + " : " + fieldSig					              + "	" + isHashtable					              + "	" + isArray						              );			              */			String bugType;			int priority = NORMAL_PRIORITY;			if (isFinal && !isHashtable && !isArray) {				continue;			} else if (movedOutofInterface) {				bugType = "MS_OOI_PKGPROTECT";			} else if (couldBePackage && couldBeFinal && (isHashtable || isArray))				bugType = "MS_FINAL_PKGPROTECT";			else if (couldBeFinal && !isHashtable && !isArray) {				bugType = "MS_SHOULD_BE_FINAL";				if (fieldName.equals(fieldName.toUpperCase())						|| fieldSig.charAt(0) == 'L')					priority = HIGH_PRIORITY;			} else if (couldBePackage)				bugType = "MS_PKGPROTECT";			else if (isHashtable) {				bugType = "MS_MUTABLE_HASHTABLE";				if (!isFinal)					priority = HIGH_PRIORITY;			} else if (isArray) {				bugType = "MS_MUTABLE_ARRAY";				if (fieldSig.indexOf("L") >= 0 || !isFinal)					priority = HIGH_PRIORITY;			} else if (!isFinal)				bugType = "MS_CANNOT_BE_FINAL";			else				throw new IllegalStateException("impossible");			bugReporter.reportBug(new BugInstance(this, bugType, priority)					.addClass(className)					.addField(className, fieldName, fieldSig, true));		}	}