/*
 * Copyright © 2012 Sebastian Hoß <mail@shoss.de>
 * This work is free. You can redistribute it and/or modify it under the
 * terms of the Do What The Fuck You Want To Public License, Version 2,
 * as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
 */
package com.github.sebhoss.contract.verifier;

import com.github.sebhoss.contract.annotation.Clause;
import com.github.sebhoss.contract.annotation.SpEL;

import org.springframework.expression.EvaluationContext;
import org.springframework.expression.Expression;
import org.springframework.expression.ExpressionParser;

/**
 * SpEL-based implementation of the {@link ContractContext}.
 */
@SpEL
public class SpELContractContext implements ContractContext {

    private final ExpressionParser  parser;
    private final EvaluationContext context;

    SpELContractContext(final ExpressionParser parser, final EvaluationContext context) {
        this.parser = parser;
        this.context = context;
    }

    @Override
    public void setInvocationResult(final Object invocationResult) {
        context.setVariable(Clause.RETURN, invocationResult);
    }

    @Override
    public boolean isInViolationWith(final Clause clause) {
        final Expression expression = parser.parseExpression(clause.value());

        return Boolean.FALSE.equals(expression.getValue(context, Boolean.class));
    }

}

@@ -375,60 +375,8 @@
 use;
-%0Aimport com.github.sebhoss.contract.annotation.SpEL;
 %0A%0Aim
@@ -610,14 +610,8 @@
  */%0A
-@SpEL%0A
 publ

Remove redundant qualifier