/** * Whether this node is a constant node * Its value can not change after the first evaluation and can be cached indefinitely. * @return true if constant, false otherwise */ public final boolean isConstant() { return isConstant(this instanceof JexlNode.Literal<?>); }
protected boolean isConstant(boolean literal) { if (literal) { if (children != null) { for (JexlNode child : children) { if (child instanceof ASTReference) { boolean is = child.isConstant(true); if (!is) { return false; } } else if (child instanceof ASTMapEntry) { boolean is = child.isConstant(true); if (!is) { return false; } } else if (!child.isConstant()) { return false; } } } return true; } return false; } }
if (child instanceof ASTReference && child.jjtGetNumChildren() == 1) { JexlNode desc = child.jjtGetChild(0); if (varf && desc.isConstant()) { String image = desc.image; if (image == null) {