Package edu.umd.cs.findbugs.ba.npe
Class IsNullValue
java.lang.Object
edu.umd.cs.findbugs.ba.npe.IsNullValue
- All Implemented Interfaces:
Debug
,IsNullValueAnalysisFeatures
A class to abstractly represent values in stack slots, indicating whether
thoses values can be null, non-null, null on some incoming path, or unknown.
- Author:
- David Hovemeyer
- See Also:
-
Field Summary
Fields inherited from interface edu.umd.cs.findbugs.ba.Debug
VERIFY_INTEGRITY
Fields inherited from interface edu.umd.cs.findbugs.ba.npe.IsNullValueAnalysisFeatures
NCP_EXTRA_BRANCH, NO_SPLIT_DOWNGRADE_NSP, NO_SWITCH_DEFAULT_AS_EXCEPTION, UNKNOWN_VALUES_ARE_NSP, USE_TYPE_QUALIFIERS
-
Method Summary
Modifier and TypeMethodDescriptionstatic IsNullValue
Get the instance representing a value known to be non-null because it was compared against null value, or because we saw the object creation.static IsNullValue
Get the instance representing a value known to be null because it was compared against null value, or because we saw that it was assigned the null constant.Control split: move given value down in the lattice if it is a conditionally-null value.boolean
int
hashCode()
boolean
Is this value known because of an explicit null check?boolean
Is this value definitely not null?boolean
Is this value definitely null?boolean
Was this value propagated on an exception path?boolean
boolean
Is this value null on a complicated path?boolean
Is this value null on a complicated path?boolean
Is this value null on a complicated path?boolean
Is this value null on some path?boolean
Was this value marked as a possibly null parameter?boolean
boolean
Was this value marked as a possibly null return value?Convert to a value known because it was returned from a method in a method property database.markInformationAsComingFromReturnValueOfMethod
(XMethod methodInvoked) Convert to a value known because it was returned from a method in a method property database.static IsNullValue
merge
(IsNullValue a, IsNullValue b) Merge two values.boolean
Return true if this value is either definitely null, or might be null on a simple path.static IsNullValue
Get the instance representing a value known to be non-null because a NPE would have occurred if it were null.static IsNullValue
Get the instance representing values that are definitely not null.static IsNullValue
Get non-reporting non-null value.static IsNullValue
Get null on complex path value.static IsNullValue
Like "null on complex path" except that there are at least three branches between the explicit null value and the current location.static IsNullValue
Get the instance representing values that are definitely null on some simple (no branches) incoming path.static IsNullValue
Get the instance representing values that are definitely null.static IsNullValue
Get instance representing a parameter marked as MightBeNullstatic IsNullValue
Get instance representing a parameter marked as Nonnullstatic IsNullValue
Get non-null value resulting from comparison to explicit null.static IsNullValue
Get null value resulting from comparison to explicit null.Convert to an exception path value.toString()
boolean
Is this value known to be non null because a NPE would have occurred otherwise?
-
Method Details
-
equals
-
hashCode
public int hashCode() -
isException
public boolean isException()Was this value propagated on an exception path? -
isReturnValue
public boolean isReturnValue()Was this value marked as a possibly null return value? -
isReadlineValue
public boolean isReadlineValue() -
isFieldValue
public boolean isFieldValue() -
isParamValue
public boolean isParamValue()Was this value marked as a possibly null parameter? -
isChecked
public boolean isChecked()Is this value known because of an explicit null check? -
wouldHaveBeenAKaboom
public boolean wouldHaveBeenAKaboom()Is this value known to be non null because a NPE would have occurred otherwise? -
toExceptionValue
Convert to an exception path value. -
markInformationAsComingFromReturnValueOfMethod
Convert to a value known because it was returned from a method in a method property database.- Parameters:
methodInvoked
- TODO
-
markInformationAsComingFromFieldValue
Convert to a value known because it was returned from a method in a method property database.- Parameters:
field
- TODO
-
nullValue
Get the instance representing values that are definitely null. -
checkedNullValue
Get the instance representing a value known to be null because it was compared against null value, or because we saw that it was assigned the null constant. -
nonNullValue
Get the instance representing values that are definitely not null. -
checkedNonNullValue
Get the instance representing a value known to be non-null because it was compared against null value, or because we saw the object creation. -
noKaboomNonNullValue
Get the instance representing a value known to be non-null because a NPE would have occurred if it were null. -
nullOnSimplePathValue
Get the instance representing values that are definitely null on some simple (no branches) incoming path. -
parameterMarkedAsMightBeNull
Get instance representing a parameter marked as MightBeNull -
parameterMarkedAsNonnull
Get instance representing a parameter marked as Nonnull -
nonReportingNotNullValue
Get non-reporting non-null value. This is what we use for unknown values. -
nullOnComplexPathValue
Get null on complex path value. This is like null on simple path value, but there are at least two branches between the explicit null value and the current location. If the conditions are correlated, then the path on which the value is null may be infeasible. -
nullOnComplexPathValue3
Like "null on complex path" except that there are at least three branches between the explicit null value and the current location. -
pathSensitiveNullValue
Get null value resulting from comparison to explicit null. -
pathSensitiveNonNullValue
Get non-null value resulting from comparison to explicit null. -
merge
Merge two values. -
isDefinitelyNull
public boolean isDefinitelyNull()Is this value definitely null? -
isNullOnSomePath
public boolean isNullOnSomePath()Is this value null on some path? -
isNullOnComplicatedPath
public boolean isNullOnComplicatedPath()Is this value null on a complicated path? -
isNullOnComplicatedPath23
public boolean isNullOnComplicatedPath23()Is this value null on a complicated path? -
isNullOnComplicatedPath2
public boolean isNullOnComplicatedPath2()Is this value null on a complicated path? -
mightBeNull
public boolean mightBeNull()Return true if this value is either definitely null, or might be null on a simple path.- Returns:
- true if this value is either definitely null, or might be null on a simple path, false otherwise
-
isDefinitelyNotNull
public boolean isDefinitelyNotNull()Is this value definitely not null? -
toString
-
getLocationOfKaBoom
-
downgradeOnControlSplit
Control split: move given value down in the lattice if it is a conditionally-null value.- Returns:
- another value (equal or further down in the lattice)
-