Class NullDerefAndRedundantComparisonFinder
java.lang.Object
edu.umd.cs.findbugs.ba.npe.NullDerefAndRedundantComparisonFinder
A user-friendly front end for finding null pointer dereferences and redundant
null comparisons.
- Author:
- David Hovemeyer
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionNullDerefAndRedundantComparisonFinder(ClassContext classContext, org.apache.bcel.classfile.Method method, NullDerefAndRedundantComparisonCollector collector) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckEdges(CFG cfg, Map<ValueNumber, NullValueUnconditionalDeref> nullValueGuaranteedDerefMap, Map<ValueNumber, SortedSet<Location>> bugEdgeLocationMap) voidexecute()findNullAssignments(Set<LocationWhereValueBecomesNull> locationWhereValueBecomesNullSet) voidreportBugs(Map<ValueNumber, NullValueUnconditionalDeref> nullValueGuaranteedDerefMap, HashSet<ValueNumber> npeIfStatementCovered, Map<ValueNumber, SortedSet<Location>> bugLocationMap, Map<ValueNumber, Set<Location>> nullValueAssignmentMap)
-
Constructor Details
-
NullDerefAndRedundantComparisonFinder
public NullDerefAndRedundantComparisonFinder(ClassContext classContext, org.apache.bcel.classfile.Method method, NullDerefAndRedundantComparisonCollector collector) Constructor.- Parameters:
classContext- the ClassContextmethod- the method to analyzecollector- the NullDerefAndRedundantComparisonCollector used to report null derefs and redundant null comparisons
-
-
Method Details
-
execute
public void execute() -
findNullAssignments
public Map<ValueNumber, Set<Location>> findNullAssignments(Set<LocationWhereValueBecomesNull> locationWhereValueBecomesNullSet) -
reportBugs
public void reportBugs(Map<ValueNumber, NullValueUnconditionalDeref> nullValueGuaranteedDerefMap, HashSet<ValueNumber> npeIfStatementCovered, Map<ValueNumber, SortedSet<Location>> bugLocationMap, Map<ValueNumber, Set<Location>> nullValueAssignmentMap) throws CFGBuilderException, DataflowAnalysisException -
checkEdges
public void checkEdges(CFG cfg, Map<ValueNumber, NullValueUnconditionalDeref> nullValueGuaranteedDerefMap, Map<ValueNumber, SortedSet<Location>> bugEdgeLocationMap) throws DataflowAnalysisException - Throws:
DataflowAnalysisException
-