Package edu.umd.cs.findbugs.ba.npe
Interface NullDerefAndRedundantComparisonCollector
- All Known Implementing Classes:
FindNullDeref
,NoiseNullDeref
public interface NullDerefAndRedundantComparisonCollector
Callback interface for collecting null pointer derefs and redundant null
comparisons.
- Author:
- David Hovemeyer
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
foundGuaranteedNullDeref
(Set<Location> assignedNullLocationSet, Set<Location> derefLocationSet, 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.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.
-
Method Details
-
foundNullDeref
@Deprecated void foundNullDeref(Location location, ValueNumber valueNumber, IsNullValue refValue, ValueNumberFrame vnaFrame) Deprecated.Subclasses should override this method to capture locations where a null pointer is dereferenced.- Parameters:
location
- 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
-
foundNullDeref
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.- Parameters:
location
- 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 instruction
-
foundRedundantNullCheck
Subclasses should override this method to capture locations where a redundant null comparison is performed.- Parameters:
location
- the Location of the redundant null checkredundantBranch
- the RedundantBranch
-
foundGuaranteedNullDeref
void foundGuaranteedNullDeref(@Nonnull Set<Location> assignedNullLocationSet, @Nonnull Set<Location> derefLocationSet, SortedSet<Location> doomedLocations, ValueNumberDataflow vna, ValueNumber refValue, @CheckForNull 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).- Parameters:
assignedNullLocationSet
- 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
-
foundNullDeref(Location,ValueNumber,IsNullValue,ValueNumberFrame,boolean)
instead