|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.umd.cs.findbugs.detect.FindRefComparison
public class FindRefComparison
Nested Class Summary | |
---|---|
private static class |
FindRefComparison.DynamicStringType
Type representing a dynamically created String. |
private static class |
FindRefComparison.RefComparisonTypeFrameModelingVisitor
|
private static class |
FindRefComparison.RefComparisonTypeMerger
Type merger to use the extended String types. |
private static class |
FindRefComparison.StaticStringType
Type representing a static String. |
Field Summary | |
---|---|
private BugReporter |
bugReporter
|
private static boolean |
DEBUG
|
private static org.apache.bcel.generic.Type |
dynamicStringTypeInstance
|
private static java.util.BitSet |
invokeInstanceSet
Set of opcodes that invoke instance methods on an object. |
private static java.util.BitSet |
prescreenSet
Set of bytecodes using for prescreening. |
private BugInstance |
refComparison
|
private static boolean |
REPORT_ALL_REF_COMPARISONS
|
(package private) static boolean |
sawStringIntern
|
private static org.apache.bcel.generic.Type |
staticStringTypeInstance
|
private static java.lang.String |
STRING_SIGNATURE
|
private BugInstance |
stringComparison
|
private static java.util.HashSet<java.lang.String> |
suspiciousSet
Classes that are suspicious if compared by reference. |
private static byte |
T_DYNAMIC_STRING
|
private static byte |
T_STATIC_STRING
|
Fields inherited from interface edu.umd.cs.findbugs.Detector |
---|
EXP_PRIORITY, HIGH_PRIORITY, LOW_PRIORITY, NORMAL_PRIORITY |
Fields inherited from interface edu.umd.cs.findbugs.ba.ExtendedTypes |
---|
T_AVAIL_TYPE, T_BOTTOM, T_DOUBLE_EXTRA, T_EXCEPTION, T_LONG_EXTRA, T_NULL, T_TOP |
Constructor Summary | |
---|---|
FindRefComparison(BugReporter bugReporter)
|
Method Summary | |
---|---|
private void |
analyzeMethod(ClassContext classContext,
org.apache.bcel.classfile.Method method)
|
private void |
checkEqualsComparison(Location location,
org.apache.bcel.classfile.JavaClass jclass,
org.apache.bcel.generic.MethodGen methodGen,
TypeDataflow typeDataflow)
|
private void |
checkRefComparison(Location location,
org.apache.bcel.classfile.JavaClass jclass,
org.apache.bcel.generic.MethodGen methodGen,
TypeDataflow typeDataflow)
|
static void |
main(java.lang.String[] argv)
|
void |
report()
This method is called after all classes to be visited. |
void |
setAnalysisContext(AnalysisContext analysisContext)
Set the AnalysisContext that will be used. |
void |
visitClassContext(ClassContext classContext)
Visit the ClassContext for a class which should be analyzed for instances of bug patterns. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final boolean DEBUG
private static final boolean REPORT_ALL_REF_COMPARISONS
private static final java.util.HashSet<java.lang.String> suspiciousSet
private static final java.util.BitSet invokeInstanceSet
private static final java.util.BitSet prescreenSet
private static final byte T_DYNAMIC_STRING
private static final byte T_STATIC_STRING
private static final java.lang.String STRING_SIGNATURE
private static final org.apache.bcel.generic.Type dynamicStringTypeInstance
private static final org.apache.bcel.generic.Type staticStringTypeInstance
private BugReporter bugReporter
private BugInstance stringComparison
private BugInstance refComparison
static boolean sawStringIntern
Constructor Detail |
---|
public FindRefComparison(BugReporter bugReporter)
Method Detail |
---|
public void setAnalysisContext(AnalysisContext analysisContext)
Detector
setAnalysisContext
in interface Detector
analysisContext
- the AnalysisContextpublic void visitClassContext(ClassContext classContext)
Detector
visitClassContext
in interface Detector
classContext
- the ClassContextprivate void analyzeMethod(ClassContext classContext, org.apache.bcel.classfile.Method method) throws CFGBuilderException, DataflowAnalysisException
CFGBuilderException
DataflowAnalysisException
private void checkRefComparison(Location location, org.apache.bcel.classfile.JavaClass jclass, org.apache.bcel.generic.MethodGen methodGen, TypeDataflow typeDataflow) throws DataflowAnalysisException
DataflowAnalysisException
private void checkEqualsComparison(Location location, org.apache.bcel.classfile.JavaClass jclass, org.apache.bcel.generic.MethodGen methodGen, TypeDataflow typeDataflow) throws DataflowAnalysisException
DataflowAnalysisException
public void report()
Detector
report
in interface Detector
public static void main(java.lang.String[] argv) throws java.lang.Exception
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |