if (op1 instanceof ReferenceType && op2 instanceof ReferenceType) { ReferenceType ot1 = (ReferenceType) op1; ReferenceType ot2 = (ReferenceType) op2;
if (lhsType instanceof ReferenceType && rhsType instanceof ReferenceType) { String lhs = SignatureConverter.convert(lhsType.getSignature()); String rhs = SignatureConverter.convert(rhsType.getSignature());  if (!lhs.equals(rhs)) return;
	public void visitClassContext(ClassContext classContext) {		try {			final JavaClass jclass = classContext.getJavaClass();			Method[] methodList = jclass.getMethods();			for (int i = 0; i < methodList.length; ++i) {				Method method = methodList[i];				final MethodGen methodGen = classContext.getMethodGen(method);				if (methodGen == null)					continue;				// Prescreening - must have IF_ACMPEQ or IF_ACMPNE				BitSet bytecodeSet = classContext.getBytecodeSet(method);				if (!(bytecodeSet.get(Constants.IF_ACMPEQ) || bytecodeSet.get(Constants.IF_ACMPNE)))					continue;				if (DEBUG) System.out.println("FindRefComparison: analyzing " +					SignatureConverter.convertMethodSignature(methodGen));				final CFG cfg = classContext.getCFG(method);				final DepthFirstSearch dfs = classContext.getDepthFirstSearch(method);				RefComparisonTypeMerger typeMerger = new RefComparisonTypeMerger(bugReporter);				TypeFrameModelingVisitor visitor = new RefComparisonTypeFrameModelingVisitor(methodGen.getConstantPool(), bugReporter);				TypeAnalysis typeAnalysis = new TypeAnalysis(methodGen, dfs, typeMerger, visitor);				final TypeDataflow typeDataflow = new TypeDataflow(cfg, typeAnalysis);				typeDataflow.execute();				new LocationScanner(cfg).scan(new LocationScanner.Callback() {					public void visitLocation(Location location) {						try {							InstructionHandle handle = location.getHandle();							Instruction ins = handle.getInstruction();							short opcode = ins.getOpcode();							if (opcode == Constants.IF_ACMPEQ || opcode == Constants.IF_ACMPNE) {								TypeFrame frame = typeDataflow.getFactAtLocation(location);								if (frame.getStackDepth() < 2)									throw new AnalysisException("Stack underflow in " +										SignatureConverter.convertMethodSignature(methodGen) + " at " + handle);								int numSlots = frame.getNumSlots();								Type op1 = frame.getValue(numSlots - 1);								Type op2 = frame.getValue(numSlots - 2);									if (op1 instanceof ReferenceType && op2 instanceof ReferenceType) {									ReferenceType ot1 = (ReferenceType) op1;									ReferenceType ot2 = (ReferenceType) op2;										if (ot1.getSignature().equals(STRING_SIGNATURE) &&										ot2.getSignature().equals(STRING_SIGNATURE)) {										//System.out.println("String/String comparison!");										// Compute the priority:										// - two static strings => do not report										// - dynamic string and anything => high										// - static string and unknown => medium										// - all other cases => low										int priority = LOW_PRIORITY;										byte type1 = ot1.getType();										byte type2 = ot2.getType();										if (type1 == T_STATIC_STRING && type2 == T_STATIC_STRING)											priority = LOW_PRIORITY + 1;										else if (type1 == T_DYNAMIC_STRING || type2 == T_DYNAMIC_STRING)											priority = HIGH_PRIORITY;										else if (type1 == T_STATIC_STRING || type2 == T_STATIC_STRING)											priority = NORMAL_PRIORITY;										if (priority <= LOW_PRIORITY) {											String sourceFile = jclass.getSourceFileName();											bugReporter.reportBug(new BugInstance("ES_COMPARING_STRINGS_WITH_EQ", priority)												.addClassAndMethod(methodGen, sourceFile)												.addSourceLine(methodGen, sourceFile, handle)												.addClass("java.lang.String").describe("CLASS_REFTYPE")											);										}										}								}							}						} catch (DataflowAnalysisException e) {							throw new AnalysisException("Caught exception: " + e.toString(), e);						}					}				});			}		} catch (DataflowAnalysisException e) {			throw new AnalysisException("Exception in FindRefComparison: " + e.getMessage(), e);		} catch (CFGBuilderException e) {			throw new AnalysisException("Exception in FindRefComparison: " + e.getMessage(), e);		}	}