<commit_before>package org.mvel.block;

import org.mvel.ExecutableStatement;
import org.mvel.MVEL;
import org.mvel.Token;
import org.mvel.integration.VariableResolverFactory;

/**
 * @author <NAME>
 */
public class AssertToken extends Token {
    public ExecutableStatement assertion;

    public AssertToken(char[] expr, int fields) {
        super(expr, fields);

        assertion = (ExecutableStatement) MVEL.compileExpression(expr);
    }


    public Object getReducedValueAccelerated(Object ctx, Object thisValue, VariableResolverFactory factory) {
        Boolean bool = (Boolean) assertion.getValue(ctx, thisValue, factory);
        if (!bool) throw new AssertionError("assertion failed in expression: " + new String(this.name));
        return bool;
    }

    public Object getReducedValue(Object ctx, Object thisValue, VariableResolverFactory factory) {
        return getReducedValueAccelerated(ctx, thisValue, factory);
    }
}<commit_msg>Assertion support complete.<commit_after>package org.mvel.block;

import org.mvel.ExecutableStatement;
import static org.mvel.MVEL.compileExpression;
import org.mvel.Token;
import org.mvel.integration.VariableResolverFactory;

/**
 * @author <NAME>
 */
public class AssertToken extends Token {
    public ExecutableStatement assertion;

    public AssertToken(char[] expr, int fields) {
        super(expr, fields);
        assertion = (ExecutableStatement) compileExpression(expr);
    }

    public Object getReducedValueAccelerated(Object ctx, Object thisValue, VariableResolverFactory factory) {
        Boolean bool = (Boolean) assertion.getValue(ctx, thisValue, factory);
        if (!bool) throw new AssertionError("assertion failed in expression: " + new String(this.name));
        return bool;
    }

    public Object getReducedValue(Object ctx, Object thisValue, VariableResolverFactory factory) {
        return getReducedValueAccelerated(ctx, thisValue, factory);
    }
}
{'fraction_non_alphanumeric': 0.09236326109391124, 'fraction_numerical': 0.0, 'mean_word_length': 4.254742547425474, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7311723', 'n_tokens_mistral': 533, 'n_tokens_neox': 513, 'n_words': 139}