<commit_before>/* Copyright (c) 2000-2003, jMock.org. See LICENSE.txt */
package test.jmock.core.testsupport;

import org.jmock.core.Invocation;
import org.jmock.core.Invokable;
import org.jmock.expectation.ExpectationValue;

public class MockInvokable extends MockVerifiable implements Invokable {

    public boolean matchesResult;
    public ExpectationValue matchesInvocation = new ExpectationValue("matches.invocation");

    public Object invokeResult;
    public ExpectationValue invokeInvocation = new ExpectationValue("invoke.invocation");
    public Throwable invokeThrow;


    public boolean matches(Invocation invocation) {
        matchesInvocation.setActual(invocation);
        return matchesResult;
    }

    public Object invoke(Invocation invocation) throws Throwable {
        invokeInvocation.setActual(invocation);
        if (invokeThrow != null) {
            throw invokeThrow;
        }
        return invokeResult;
    }
    
    public boolean hasDescription() {
        return true;
    }
    
    public StringBuffer describeTo(StringBuffer buffer) {
        throw new AssertionError("should implement writeTo");
    }
}<commit_msg>Replaced incorrect use of AssertionError with AssertionFailedError<commit_after>/* Copyright (c) 2000-2003, jMock.org. See LICENSE.txt */
package test.jmock.core.testsupport;

import org.jmock.core.Invocation;
import org.jmock.core.Invokable;
import org.jmock.expectation.ExpectationValue;
import junit.framework.AssertionFailedError;

public class MockInvokable extends MockVerifiable implements Invokable {

    public boolean matchesResult;
    public ExpectationValue matchesInvocation = new ExpectationValue("matches.invocation");

    public Object invokeResult;
    public ExpectationValue invokeInvocation = new ExpectationValue("invoke.invocation");
    public Throwable invokeThrow;


    public boolean matches(Invocation invocation) {
        matchesInvocation.setActual(invocation);
        return matchesResult;
    }

    public Object invoke(Invocation invocation) throws Throwable {
        invokeInvocation.setActual(invocation);
        if (invokeThrow != null) {
            throw invokeThrow;
        }
        return invokeResult;
    }
    
    public boolean hasDescription() {
        return true;
    }
    
    public StringBuffer describeTo(StringBuffer buffer) {
        throw new AssertionFailedError("should implement writeTo");
    }
}
{'fraction_non_alphanumeric': 0.07366255144032922, 'fraction_numerical': 0.006584362139917695, 'mean_word_length': 3.6129032258064515, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '415966', 'n_tokens_mistral': 649, 'n_tokens_neox': 618, 'n_words': 160}