<commit_before>/**
 * 
 */
package org.junit.internal.requests;

import java.lang.reflect.Constructor;

import org.junit.internal.runners.OldTestClassRunner;
import org.junit.internal.runners.TestClassRunner;
import org.junit.runner.Request;
import org.junit.runner.RunWith;
import org.junit.runner.Runner;

public class ClassRequest extends Request {
	private final Class<?> fTestClass;

	public ClassRequest(Class<?> each) {
		fTestClass= each;
	}
	
	@Override
	public Runner getRunner() {
		Class runnerClass= getRunnerClass(fTestClass);
		try {
			Constructor constructor= runnerClass.getConstructor(Class.class); // TODO good error message if no such constructor
			Runner runner= (Runner) constructor
					.newInstance(new Object[] { fTestClass });
			return runner;
		} catch (Exception e) {
			return Request.errorReport(fTestClass, e).getRunner();
		}
	}

	Class getRunnerClass(Class<?> testClass) {
		RunWith annotation= testClass.getAnnotation(RunWith.class);
		if (annotation != null) {
			return annotation.value();
		} else if (isPre4Test(testClass)) {
			return OldTestClassRunner.class; 
		} else {
			return TestClassRunner.class;
		}
	}
	
	boolean isPre4Test(Class<?> testClass) {
		return junit.framework.TestCase.class.isAssignableFrom(testClass);
	}
}<commit_msg>*** empty log message ***<commit_after>package org.junit.internal.requests;

import java.lang.reflect.Constructor;

import org.junit.internal.runners.OldTestClassRunner;
import org.junit.internal.runners.TestClassRunner;
import org.junit.runner.Request;
import org.junit.runner.RunWith;
import org.junit.runner.Runner;

public class ClassRequest extends Request {
	private final Class<?> fTestClass;

	public ClassRequest(Class<?> each) {
		fTestClass= each;
	}
	
	@Override
	public Runner getRunner() {
		Class runnerClass= getRunnerClass(fTestClass);
		try {
			Constructor constructor= runnerClass.getConstructor(Class.class); // TODO good error message if no such constructor
			Runner runner= (Runner) constructor
					.newInstance(new Object[] { fTestClass });
			return runner;
		} catch (Exception e) {
			return Request.errorReport(fTestClass, e).getRunner();
		}
	}

	Class getRunnerClass(Class<?> testClass) {
		RunWith annotation= testClass.getAnnotation(RunWith.class);
		if (annotation != null) {
			return annotation.value();
		} else if (isPre4Test(testClass)) {
			return OldTestClassRunner.class; 
		} else {
			return TestClassRunner.class;
		}
	}
	
	boolean isPre4Test(Class<?> testClass) {
		return junit.framework.TestCase.class.isAssignableFrom(testClass);
	}
}
{'fraction_non_alphanumeric': 0.11370716510903427, 'fraction_numerical': 0.001557632398753894, 'mean_word_length': 4.773033707865168, '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': '1206365', 'n_tokens_mistral': 842, 'n_tokens_neox': 771, 'n_words': 177}