edu.umd.cs.findbugs.ba.npe

Class IsNullValue

public class IsNullValue extends Object implements IsNullValueAnalysisFeatures, Debug

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: IsNullValueFrame IsNullValueAnalysis

Method Summary
static IsNullValuecheckedNonNullValue()
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 IsNullValuecheckedNullValue()
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.
IsNullValuedowngradeOnControlSplit()
Control split: move given value down in the lattice if it is a conditionally-null value.
LocationgetLocationOfKaBoom()
booleanisChecked()
Is this value known because of an explicit null check?
booleanisDefinitelyNotNull()
Is this value definitely not null?
booleanisDefinitelyNull()
Is this value definitely null?
booleanisException()
Was this value propagated on an exception path?
booleanisFieldValue()
booleanisNullOnComplicatedPath()
Is this value null on a complicated path?
booleanisNullOnSomePath()
Is this value null on some path?
booleanisParamValue()
Was this value marked as a possibly null parameter?
booleanisReturnValue()
Was this value marked as a possibly null return value?
IsNullValuemarkInformationAsComingFromFieldValue(XField field)
Convert to a value known because it was returned from a method in a method property database.
IsNullValuemarkInformationAsComingFromReturnValueOfMethod(XMethod methodInvoked)
Convert to a value known because it was returned from a method in a method property database.
static IsNullValuemerge(IsNullValue a, IsNullValue b)
Merge two values.
booleanmightBeNull()
Return true if this value is either definitely null, or might be null on a simple path.
static IsNullValuenoKaboomNonNullValue(Location ins)
Get the instance representing a value known to be non-null because a NPE would have occurred if it were null.
static IsNullValuenonNullValue()
Get the instance representing values that are definitely not null.
static IsNullValuenonReportingNotNullValue()
Get non-reporting non-null value.
static IsNullValuenullOnComplexPathValue()
Get null on complex path value.
static IsNullValuenullOnComplexPathValue3()
Like "null on complex path" except that there are at least three branches between the explicit null value and the current location.
static IsNullValuenullOnSimplePathValue()
Get the instance representing values that are definitely null on some simple (no branches) incoming path.
static IsNullValuenullValue()
Get the instance representing values that are definitely null.
static IsNullValueparameterMarkedAsMightBeNull(XMethodParameter mp)
Get instance representing a parameter marked as MightBeNull
static IsNullValuepathSensitiveNonNullValue()
Get non-null value resulting from comparison to explicit null.
static IsNullValuepathSensitiveNullValue()
Get null value resulting from comparison to explicit null.
IsNullValuetoExceptionValue()
Convert to an exception path value.
booleanwouldHaveBeenAKaboom()
Is this value known to be non null because a NPE would have occurred otherwise?

Method Detail

checkedNonNullValue

public static IsNullValue 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.

checkedNullValue

public static IsNullValue 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.

downgradeOnControlSplit

public IsNullValue 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)

getLocationOfKaBoom

public Location getLocationOfKaBoom()

isChecked

public boolean isChecked()
Is this value known because of an explicit null check?

isDefinitelyNotNull

public boolean isDefinitelyNotNull()
Is this value definitely not null?

isDefinitelyNull

public boolean isDefinitelyNull()
Is this value definitely null?

isException

public boolean isException()
Was this value propagated on an exception path?

isFieldValue

public boolean isFieldValue()

isNullOnComplicatedPath

public boolean isNullOnComplicatedPath()
Is this value null on a complicated path?

isNullOnSomePath

public boolean isNullOnSomePath()
Is this value null on some path?

isParamValue

public boolean isParamValue()
Was this value marked as a possibly null parameter?

isReturnValue

public boolean isReturnValue()
Was this value marked as a possibly null return value?

markInformationAsComingFromFieldValue

public IsNullValue markInformationAsComingFromFieldValue(XField field)
Convert to a value known because it was returned from a method in a method property database.

Parameters: methodInvoked TODO

markInformationAsComingFromReturnValueOfMethod

public IsNullValue markInformationAsComingFromReturnValueOfMethod(XMethod methodInvoked)
Convert to a value known because it was returned from a method in a method property database.

Parameters: methodInvoked TODO

merge

public static IsNullValue merge(IsNullValue a, IsNullValue b)
Merge two values.

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

noKaboomNonNullValue

public static IsNullValue noKaboomNonNullValue(Location ins)
Get the instance representing a value known to be non-null because a NPE would have occurred if it were null.

nonNullValue

public static IsNullValue nonNullValue()
Get the instance representing values that are definitely not null.

nonReportingNotNullValue

public static IsNullValue nonReportingNotNullValue()
Get non-reporting non-null value. This is what we use for unknown values.

nullOnComplexPathValue

public static IsNullValue 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

public static IsNullValue nullOnComplexPathValue3()
Like "null on complex path" except that there are at least three branches between the explicit null value and the current location.

nullOnSimplePathValue

public static IsNullValue nullOnSimplePathValue()
Get the instance representing values that are definitely null on some simple (no branches) incoming path.

nullValue

public static IsNullValue nullValue()
Get the instance representing values that are definitely null.

parameterMarkedAsMightBeNull

public static IsNullValue parameterMarkedAsMightBeNull(XMethodParameter mp)
Get instance representing a parameter marked as MightBeNull

pathSensitiveNonNullValue

public static IsNullValue pathSensitiveNonNullValue()
Get non-null value resulting from comparison to explicit null.

pathSensitiveNullValue

public static IsNullValue pathSensitiveNullValue()
Get null value resulting from comparison to explicit null.

toExceptionValue

public IsNullValue toExceptionValue()
Convert to an exception path value.

wouldHaveBeenAKaboom

public boolean wouldHaveBeenAKaboom()
Is this value known to be non null because a NPE would have occurred otherwise?
FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.