public String getSignature() { if (isArray()) { return className; } return "L" + className + ";"; }
/** * */ private void check(ClassDescriptor c) { OpcodeStack.Item item = stack.getStackItem(0); if (item.isInitialParameter() && item.getRegisterNumber() == 1) { ClassDescriptor thisClassDescriptor = getClassDescriptor(); if (c.equals(thisClassDescriptor)) { return; } Subtypes2 subtypes2 = AnalysisContext.currentAnalysisContext().getSubtypes2(); try { if (!c.isArray() && (subtypes2.isSubtype(c, thisClassDescriptor) || subtypes2.isSubtype(thisClassDescriptor, c))) { return; } Type thisType = Type.getType(thisClassDescriptor.getSignature()); Type cType = Type.getType(c.getSignature()); IncompatibleTypes check = IncompatibleTypes.getPriorityForAssumingCompatible(thisType, cType, false); int priority = check.getPriority(); if ("java/lang/Object".equals(getSuperclassName()) && ClassName.isLocalOrAnonymous(getClassName())) { priority++; } bugAccumulator.accumulateBug(new BugInstance(this, "EQ_CHECK_FOR_OPERAND_NOT_COMPATIBLE_WITH_THIS", priority) .addClassAndMethod(this).addType(c).describe(TypeAnnotation.FOUND_ROLE), this); classSummary.checksForEqualTo(thisClassDescriptor, c); } catch (ClassNotFoundException e) { bugReporter.reportMissingClass(e); } } }
public String getSignature() { if (isArray()) { return className; } return "L" + className + ";"; }
/** * */ private void check(ClassDescriptor c) { OpcodeStack.Item item = stack.getStackItem(0); if (item.isInitialParameter() && item.getRegisterNumber() == 1) { ClassDescriptor thisClassDescriptor = getClassDescriptor(); if (c.equals(thisClassDescriptor)) { return; } Subtypes2 subtypes2 = AnalysisContext.currentAnalysisContext().getSubtypes2(); try { if (!c.isArray() && (subtypes2.isSubtype(c, thisClassDescriptor) || subtypes2.isSubtype(thisClassDescriptor, c))) { return; } Type thisType = Type.getType(thisClassDescriptor.getSignature()); Type cType = Type.getType(c.getSignature()); IncompatibleTypes check = IncompatibleTypes.getPriorityForAssumingCompatible(thisType, cType, false); int priority = check.getPriority(); if ("java/lang/Object".equals(getSuperclassName()) && ClassName.isAnonymous(getClassName())) { priority++; } bugAccumulator.accumulateBug(new BugInstance(this, "EQ_CHECK_FOR_OPERAND_NOT_COMPATIBLE_WITH_THIS", priority) .addClassAndMethod(this).addType(c).describe(TypeAnnotation.FOUND_ROLE), this); classSummary.checksForEqualTo(thisClassDescriptor, c); } catch (ClassNotFoundException e) { bugReporter.reportMissingClass(e); } } }