Package edu.umd.cs.findbugs.detect
Class FindRefComparison
- java.lang.Object
-
- edu.umd.cs.findbugs.detect.FindRefComparison
-
- All Implemented Interfaces:
ExtendedTypes,Detector,Priorities
public class FindRefComparison extends java.lang.Object implements Detector, ExtendedTypes
Find suspicious reference comparisons. This includes:- Strings and other java.lang objects compared by reference equality
- Calls to equals(Object) where the argument is a different type than the receiver object
- Author:
- David Hovemeyer, Bill Pugh
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFindRefComparison.DynamicStringTypeType representing a dynamically created String.static classFindRefComparison.EmptyStringTypestatic classFindRefComparison.FinalConstantstatic classFindRefComparison.ParameterStringTypeType representing a String passed as a parameter.static classFindRefComparison.StaticStringTypeType representing a static String.
-
Field Summary
-
Fields inherited from interface edu.umd.cs.findbugs.ba.type.ExtendedTypes
T_AVAIL_TYPE, T_BOTTOM, T_DOUBLE_EXTRA, T_EXCEPTION, T_LONG_EXTRA, T_NULL, T_TOP
-
Fields inherited from interface edu.umd.cs.findbugs.Priorities
EXP_PRIORITY, HIGH_PRIORITY, IGNORE_PRIORITY, LOW_PRIORITY, NORMAL_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description FindRefComparison(BugReporter bugReporter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MethodDescriptorgetInvokedMethod(org.apache.bcel.generic.ConstantPoolGen cpg, org.apache.bcel.generic.InvokeInstruction inv)MethodAnnotationgetMethodCalledAnnotation(org.apache.bcel.generic.ConstantPoolGen cpg, org.apache.bcel.generic.InvokeInstruction inv)voidreport()This method is called after all classes to be visited.voidvisitClassContext(ClassContext classContext)Visit the ClassContext for a class which should be analyzed for instances of bug patterns.
-
-
-
Constructor Detail
-
FindRefComparison
public FindRefComparison(BugReporter bugReporter)
-
-
Method Detail
-
visitClassContext
public void visitClassContext(ClassContext classContext)
Description copied from interface:DetectorVisit the ClassContext for a class which should be analyzed for instances of bug patterns.- Specified by:
visitClassContextin interfaceDetector- Parameters:
classContext- the ClassContext
-
getMethodCalledAnnotation
@CheckForNull public MethodAnnotation getMethodCalledAnnotation(org.apache.bcel.generic.ConstantPoolGen cpg, org.apache.bcel.generic.InvokeInstruction inv)
-
getInvokedMethod
public MethodDescriptor getInvokedMethod(org.apache.bcel.generic.ConstantPoolGen cpg, org.apache.bcel.generic.InvokeInstruction inv)
-
-