<commit_before>package com.redhat.ceylon.test.eclipse.plugin.runner;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

import ceylon.language.Callable;

public class TestCallable implements Callable<Object> {

    private String ceylonQualifiedName;

    public TestCallable(String ceylonQualifiedName) {
        this.ceylonQualifiedName = ceylonQualifiedName;
    }

    @Override
    public Object $call() {
        try {
            int pkgSeparatorIndex = ceylonQualifiedName.indexOf("::");
            int methodSeparatorIndex = ceylonQualifiedName.indexOf(".", pkgSeparatorIndex);

            String testClassName;
            String testMethodName;

            if (methodSeparatorIndex == -1) {
                testClassName = ceylonQualifiedName.replaceAll("::", ".") + "_";
                testMethodName = ceylonQualifiedName.substring(pkgSeparatorIndex + 2);
            } else {
                testClassName = ceylonQualifiedName.substring(0, methodSeparatorIndex).replaceAll("::", ".");
                testMethodName = ceylonQualifiedName.substring(methodSeparatorIndex + 1);
            }

            Class<?> testClazz = Class.forName(testClassName);
            Method method = testClazz.getDeclaredMethod(testMethodName, new Class[] {});
            method.setAccessible(true);
            if (methodSeparatorIndex == -1) {
                method.invoke(null, new Object[] {});
            } else {
                Constructor<?> constructor = testClazz.getDeclaredConstructor(new Class<?>[]{});
                constructor.setAccessible(true);
                Object instance = constructor.newInstance((Object[])null);
                method.invoke(instance, new Object[] {});                
            }
        } catch (InvocationTargetException e) {
            if(e.getTargetException() instanceof RuntimeException)
            	throw (RuntimeException)e.getTargetException();
            else
            	throw new RuntimeException(e.getTargetException());
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        
        return null;
    }

    @Override
    public Object $call(Object arg0) {
        return $call();
    }

    @Override
    public Object $call(Object... arg0) {
        return $call();
    }

    @Override
    public Object $call(Object arg0, Object arg1) {
        return $call();
    }

    @Override
    public Object $call(Object arg0, Object arg1, Object arg2) {
        return $call();
    }

	@Override
	public short $getVariadicParameterIndex() {
		return -1;
	}

}<commit_msg>fix. ceylon test plugin<commit_after>package com.redhat.ceylon.test.eclipse.plugin.runner;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

import ceylon.language.Callable;
import ceylon.language.Sequential;

public class TestCallable implements Callable<Object> {

    private String ceylonQualifiedName;

    public TestCallable(String ceylonQualifiedName) {
        this.ceylonQualifiedName = ceylonQualifiedName;
    }

    @Override
    public Object $call() {
        try {
            int pkgSeparatorIndex = ceylonQualifiedName.indexOf("::");
            int methodSeparatorIndex = ceylonQualifiedName.indexOf(".", pkgSeparatorIndex);

            String testClassName;
            String testMethodName;

            if (methodSeparatorIndex == -1) {
                testClassName = ceylonQualifiedName.replaceAll("::", ".") + "_";
                testMethodName = ceylonQualifiedName.substring(pkgSeparatorIndex + 2);
            } else {
                testClassName = ceylonQualifiedName.substring(0, methodSeparatorIndex).replaceAll("::", ".");
                testMethodName = ceylonQualifiedName.substring(methodSeparatorIndex + 1);
            }

            Class<?> testClazz = Class.forName(testClassName);
            Method method = testClazz.getDeclaredMethod(testMethodName, new Class[] {});
            method.setAccessible(true);
            if (methodSeparatorIndex == -1) {
                method.invoke(null, new Object[] {});
            } else {
                Constructor<?> constructor = testClazz.getDeclaredConstructor(new Class<?>[] {});
                constructor.setAccessible(true);
                Object instance = constructor.newInstance((Object[]) null);
                method.invoke(instance, new Object[] {});
            }
        } catch (InvocationTargetException e) {
            if (e.getTargetException() instanceof RuntimeException)
                throw (RuntimeException) e.getTargetException();
            else
                throw new RuntimeException(e.getTargetException());
        } catch (Exception e) {
            throw new RuntimeException(e);
        }

        return null;
    }

    @Override
    public Object $call(Object arg0) {
        return $call();
    }

    @Override
    public Object $call(Object... arg0) {
        return $call();
    }

    @Override
    public Object $call(Object arg0, Object arg1) {
        return $call();
    }

    @Override
    public Object $call(Object arg0, Object arg1, Object arg2) {
        return $call();
    }

    @Override
    public short $getVariadicParameterIndex() {
        return -1;
    }

    @Override
    public Object $call$variadic() {
        return $call();
    }

    @Override
    public Object $call$variadic(Sequential<?> arg0) {
        return $call();
    }

    @Override
    public Object $call$variadic(Object arg0) {
        return $call();
    }

    @Override
    public Object $call$variadic(Object... arg0) {
        return $call();
    }

    @Override
    public Object $call$variadic(Object arg0, Sequential<?> arg1) {
        return $call();
    }

    @Override
    public Object $call$variadic(Object arg0, Object arg1) {
        return $call();
    }

    @Override
    public Object $call$variadic(Object arg0, Object arg1, Sequential<?> arg2) {
        return $call();
    }

    @Override
    public Object $call$variadic(Object arg0, Object arg1, Object arg2) {
        return $call();
    }

    @Override
    public Object $call$variadic(Object arg0, Object arg1, Object arg2, Sequential<?> arg3) {
        return $call();
    }

}
{'fraction_non_alphanumeric': 0.10842038619816398, 'fraction_numerical': 0.006805951250395695, 'mean_word_length': 2.3398520084566594, 'pattern_counts': {'":': 6, '<': 15, '<?xml version=': 0, '>': 15, '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': '146495', 'n_tokens_mistral': 1741, 'n_tokens_neox': 1671, 'n_words': 370}