Class ConstantPropagationAnalysis

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

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

    Modifier and Type
    Method
    Description
    static @Nullable Number
    numberValue(com.sun.source.util.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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • numberValue

      public static @Nullable Number numberValue(com.sun.source.util.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.