instance.addField(xf).describe(FieldAnnotation.LOADED_FROM_ROLE); } else { instance.addSomeSourceForTopTwoStackValues(classContext, method, location);
.addString("Calling assertSame with two distinct objects") .addFoundAndExpectedType(rhsType, lhsType) .addSomeSourceForTopTwoStackValues(classContext, method, location), SourceLineAnnotation.fromVisitedInstruction(classContext, methodGen, sourceFile, handle)); new BugInstance(this, "EC_UNRELATED_TYPES_USING_POINTER_EQUALITY", result.getPriority()) .addClassAndMethod(methodGen, sourceFile).addFoundAndExpectedType(rhsType, lhsType) .addSomeSourceForTopTwoStackValues(classContext, method, location), SourceLineAnnotation.fromVisitedInstruction(classContext, methodGen, sourceFile, handle));
loc); warning.add(observedLocation); warning.addSomeSourceForTopTwoStackValues(classContext, method, loc); bugReporter.reportBug(warning);
.addType("Ljava/lang/String;").describe(TypeAnnotation.FOUND_ROLE).addSomeSourceForTopTwoStackValues(classContext, method, location); SourceLineAnnotation sourceLineAnnotation = SourceLineAnnotation.fromVisitedInstruction(classContext, methodGen, sourceFile, location.getHandle());
.addSomeSourceForTopTwoStackValues(classContext, method, location) .addOptionalAnnotation(calledMethodAnnotation, MethodAnnotation.METHOD_CALLED), SourceLineAnnotation.fromVisitedInstruction(this.classContext, methodGen, sourceFile, location.getHandle())); .addSomeSourceForTopTwoStackValues(classContext, method, location) .addOptionalAnnotation(calledMethodAnnotation, MethodAnnotation.METHOD_CALLED), SourceLineAnnotation.fromVisitedInstruction(this.classContext, methodGen, sourceFile, location.getHandle())); new BugInstance(this, "EC_UNRELATED_TYPES", priority) .addClassAndMethod(methodGen, sourceFile).addFoundAndExpectedType(rhsType_, lhsType_) .addSomeSourceForTopTwoStackValues(classContext, method, location).addEqualsMethodUsed(targets) .addOptionalAnnotation(calledMethodAnnotation, MethodAnnotation.METHOD_CALLED), SourceLineAnnotation.fromVisitedInstruction(this.classContext, methodGen, sourceFile, new BugInstance(this, "EC_UNRELATED_CLASS_AND_INTERFACE", result.getPriority() + priorityModifier) .addClassAndMethod(methodGen, sourceFile).addFoundAndExpectedType(rhsType_, lhsType_) .addSomeSourceForTopTwoStackValues(classContext, method, location) .addEqualsMethodUsed(DescriptorFactory.createClassDescriptorFromSignature(lhsType_.getSignature())) .addOptionalAnnotation(calledMethodAnnotation, MethodAnnotation.METHOD_CALLED), new BugInstance(this, "EC_UNRELATED_INTERFACES", result.getPriority() + priorityModifier) .addClassAndMethod(methodGen, sourceFile).addFoundAndExpectedType(rhsType_, lhsType_) .addSomeSourceForTopTwoStackValues(classContext, method, location) .addEqualsMethodUsed(DescriptorFactory.createClassDescriptorFromSignature(lhsType_.getSignature())) .addOptionalAnnotation(calledMethodAnnotation, MethodAnnotation.METHOD_CALLED), bugAccumulator.accumulateBug(new BugInstance(this, "EC_UNRELATED_TYPES", result.getPriority() + priorityModifier) .addClassAndMethod(methodGen, sourceFile).addFoundAndExpectedType(rhsType_, lhsType_) .addSomeSourceForTopTwoStackValues(classContext, method, location)
instance.addField(xf).describe(FieldAnnotation.LOADED_FROM_ROLE); } else { instance.addSomeSourceForTopTwoStackValues(classContext, method, location);
.addString("Calling assertSame with two distinct objects") .addFoundAndExpectedType(rhsType, lhsType) .addSomeSourceForTopTwoStackValues(classContext, method, location), SourceLineAnnotation.fromVisitedInstruction(classContext, methodGen, sourceFile, handle)); new BugInstance(this, "EC_UNRELATED_TYPES_USING_POINTER_EQUALITY", result.getPriority()) .addClassAndMethod(methodGen, sourceFile).addFoundAndExpectedType(rhsType, lhsType) .addSomeSourceForTopTwoStackValues(classContext, method, location), SourceLineAnnotation.fromVisitedInstruction(classContext, methodGen, sourceFile, handle));
loc); warning.add(observedLocation); warning.addSomeSourceForTopTwoStackValues(classContext, method, loc); bugReporter.reportBug(warning);
.addType("Ljava/lang/String;").describe(TypeAnnotation.FOUND_ROLE).addSomeSourceForTopTwoStackValues(classContext, method, location); SourceLineAnnotation sourceLineAnnotation = SourceLineAnnotation.fromVisitedInstruction(classContext, methodGen, sourceFile, location.getHandle());
.addSomeSourceForTopTwoStackValues(classContext, method, location) .addOptionalAnnotation(calledMethodAnnotation, MethodAnnotation.METHOD_CALLED), SourceLineAnnotation.fromVisitedInstruction(this.classContext, methodGen, sourceFile, location.getHandle())); .addSomeSourceForTopTwoStackValues(classContext, method, location) .addOptionalAnnotation(calledMethodAnnotation, MethodAnnotation.METHOD_CALLED), SourceLineAnnotation.fromVisitedInstruction(this.classContext, methodGen, sourceFile, location.getHandle())); new BugInstance(this, "EC_UNRELATED_TYPES", priority) .addClassAndMethod(methodGen, sourceFile).addFoundAndExpectedType(rhsType_, lhsType_) .addSomeSourceForTopTwoStackValues(classContext, method, location).addEqualsMethodUsed(targets) .addOptionalAnnotation(calledMethodAnnotation, MethodAnnotation.METHOD_CALLED), SourceLineAnnotation.fromVisitedInstruction(this.classContext, methodGen, sourceFile, new BugInstance(this, "EC_UNRELATED_CLASS_AND_INTERFACE", result.getPriority() + priorityModifier) .addClassAndMethod(methodGen, sourceFile).addFoundAndExpectedType(rhsType_, lhsType_) .addSomeSourceForTopTwoStackValues(classContext, method, location) .addEqualsMethodUsed(DescriptorFactory.createClassDescriptorFromSignature(lhsType_.getSignature())) .addOptionalAnnotation(calledMethodAnnotation, MethodAnnotation.METHOD_CALLED), new BugInstance(this, "EC_UNRELATED_INTERFACES", result.getPriority() + priorityModifier) .addClassAndMethod(methodGen, sourceFile).addFoundAndExpectedType(rhsType_, lhsType_) .addSomeSourceForTopTwoStackValues(classContext, method, location) .addEqualsMethodUsed(DescriptorFactory.createClassDescriptorFromSignature(lhsType_.getSignature())) .addOptionalAnnotation(calledMethodAnnotation, MethodAnnotation.METHOD_CALLED), bugAccumulator.accumulateBug(new BugInstance(this, "EC_UNRELATED_TYPES", result.getPriority() + priorityModifier) .addClassAndMethod(methodGen, sourceFile).addFoundAndExpectedType(rhsType_, lhsType_) .addSomeSourceForTopTwoStackValues(classContext, method, location)