<commit_before>/*
 * Test for ClassLoader
 *
 * Tests simple call of defineClass and various error conditions resulting
 * from repeated calls to defineClass
 *
 * Written by <NAME> <<EMAIL>>
 */
import java.io.File;
import java.io.FileInputStream;

public class CLTest extends ClassLoader
{
    protected synchronized Class loadClass(String name, boolean resolve)
	throws ClassNotFoundException
    {
	Class c = findSystemClass(name);
	if (resolve)
	    resolveClass(c);
	return c;
    }

    /*
     * read a .class file
     */
    static byte [] readin(String name) throws Exception
    {
	File cf = new File(name);
	FileInputStream cfi = new FileInputStream(cf);

	int len = (int)cf.length();
	byte [] cb = new byte[len];
	if (cfi.read(cb) != len)
	    throw new Exception("short read for " + name);
	return cb; 
    }
    
    /*
     * load class using 4 parameter interface
     */
    Class doit4(String name, byte [] cb) throws Exception
    {
	return defineClass(name, cb, 0, cb.length);
    }

    /*
     * load class using 3 parameter interface
     */
    Class doit3(byte [] cb) throws Exception
    {
	return defineClass(cb, 0, cb.length);
    }

    public static void main(String []av) throws Exception
    {
	String secondName = "b";

	CLTest mcl = new CLTest();
	Class a = null;<commit_msg>* Don't use deprecated version of defineClass.<commit_after>/*
 * Test for ClassLoader
 *
 * Tests simple call of defineClass and various error conditions resulting
 * from repeated calls to defineClass
 *
 * Written by <NAME> <<EMAIL>>
 */
import java.io.File;
import java.io.FileInputStream;

public class CLTest extends ClassLoader
{
    protected synchronized Class loadClass(String name, boolean resolve)
	throws ClassNotFoundException
    {
	Class c = findSystemClass(name);
	if (resolve)
	    resolveClass(c);
	return c;
    }

    /*
     * read a .class file
     */
    static byte [] readin(String name) throws Exception
    {
	File cf = new File(name);
	FileInputStream cfi = new FileInputStream(cf);

	int len = (int)cf.length();
	byte [] cb = new byte[len];
	if (cfi.read(cb) != len)
	    throw new Exception("short read for " + name);
	return cb; 
    }
    
    /*
     * load class using 4 parameter interface
     */
    Class doit4(String name, byte [] cb) throws Exception
    {
	return defineClass(name, cb, 0, cb.length);
    }

    /*
     * load class using 3 parameter interface
     */
    Class doit3(byte [] cb) throws Exception
    {
	return defineClass(null, cb, 0, cb.length);
    }

    public static void main(String []av) throws Exception
    {
	String secondName = "b";

	CLTest mcl = new CLTest();
	Class a = null;
{'fraction_non_alphanumeric': 0.10597519729425028, 'fraction_numerical': 0.004509582863585118, 'mean_word_length': 2.93205317577548, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '3683863', 'n_tokens_mistral': 821, 'n_tokens_neox': 791, 'n_words': 276}