Test if the given expression has side effects.

@param expression the expression.
@param context the list of context expressions.
@return {@code true} if the expression has side effects.
500313
protected Boolean _hasSideEffects(XBasicForLoopExpression expression, ISideEffectContext context) {
		context.open();
		for (final XExpression ex : expression.getInitExpressions()) {
			if (hasSideEffects(ex, context)) {
				return true;
			}
		}
		if (hasSideEffects(expression.getEachExpression(), context)) {
			return true;
		}
		for (final XExpression ex : expression.getUpdateExpressions()) {
			if (hasSideEffects(ex, context.branch())) {
				return true;
			}
		}
		if (hasSideEffects(expression.getExpression(), context.branch())) {
			return true;
		}
		context.close();
		return false;
	}
858346
private Statement getSideEffects(Expression expr) {
    Expression sideEffectsExpr = extractSideEffects(expr);
    return sideEffectsExpr == null ? null : new ExpressionStatement(sideEffectsExpr);
  }
688407
private boolean checkSimpleExpression(String tagExpression, List<String> scenarioTags) {
        Set<String> expressionTags = extractTagsFromSimpleExpression(tagExpression);

        for (String expressionTag : expressionTags) {
            if (expressionTag.startsWith("@")) {
                if (!scenarioTags.contains(expressionTag)) {
                    //this tag is not listed on the scenario so don't execute
                    return false;
                }
            } else if (expressionTag.startsWith("!")) {
                String expressionTagWithoutNot = expressionTag.substring(1, expressionTag.length());
                if (scenarioTags.contains(expressionTagWithoutNot)) {
                    //this is a negated tag and it exists on the scenario so don't execute
                    return false;
                }
            } else {
                throw new IllegalStateException(String.format("'%s' is not a valid tag, no @ or !@ prefix", expressionTag));
            }
        }

        //there are no reasons left for not executing
        return true;
    }
1371565
public static boolean isMultiValuedPath(List<String> expression) {
        for (String element : expression) {
            if ("*".equals(element) || element.startsWith("*:")) {
                return true;
            }
        }
        return false;
    }
372812
public static boolean isValueReference(String expression)
  {
    if (null != expression)
    {
      int start = expression.indexOf("#{");
      if ((start >= 0) && (expression.indexOf('}', start + 1) >= 0))
      {
          return true;
      }
    }

    return false;
  }
783756
protected Boolean _hasSideEffects(XSwitchExpression expression, ISideEffectContext context) {
		context.open();
		if (hasSideEffects(expression.getSwitch(), context)) {
			return true;
		}
		final List<Map<String, List<XExpression>>> buffers = new ArrayList<>();
		for (final XCasePart ex : expression.getCases()) {
			context.open();
			if (hasSideEffects(ex.getCase(), context)) {
				return true;
			}
			final Map<String, List<XExpression>> buffer = context.createVariableAssignmentBufferForBranch();
			if (hasSideEffects(ex.getThen(), context.branch(buffer))) {
				return true;
			}
			buffers.add(buffer);
			context.close();
		}
		final Map<String, List<XExpression>> buffer = context.createVariableAssignmentBufferForBranch();
		if (hasSideEffects(expression.getDefault(), context.branch(buffer))) {
			return true;
		}
		buffers.add(buffer);
		context.mergeBranchVariableAssignments(buffers);
		context.close();
		return false;
	}
1141844
public static boolean isConstant(Expression expression, Object expected) {
        return expression instanceof ConstantExpression && expected.equals(((ConstantExpression) expression).getValue());
    }
472732
public boolean evaluateCondition(ExecutionContext context) {
        Value v = condition.getValue(context);
        return !(v instanceof NilValue || (v instanceof BooleanValue && !((BooleanValue) v).get()));
    }
380153
protected Boolean _hasSideEffects(XCollectionLiteral expression, ISideEffectContext context) {
		context.open();
		for (final XExpression ex : expression.getElements()) {
			if (hasSideEffects(ex, context)) {
				return true;
			}
		}
		context.close();
		return false;
	}
135285
public boolean isNextIn(Context context) {
        return regex == null || regex.matcher(context.getSource().subToEnd()).lookingAt();
    }
546025
protected boolean checkCondition(TestContext context) {
        if (conditionExpression != null) {
            return conditionExpression.evaluate(index, context);
        }

        // replace dynamic content with each iteration
        String conditionString = condition;
        if (conditionString.indexOf(Citrus.VARIABLE_PREFIX + indexName + Citrus.VARIABLE_SUFFIX) != -1) {
            Properties props = new Properties();
            props.put(indexName, String.valueOf(index));
            conditionString = new PropertyPlaceholderHelper(Citrus.VARIABLE_PREFIX, Citrus.VARIABLE_SUFFIX).replacePlaceholders(conditionString, props);
        }

        conditionString = context.replaceDynamicContentInString(conditionString);

        if (ValidationMatcherUtils.isValidationMatcherExpression(conditionString)) {
            try {
                ValidationMatcherUtils.resolveValidationMatcher("iteratingCondition", String.valueOf(index), conditionString, context);
                return true;
            } catch (AssertionError e) {
                return false;
            }
        }

        if (conditionString.indexOf(indexName) != -1) {
            conditionString = conditionString.replaceAll(indexName, String.valueOf(index));
        }

        return BooleanExpressionParser.evaluate(conditionString);
    }
22612
protected boolean isOgnl(final String expression) {
		// 中かっこ（）がある場合はメソッドとして扱う（paramName.methodName(args...))
		return StringUtils.isNotEmpty(expression) && expression.contains("(") && expression.contains(")");
	}
605211
public static void isFalse(Boolean expression) {
		if(!validation) return;
		notNull(expression);
		if(expression)
			throw new ParameterException(ErrorCode.CONSTRAINT);
	}
386704
public static boolean isFollowingArgumentsOrClosure(ExpressionContext context) {
        if (context instanceof PostfixExprAltContext) {
            List<ParseTree> peacChildren = ((PostfixExprAltContext) context).children;

            if (1 == peacChildren.size()) {
                ParseTree peacChild = peacChildren.get(0);

                if (peacChild instanceof PostfixExpressionContext) {
                    List<ParseTree>  pecChildren = ((PostfixExpressionContext) peacChild).children;

                    if (1 == pecChildren.size()) {
                        ParseTree pecChild = pecChildren.get(0);

                        if (pecChild instanceof PathExpressionContext) {
                            PathExpressionContext pec = (PathExpressionContext) pecChild;
                            int t = pec.t;

                            return (2 == t || 3 == t);
                        }
                    }
                }
            }
        }

        return false;
    }
891185
private static void checkNesting(final BooleanExpression expression,
			final List<BooleanExpression> visitedExpressions) {
		if (visitedExpressions.contains(expression)) {
			// Unfortunately, we can't give much more information - even calling toString() will overflow the stack.
			throw new SyntaxException("An expression can not contain itself.");
		}

		visitedExpressions.add(expression);

		if (expression instanceof GroupExpression) {
			GroupExpression group = (GroupExpression) expression;
			for (BooleanExpression operand : group.getOperands()) {
				checkNesting(operand, visitedExpressions);
			}
		}
	}
808790
public static boolean isFalse(Expression expression) {
        if (expression == null) {
            return false;
        }
        if (expression instanceof PropertyExpression && classNodeImplementsType(((PropertyExpression) expression).getObjectExpression().getType(), Boolean.class)) {
            if (((PropertyExpression) expression).getProperty() instanceof ConstantExpression
                    && "FALSE".equals(((ConstantExpression) ((PropertyExpression) expression).getProperty()).getValue())) {
                return true;
            }
        }
        return ((expression instanceof ConstantExpression) && ((ConstantExpression) expression).isFalseExpression())
                || "Boolean.FALSE".equals(expression.getText());
    }
966776
protected Boolean _hasSideEffects(XVariableDeclaration expression, ISideEffectContext context) {
		if (hasSideEffects(expression.getRight(), context)) {
			return true;
		}
		context.declareVariable(expression.getIdentifier(), expression.getRight());
		return false;
	}