Class NullnessAnalysis

java.lang.Object
com.google.errorprone.dataflow.nullnesspropagation.NullnessAnalysis
All Implemented Interfaces:
Serializable

public final class NullnessAnalysis
extends Object
implements Serializable
An interface to the nullness analysis.
See Also:
Serialized Form
  • Method Details

    • instance

      public static NullnessAnalysis instance​(com.sun.tools.javac.util.Context context)
      Retrieve an instance of NullnessAnalysis from the context. If there is no NullnessAnalysis currently in the context, create one, insert it, and return it.
    • getNullness

      public Nullness getNullness​(com.sun.source.util.TreePath exprPath, com.sun.tools.javac.util.Context 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.