edu.umd.cs.findbugs.ba
Class IsNullValue

java.lang.Object
  extended by edu.umd.cs.findbugs.ba.IsNullValue

public class IsNullValue
extends java.lang.Object

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

Field Summary
private static int CHECKED_NN
           
private static int CHECKED_NULL
           
private static boolean DEBUG_EXCEPTION
           
private static int EXCEPTION
           
private static IsNullValue[] exceptionInstanceList
           
private static IsNullValue[] instanceList
           
private  int kind
           
private static int[][] mergeMatrix
           
private static int NN
           
private static int NN_DNR
           
private static int NSP
           
private static int NSP_DNR
           
private static int NULL
           
 
Constructor Summary
private IsNullValue(int kind)
           
 
Method Summary
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.
 boolean equals(java.lang.Object o)
           
static IsNullValue flowSensitiveNonNullValue()
           
static IsNullValue flowSensitiveNullValue()
           
private  int getBaseKind()
           
 int hashCode()
           
 boolean isChecked()
          Is this value known because of an explicit null check?
 boolean isDefinitelyNotNull()
          Is this value definitely not null?
 boolean isDefinitelyNull()
          Is this value definitely null?
 boolean isException()
          Was this value propagated on an exception path?
 boolean isNullOnSomePath()
          Is this value null on some path?
static IsNullValue merge(IsNullValue a, IsNullValue b)
          Merge two values.
static IsNullValue nonNullValue()
          Get the instance representing values that are definitely not null.
static IsNullValue nonReportingNotNullValue()
          Get non-reporting non-null value.
static IsNullValue nonReportingNullOnSomePathValue()
          Get non-reporting null on some path value.
static IsNullValue nullOnSomePathValue()
          Get the instance representing values that are definitely null on some incoming path.
static IsNullValue nullValue()
          Get the instance representing values that are definitely null.
private  IsNullValue toBaseValue()
           
 IsNullValue toExceptionValue()
          Convert to an exception path value.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEBUG_EXCEPTION

private static final boolean DEBUG_EXCEPTION

NULL

private static final int NULL
See Also:
Constant Field Values

CHECKED_NULL

private static final int CHECKED_NULL
See Also:
Constant Field Values

NN

private static final int NN
See Also:
Constant Field Values

CHECKED_NN

private static final int CHECKED_NN
See Also:
Constant Field Values

NSP

private static final int NSP
See Also:
Constant Field Values

NN_DNR

private static final int NN_DNR
See Also:
Constant Field Values

NSP_DNR

private static final int NSP_DNR
See Also:
Constant Field Values

EXCEPTION

private static final int EXCEPTION
See Also:
Constant Field Values

mergeMatrix

private static final int[][] mergeMatrix

instanceList

private static IsNullValue[] instanceList

exceptionInstanceList

private static IsNullValue[] exceptionInstanceList

kind

private final int kind
Constructor Detail

IsNullValue

private IsNullValue(int kind)
Method Detail

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getBaseKind

private int getBaseKind()

isException

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


isChecked

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


toBaseValue

private IsNullValue toBaseValue()

toExceptionValue

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


nullValue

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


nonNullValue

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


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.


nullOnSomePathValue

public static IsNullValue nullOnSomePathValue()
Get the instance representing values that are definitely null on some incoming path.


nonReportingNotNullValue

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


nonReportingNullOnSomePathValue

public static IsNullValue nonReportingNullOnSomePathValue()
Get non-reporting null on some path value.


flowSensitiveNullValue

public static IsNullValue flowSensitiveNullValue()

flowSensitiveNonNullValue

public static IsNullValue flowSensitiveNonNullValue()

merge

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


isDefinitelyNull

public boolean isDefinitelyNull()
Is this value definitely null?


isNullOnSomePath

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


isDefinitelyNotNull

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


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object