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

import org.binwang.bard.core.marker.After;
import org.binwang.bard.core.marker.Before;

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

public abstract class Injector<ReturnType, AnnotationType extends Annotation> extends GenericHandler<ReturnType, AnnotationType> {
    public Injector(Context context,
                    ReturnType variable,
                    AnnotationType annotation,
                    AnnotationMapper mapper) {
        super(context, variable, annotation, mapper);
    }

    public static Injector newInstance(
            Class<? extends Injector> injectorClass,
            Class<? extends Annotation> annotationClass,
            Context context,
            Object variable,
            Annotation annotation,
            AnnotationMapper mapper)
            throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {
        // TODO: check constructor type?
        return injectorClass.getDeclaredConstructor(Context.class, Object.class, annotationClass, AnnotationMapper.class)
                .newInstance(context, variable, annotation, mapper);
    }

    public void before()
            throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
        runMethods(Before.class);
    }

    public void after()
            throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
        runMethods(After.class);
    }
}<commit_msg>remove todo since it's done<commit_after>package org.binwang.bard.core;

import org.binwang.bard.core.marker.After;
import org.binwang.bard.core.marker.Before;

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

public abstract class Injector<ReturnType, AnnotationType extends Annotation> extends GenericHandler<ReturnType, AnnotationType> {
    public Injector(Context context,
                    ReturnType variable,
                    AnnotationType annotation,
                    AnnotationMapper mapper) {
        super(context, variable, annotation, mapper);
    }

    public static Injector newInstance(
            Class<? extends Injector> injectorClass,
            Class<? extends Annotation> annotationClass,
            Context context,
            Object variable,
            Annotation annotation,
            AnnotationMapper mapper)
            throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {
        return injectorClass.getDeclaredConstructor(Context.class, Object.class, annotationClass, AnnotationMapper.class)
                .newInstance(context, variable, annotation, mapper);
    }

    public void before()
            throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
        runMethods(Before.class);
    }

    public void after()
            throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
        runMethods(After.class);
    }
}
{'fraction_non_alphanumeric': 0.06683401317853781, 'fraction_numerical': 0.0, 'mean_word_length': 3.1510416666666665, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '248367', 'n_tokens_mistral': 776, 'n_tokens_neox': 721, 'n_words': 178}