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.
192041
protected Boolean _hasSideEffects(XThrowExpression expression, ISideEffectContext context) {
		return hasSideEffects(expression.getExpression(), context);
	}
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);
    }
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;
    }
643341
public Object evaluateExpression(String expression, EvaluationContext context) throws EvaluationError {
        return evaluateExpression(expression, context, EvaluationStrategy.COMPLETE);
    }
1141844
public static boolean isConstant(Expression expression, Object expected) {
        return expression instanceof ConstantExpression && expected.equals(((ConstantExpression) expression).getValue());
    }
1202580
public void addExpression(final String _expression)
    {
        this.tokens.add(new Token(ValueList.TokenType.EXPRESSION, _expression));
        getExpressions().add(_expression);
    }
1169273
@Check
	public void checkAssertKeywordUse(SarlAssertExpression expression) {
		final XExpression condition = expression.getCondition();
		if (condition != null) {
			final LightweightTypeReference fromType = getActualType(condition);
			if (!fromType.isAssignableFrom(Boolean.TYPE)) {
				error(MessageFormat.format(
						Messages.SARLValidator_38,
						getNameOfTypes(fromType), boolean.class.getName()),
						condition,
						null,
						ValidationMessageAcceptor.INSIGNIFICANT_INDEX,
						INCOMPATIBLE_TYPES);
				return;
			}
			if (getExpressionHelper() instanceof SARLExpressionHelper) {
				final SARLExpressionHelper helper = (SARLExpressionHelper) getExpressionHelper();
				final Boolean constant = helper.toBooleanPrimitiveWrapperConstant(condition);
				if (constant == Boolean.TRUE && !isIgnored(DISCOURAGED_BOOLEAN_EXPRESSION)) {
					addIssue(Messages.SARLValidator_51,
							condition,
							null,
							ValidationMessageAcceptor.INSIGNIFICANT_INDEX,
							DISCOURAGED_BOOLEAN_EXPRESSION);
					return;
				}
			}
		}
	}
69375
public static Condition createCondition(String expression) {
        try {
            return INSTANCE.ctorCondition.newInstance(expression);
        }
        catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
1372054
@Override
  public void setFilter(@NonNull Expression expression) {
    layerFilter = expression;
    layer.setFilter(layerFilter);
  }
1242822
protected Boolean _hasSideEffects(XTryCatchFinallyExpression expression, ISideEffectContext context) {
		final List<Map<String, List<XExpression>>> buffers = new ArrayList<>();
		Map<String, List<XExpression>> buffer = context.createVariableAssignmentBufferForBranch();
		if (hasSideEffects(expression.getExpression(), context.branch(buffer))) {
			return true;
		}
		buffers.add(buffer);
		for (final XCatchClause clause : expression.getCatchClauses()) {
			context.open();
			buffer = context.createVariableAssignmentBufferForBranch();
			if (hasSideEffects(clause.getExpression(), context.branch(buffer))) {
				return true;
			}
			buffers.add(buffer);
			context.close();
		}
		context.mergeBranchVariableAssignments(buffers);
		if (hasSideEffects(expression.getFinallyExpression(), context)) {
			return true;
		}
		return false;
	}
352642
public static boolean isClosureDeclaration(ASTNode expression) {
        if (expression instanceof DeclarationExpression) {
            if (((DeclarationExpression) expression).getRightExpression() instanceof ClosureExpression) {
                return true;
            }
        }
        if (expression instanceof FieldNode) {
            ClassNode type = ((FieldNode) expression).getType();
            if (AstUtil.classNodeImplementsType(type, Closure.class)) {
                return true;
            } else if (((FieldNode) expression).getInitialValueExpression() instanceof ClosureExpression) {
                return true;
            }
        }
        return false;
    }
608405
public void setExpressions(java.util.Collection<ExpressionStatus> expressions) {
        if (expressions == null) {
            this.expressions = null;
            return;
        }

        this.expressions = new com.amazonaws.internal.SdkInternalList<ExpressionStatus>(expressions);
    }
1304175
public static boolean isValidationMatcherExpression(String expression) {
        return expression.startsWith(Citrus.VALIDATION_MATCHER_PREFIX) &&
                expression.endsWith(Citrus.VALIDATION_MATCHER_SUFFIX);
    }
419234
public static void isTrue(Boolean expression) {
		if(!validation) return;
		notNull(expression);
		if(!expression)
			throw new ParameterException(ErrorCode.CONSTRAINT);
	}
111093
public static boolean isCompositeComponentExpression(String expression)
    {
        if (expression.contains(CC))
        {
            return CC_EXPRESSION_REGEX.matcher(expression).matches();
        }
        else
        {
            return false;
        }
    }
250740
public boolean suspicious(Context context) {
        for(ProcPattern pattern:patterns){
            if(pattern.suspicious(context)){
                return true;
            }
        }
        return false;
    }
829071
boolean isPurableOperation(XtendFunction operation, ISideEffectContext context) {
		if (isUnpureOperationPrototype(operation)) {
			return false;
		}
		if (this.nameValidator.isNamePatternForNotPureOperation(operation)) {
			return false;
		}
		if (this.nameValidator.isNamePatternForPureOperation(operation)) {
			return true;
		}
		if (context == null) {
			return !hasSideEffects(
					getInferredPrototype(operation),
					operation.getExpression());
		}
		final Boolean result = internalHasSideEffects(operation.getExpression(), context);
		return result == null || !result.booleanValue();
	}