LinkedList<WarningWithProperties> refComparisonList = new LinkedList<WarningWithProperties>();
LinkedList<WarningWithProperties> stringComparisonList = new LinkedList<WarningWithProperties>();
comparedForEqualityInThisMethod = new HashMap<String,Integer>();
CFG cfg = classContext.getCFG(method);
DepthFirstSearch dfs = classContext.getDepthFirstSearch(method);
ExceptionSetFactory exceptionSetFactory = classContext.getExceptionSetFactory(method);
// Perform type analysis using our special type merger
// (which handles String types specially, keeping track of
// which ones appear to be dynamically created)
RefComparisonTypeMerger typeMerger = new RefComparisonTypeMerger(bugReporter, exceptionSetFactory);
RefComparisonTypeFrameModelingVisitor visitor = new RefComparisonTypeFrameModelingVisitor(methodGen.getConstantPool(),
typeMerger, bugReporter);
TypeAnalysis typeAnalysis = new SpecialTypeAnalysis(method, methodGen, cfg, dfs, typeMerger, visitor, bugReporter,
exceptionSetFactory);
TypeDataflow typeDataflow = new TypeDataflow(cfg, typeAnalysis);
Profiler profiler = Global.getAnalysisCache().getProfiler();
profiler.start(SpecialTypeAnalysis.class);
try {
typeDataflow.execute();
} finally {
profiler.end(SpecialTypeAnalysis.class);
}
// Inspect Locations in the method for suspicious ref comparisons and
// calls to equals()
for (Iterator<Location> i = cfg.locationIterator(); i.hasNext();) {
Location location = i.next();
inspectLocation(jclass, cpg, method, methodGen, refComparisonList, stringComparisonList, visitor, typeDataflow,
location);
}