<commit_before>package org.binwang.bard.core;

import org.binwang.bard.core.marker.Handle;

import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public abstract class Handler extends GenericHandler<Annotation> {

    public static Handler newInstance(
            Class<? extends Handler> handlerClass,
            Context context,
            AnnotationMapper mapper)
            throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {
        Handler handler = handlerClass.newInstance();
        handler.build(context, null, Object.class, null, mapper);
        return handler;
    }

    public Object run()
            throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {
        Method[] methods = this.getClass().getMethods();
        for (Method method : methods) {
            Object result = runMethod(method, Handle.class);
            if (result != NoAdapter.NO_ADAPTER) {
                context.result = result;
                return result;
            }
        }
        return NoAdapter.NO_ADAPTER;
    }
}<commit_msg>it is useless to write result after run the filters<commit_after>package org.binwang.bard.core;

import org.binwang.bard.core.marker.Handle;

import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public abstract class Handler extends GenericHandler<Annotation> {

    public static Handler newInstance(
            Class<? extends Handler> handlerClass,
            Context context,
            AnnotationMapper mapper)
            throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {
        Handler handler = handlerClass.newInstance();
        handler.build(context, null, Object.class, null, mapper);
        return handler;
    }

    public Object run()
            throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {
        Method[] methods = this.getClass().getMethods();
        for (Method method : methods) {
            Object result = runMethod(method, Handle.class);
            if (result != NoAdapter.NO_ADAPTER) {
                return result;
            }
        }
        return NoAdapter.NO_ADAPTER;
    }
}
{'fraction_non_alphanumeric': 0.07882789929839043, 'fraction_numerical': 0.0, 'mean_word_length': 2.8846153846153846, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3427479', 'n_tokens_mistral': 599, 'n_tokens_neox': 570, 'n_words': 149}