Class IsNullValue

    • Field Detail

      • DEBUG_EXCEPTION

        private static final boolean DEBUG_EXCEPTION
      • DEBUG_KABOOM

        private static final boolean DEBUG_KABOOM
      • CHECKED_NULL

        private static final int CHECKED_NULL
        Definitely null because of a comparison to a known null value.
        See Also:
        Constant Field Values
      • CHECKED_NN

        private static final int CHECKED_NN
        Definitely not null because of a comparison to a known null value.
        See Also:
        Constant Field Values
      • NO_KABOOM_NN

        private static final int NO_KABOOM_NN
        Definitely not null an NPE would have occurred and we would not be here if it were null.
        See Also:
        Constant Field Values
      • NSP

        private static final int NSP
        Null on some simple path (at most one branch) to current location.
        See Also:
        Constant Field Values
      • NN_UNKNOWN

        private static final int NN_UNKNOWN
        Unknown value (method param, value read from heap, etc.), assumed not null.
        See Also:
        Constant Field Values
      • NCP2

        private static final int NCP2
        Null on some complex path (at least two branches) to current location.
        See Also:
        Constant Field Values
      • NCP3

        private static final int NCP3
        Null on some complex path (at least three branches) to current location.
        See Also:
        Constant Field Values
      • EXCEPTION

        private static final int EXCEPTION
        Value was propagated along an exception path.
        See Also:
        Constant Field Values
      • PARAM

        private static final int PARAM
        Value is (potentially) null because of a parameter passed to the method.
        See Also:
        Constant Field Values
      • RETURN_VAL

        private static final int RETURN_VAL
        Value is (potentially) null because of a value returned from a called method.
        See Also:
        Constant Field Values
      • READLINE_VAL

        private static final int READLINE_VAL
        Value is (potentially) null because of a value returned from readline.
        See Also:
        Constant Field Values
      • mergeMatrix

        private static final int[][] mergeMatrix
      • instanceByFlagsList

        private static final IsNullValue[][] instanceByFlagsList
      • kind

        private final int kind
      • locationOfKaBoom

        private final Location locationOfKaBoom
    • Constructor Detail

      • IsNullValue

        private IsNullValue​(int kind)
      • IsNullValue

        private IsNullValue​(int kind,
                            Location ins)
    • Method Detail

      • createInstanceByFlagList

        private static IsNullValue[][] createInstanceByFlagList()
      • checkNoKaboomNNLocation

        private void checkNoKaboomNNLocation()
      • 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()
      • getFlags

        private int getFlags()
      • hasFlag

        private boolean hasFlag​(int flag)
      • 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

        public IsNullValue toExceptionValue()
        Convert to an exception path value.
      • 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
      • markInformationAsComingFromFieldValue

        public IsNullValue markInformationAsComingFromFieldValue​(XField field)
        Convert to a value known because it was returned from a method in a method property database.
        Parameters:
        field - TODO
      • nullValue

        public static IsNullValue nullValue()
        Get the instance representing values that are definitely null.
      • 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.
      • 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.
      • noKaboomNonNullValue

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

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

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

        public static IsNullValue parameterMarkedAsNonnull​(XMethodParameter mp)
        Get instance representing a parameter marked as Nonnull
      • 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.
      • pathSensitiveNullValue

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

        public static IsNullValue pathSensitiveNonNullValue()
        Get non-null value resulting from comparison to explicit null.
      • 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

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

        public Location getLocationOfKaBoom()
      • 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)