Class TrustingNullnessAnalysis

All Implemented Interfaces:

public final class TrustingNullnessAnalysis
extends Object
implements Serializable
An interface to the "trusting" nullness analysis. This variant "trusts" Nullable annotations, similar to how a modular nullness checker like the checkerframework's would, meaning method parameters, fields, and method returns are assumed Nullness.NULLABLE only if annotated so.
See Also:
Serialized Form
  • Method Details

    • instance

      public static TrustingNullnessAnalysis instance​( context)
      Retrieve an instance of TrustingNullnessAnalysis from the context. If there is no TrustingNullnessAnalysis currently in the context, create one, insert it, and return it.
    • getNullness

      public Nullness getNullness​(com.sun.source.util.TreePath exprPath, context)
      Returns the Nullness of the leaf of exprPath.

      If the leaf required the compiler to generate autoboxing or autounboxing calls, getNullness returns the Nullness after the boxing/unboxing. This implies that, in those cases, it will always return NONNULL.

    • getFieldInitializerNullness

      public Nullness getFieldInitializerNullness​(com.sun.source.util.TreePath fieldDeclPath, context)
      Returns Nullness of the initializer of the VariableTree at the leaf of the given fieldDeclPath. Returns Nullness.NULL should there be no initializer.
    • hasNullableAnnotation

      public static boolean hasNullableAnnotation​( symbol)