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 class
FindRefComparison.DynamicStringType
Type representing a dynamically created String.static class
FindRefComparison.EmptyStringType
static class
FindRefComparison.FinalConstant
static class
FindRefComparison.ParameterStringType
Type representing a String passed as a parameter.static class
FindRefComparison.StaticStringType
Type 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 MethodDescriptor
getInvokedMethod(org.apache.bcel.generic.ConstantPoolGen cpg, org.apache.bcel.generic.InvokeInstruction inv)
MethodAnnotation
getMethodCalledAnnotation(org.apache.bcel.generic.ConstantPoolGen cpg, org.apache.bcel.generic.InvokeInstruction inv)
void
report()
This method is called after all classes to be visited.void
visitClassContext(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:Detector
Visit the ClassContext for a class which should be analyzed for instances of bug patterns.- Specified by:
visitClassContext
in 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)
-
-