|
FindBugs™ 1.3.9 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.umd.cs.findbugs.detect.FindNullDeref
public class FindNullDeref
A Detector to find instructions where a NullPointerException might be raised. We also look for useless reference comparisons involving null and non-null values.
IsNullValueAnalysis| Field Summary | |
|---|---|
static boolean |
DEBUG
|
| Fields inherited from interface edu.umd.cs.findbugs.Priorities |
|---|
EXP_PRIORITY, HIGH_PRIORITY, IGNORE_PRIORITY, LOW_PRIORITY, NORMAL_PRIORITY |
| Constructor Summary | |
|---|---|
FindNullDeref(BugReporter bugReporter)
|
|
| Method Summary | |
|---|---|
void |
foundGuaranteedNullDeref(java.util.Set<Location> assignedNullLocationSet,
java.util.Set<Location> derefLocationSet,
java.util.SortedSet<Location> doomedLocations,
ValueNumberDataflow vna,
ValueNumber refValue,
BugAnnotation variableAnnotation,
NullValueUnconditionalDeref deref,
boolean npeIfStatementCovered)
Subclasses should override this method to capture values assigned null (or that become null through a comparison and branch) that are guaranteed to reach a dereference (ignoring implicit exception paths). |
void |
foundNullDeref(Location location,
ValueNumber valueNumber,
IsNullValue refValue,
ValueNumberFrame vnaFrame)
Deprecated. Use foundNullDeref(Location,ValueNumber,IsNullValue,ValueNumberFrame,boolean) instead |
void |
foundNullDeref(Location location,
ValueNumber valueNumber,
IsNullValue refValue,
ValueNumberFrame vnaFrame,
boolean isConsistent)
Subclasses should override this method to capture locations where a null pointer is dereferenced. |
void |
foundRedundantNullCheck(Location location,
RedundantBranch redundantBranch)
Subclasses should override this method to capture locations where a redundant null comparison is performed. |
static boolean |
isThrower(BasicBlock target)
|
void |
report()
This method is called after all classes to be visited. |
boolean |
skipIfInsideCatchNull()
|
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 |
|---|
public static final boolean DEBUG
| Constructor Detail |
|---|
public FindNullDeref(BugReporter bugReporter)
| Method Detail |
|---|
public void visitClassContext(ClassContext classContext)
Detector
visitClassContext in interface DetectorclassContext - the ClassContextpublic void report()
Detector
report in interface Detectorpublic boolean skipIfInsideCatchNull()
public void foundNullDeref(Location location,
ValueNumber valueNumber,
IsNullValue refValue,
ValueNumberFrame vnaFrame)
foundNullDeref(Location,ValueNumber,IsNullValue,ValueNumberFrame,boolean) instead
NullDerefAndRedundantComparisonCollector
foundNullDeref in interface NullDerefAndRedundantComparisonCollectorlocation - the Location of the null dereferencevalueNumber - the ValueNumber of the possibly-null valuerefValue - the kind of possibly-null value dereferencedvnaFrame - The ValueNumber Frame at the point where the dereference occurred
public void foundNullDeref(Location location,
ValueNumber valueNumber,
IsNullValue refValue,
ValueNumberFrame vnaFrame,
boolean isConsistent)
NullDerefAndRedundantComparisonCollector
foundNullDeref in interface NullDerefAndRedundantComparisonCollectorlocation - the Location of the null dereferencevalueNumber - the ValueNumber of the possibly-null valuerefValue - the kind of possibly-null value dereferencedvnaFrame - The ValueNumber Frame at the point where the dereference occurredisConsistent - true if the refValue is identical at all clones of the same instructionpublic static boolean isThrower(BasicBlock target)
public void foundRedundantNullCheck(Location location,
RedundantBranch redundantBranch)
NullDerefAndRedundantComparisonCollector
foundRedundantNullCheck in interface NullDerefAndRedundantComparisonCollectorlocation - the Location of the redundant null checkredundantBranch - the RedundantBranch
public void foundGuaranteedNullDeref(@NonNull
java.util.Set<Location> assignedNullLocationSet,
@NonNull
java.util.Set<Location> derefLocationSet,
java.util.SortedSet<Location> doomedLocations,
ValueNumberDataflow vna,
ValueNumber refValue,
@CheckForNull
BugAnnotation variableAnnotation,
NullValueUnconditionalDeref deref,
boolean npeIfStatementCovered)
NullDerefAndRedundantComparisonCollector
foundGuaranteedNullDeref in interface NullDerefAndRedundantComparisonCollectorassignedNullLocationSet - set of locations where the value becomes nullderefLocationSet - set of locations where dereferences occurdoomedLocations - locations at which the value is doomedvna - ValueNumberDataflowrefValue - the null valuevariableAnnotation - TODOderef - TODOnpeIfStatementCovered - true if doom location is a statement
|
FindBugs™ 1.3.9 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||