<commit_before>package com.drfits;

import com.drfits.annotation.RunMethod;
import com.drfits.transfer.Transfer;
import com.drfits.transfer.TransferExecutor;
import com.drfits.transfer.TransferExecutorImpl;
import com.drfits.transfer.TransferImpl;

import java.lang.invoke.LambdaMetafactory;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.lang.reflect.Method;
import java.util.function.Function;

/**
 * Application for execute annotated method
 */
public class App {

    public static void main(String[] args) {
        Transfer transfer = new TransferImpl("Hello, World!");
        Method[] methods = TransferExecutorImpl.class.getMethods();
        for (Method method : methods) {
            RunMethod annotation = method.getAnnotation(RunMethod.class);
            if (annotation != null) {
                try {
                    MethodHandles.Lookup lookup = MethodHandles.lookup();
                    MethodHandle methodHandle = lookup.unreflect(method);
                    MethodType invokedType = MethodType.methodType(Function.class);
                    MethodType functionMethodType = MethodType.methodType(method.getReturnType(), Transfer.class, Transfer.class);

                    // Lambda which can be executed
                    TransferExecutor transferExecutor= new TransferExecutorImpl();
                    Function<Transfer, Void> commonLambda = transferExecutor::execute;
                    commonLambda.apply(transfer);

                    // Lambda constructed manually
                    Function<Transfer, Void> constructedLambda = (Function) LambdaMetafactory.metafactory(
                            lookup,
                            "apply",
                            invokedType,
                            functionMethodType,
                            methodHandle,
                            methodHandle.type()).getTarget().invokeExact();
                    constructedLambda.apply(transfer);<commit_msg>Remove error in code<commit_after>package com.drfits;

import com.drfits.annotation.RunMethod;
import com.drfits.transfer.Transfer;
import com.drfits.transfer.TransferExecutor;
import com.drfits.transfer.TransferExecutorImpl;
import com.drfits.transfer.TransferImpl;

import java.lang.invoke.LambdaMetafactory;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.lang.reflect.Method;
import java.util.function.Function;

/**
 * Application for execute annotated method
 */
public class App {

    public static void main(String[] args) {
        Transfer transfer = new TransferImpl("Hello, World!");
        Method[] methods = TransferExecutorImpl.class.getMethods();
        for (Method method : methods) {
            RunMethod annotation = method.getAnnotation(RunMethod.class);
            if (annotation != null) {
                try {
                    MethodHandles.Lookup lookup = MethodHandles.lookup();
                    MethodHandle methodHandle = lookup.unreflect(method);
                    MethodType invokedType = MethodType.methodType(Function.class);
                    MethodType functionMethodType = MethodType.methodType(method.getReturnType(), method.getParameterTypes());

                    // Lambda which can be executed
                    TransferExecutor transferExecutor= new TransferExecutorImpl();
                    Function<Transfer, Void> commonLambda = transferExecutor::execute;
                    commonLambda.apply(transfer);

                    // Lambda constructed manually
                    Function<Transfer, Void> constructedLambda = (Function) LambdaMetafactory.metafactory(
                            lookup,
                            "apply",
                            invokedType,
                            functionMethodType,
                            methodHandle,
                            methodHandle.type()).getTarget().invokeExact();
                    constructedLambda.apply(transfer);
{'fraction_non_alphanumeric': 0.08384407943123315, 'fraction_numerical': 0.0, 'mean_word_length': 2.172628304821151, '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': '4991158', 'n_tokens_mistral': 936, 'n_tokens_neox': 887, 'n_words': 199}