Class ConstantPropagationAnalysis

java.lang.Object
com.google.errorprone.dataflow.ConstantPropagationAnalysis

public final class ConstantPropagationAnalysis extends Object
An interface to the constant propagation analysis.
  • Method Details Link icon

    • numberValue Link icon

      public static @Nullable Number numberValue(TreePath exprPath, com.sun.tools.javac.util.Context context)
      Returns the value of the leaf of exprPath, if it is determined to be a constant (always evaluates to the same numeric value), and null otherwise. Note that returning null does not necessarily mean the expression is *not* a constant.