bugReporter.reportBug(new BugInstance(bugType, priority)
bugReporter.reportBug(new BugInstance(this, bugType, priority)
	private void checkEqualsComparison(Location location, JavaClass jclass, MethodGen methodGen,	                                   TypeDataflow typeDataflow) throws DataflowAnalysisException {		InstructionHandle handle = location.getHandle();		String sourceFile = jclass.getSourceFileName();		TypeFrame frame = typeDataflow.getFactAtLocation(location);		if (frame.getStackDepth() < 2)			throw new DataflowAnalysisException("Stack underflow", methodGen, handle);		int numSlots = frame.getNumSlots();		Type lhsType_ = frame.getValue(numSlots - 2);		Type rhsType_ = frame.getValue(numSlots - 1);		if (lhsType_.equals(rhsType_))			return;		// Ignore top and bottom values		if (lhsType_.getType() == T_TOP || lhsType_.getType() == T_BOTTOM		        || rhsType_.getType() == T_TOP || rhsType_.getType() == T_BOTTOM)			return;		if (!(lhsType_ instanceof ReferenceType) || !(rhsType_ instanceof ReferenceType)) {			if (rhsType_.getType() == T_NULL) {				// A literal null value was passed directly to equals().				bugReporter.reportBug(new BugInstance("EC_NULL_ARG", NORMAL_PRIORITY)				        .addClassAndMethod(methodGen, sourceFile)				        .addSourceLine(methodGen, sourceFile, location.getHandle()));			} else if (lhsType_.getType() == T_NULL) {				// Hmm...in this case, equals() is being invoked on				// a literal null value.  This is really the				// purview of FindNullDeref.  So, we'll just do nothing.			} else {				bugReporter.logError("equals() used to compare non-object type(s) " +				        lhsType_ + " and " + rhsType_ +				        " in " +				        SignatureConverter.convertMethodSignature(methodGen) +				        " at " + location.getHandle());			}			return;		}		// For now, ignore the case where either reference is not		// of an object type.  (It could be either an array or null.)		if (!(lhsType_ instanceof ObjectType) || !(rhsType_ instanceof ObjectType))			return;		ObjectType lhsType = (ObjectType) lhsType_;		ObjectType rhsType = (ObjectType) rhsType_;		int priority = LOW_PRIORITY + 1;		String bugType = "EC_UNRELATED_TYPES";		// See if the types are related by inheritance.		try {			if (!Hierarchy.isSubtype(lhsType, rhsType) && !Hierarchy.isSubtype(rhsType, lhsType)) {				// We have unrelated types.				// If both types are interfaces, then it is conceivable that				// there are class types that implement both interfaces,				// so the comparision might be meaningful.  Classify such				// cases as medium.  Other cases are high priority.				if (lhsType.referencesInterfaceExact() && rhsType.referencesInterfaceExact()) {					// TODO: This would be a good place to assume a closed					// universe and look at subclasses.					priority = NORMAL_PRIORITY;					bugType = "EC_UNRELATED_INTERFACES";				} else {					// TODO: it is possible that an unknown subclass of					// the class type implements the interface.					// Again, a subclass search could answer this					// question if we had a closed universe.					priority = HIGH_PRIORITY;				}			}		} catch (ClassNotFoundException e) {			bugReporter.reportMissingClass(e);			return;		}		if (priority <= LOW_PRIORITY) {			bugReporter.reportBug(new BugInstance(bugType, priority)			        .addClassAndMethod(methodGen, sourceFile)			        .addSourceLine(methodGen, sourceFile, location.getHandle())			        .addClass(lhsType.getClassName()).describe("CLASS_REFTYPE")			        .addClass(rhsType.getClassName()).describe("CLASS_REFTYPE"));		}	}