Class ConstantPropagationAnalysis


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

    • numberValue

      @Nullable public static Number numberValue​(TreePath exprPath, 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.