<commit_before>/*
 * Copyright (c) 2006-2014 <NAME>
 * This file is subject to the terms of the MIT license (see LICENSE.txt).
 */
package mockit;

import java.io.*;
import java.lang.reflect.*;
import java.net.*;
import javax.naming.*;

import org.junit.*;
import static org.junit.Assert.*;

public final class CustomClassLoadingTest
{
   static final class IsolatedClassLoader extends URLClassLoader
   {
      private final ClassLoader systemCL = ClassLoader.getSystemClassLoader();

      IsolatedClassLoader() throws MalformedURLException
      {
         super(
            new URL[] {
               new URL("file:///github/jmockit1.org/jmockit.jar"),
               new URL("file:lib/junit-dep-4.11.jar"), new URL("file:lib/hamcrest-core-1.2.jar"),
               new URL("file:main/test-classes/")
            },
            null);
      }

      @Override
      public Class<?> loadClass(String name) throws ClassNotFoundException
      {
         Class<?> c = findLoadedClass(name);

         if (c == null) {
            try { c = findClass(name); } catch (ClassNotFoundException ignore) { c = systemCL.loadClass(name); }
         }

         return c;
      }
   }

   public static void main(String[] args) throws Exception
   {
      ClassLoader cl = new IsolatedClassLoader();
      Class<?> jUnitCoreClass = cl.loadClass("org.junit.runner.JUnitCore");
      Class<?> runListenerClass = cl.loadClass("org.junit.runner.notification.RunListener");
      Class<?> textListenerClass = cl.loadClass("org.junit.internal.TextListener");
      Class<?> testClass = cl.loadClass(CustomClassLoadingTest.class.getName());<commit_msg>Updated hard-coded dependency on JUnit jar, in special test class.<commit_after>/*
 * Copyright (c) 2006-2015 <NAME>
 * This file is subject to the terms of the MIT license (see LICENSE.txt).
 */
package mockit;

import java.io.*;
import java.lang.reflect.*;
import java.net.*;
import javax.naming.*;

import org.junit.*;
import static org.junit.Assert.*;

public final class CustomClassLoadingTest
{
   static final class IsolatedClassLoader extends URLClassLoader
   {
      private final ClassLoader systemCL = ClassLoader.getSystemClassLoader();

      IsolatedClassLoader() throws MalformedURLException
      {
         super(
            new URL[] {
               new URL("file:///github/jmockit1.org/jmockit.jar"),
               new URL("file:lib/junit-4.12.jar"), new URL("file:lib/hamcrest-core-1.2.jar"),
               new URL("file:main/test-classes/")
            },
            null);
      }

      @Override
      public Class<?> loadClass(String name) throws ClassNotFoundException
      {
         Class<?> c = findLoadedClass(name);

         if (c == null) {
            try { c = findClass(name); } catch (ClassNotFoundException ignore) { c = systemCL.loadClass(name); }
         }

         return c;
      }
   }

   public static void main(String[] args) throws Exception
   {
      ClassLoader cl = new IsolatedClassLoader();
      Class<?> jUnitCoreClass = cl.loadClass("org.junit.runner.JUnitCore");
      Class<?> runListenerClass = cl.loadClass("org.junit.runner.notification.RunListener");
      Class<?> textListenerClass = cl.loadClass("org.junit.internal.TextListener");
      Class<?> testClass = cl.loadClass(CustomClassLoadingTest.class.getName());
{'fraction_non_alphanumeric': 0.124586217273548, 'fraction_numerical': 0.00842612097502257, 'mean_word_length': 2.7644394110985275, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '1205425', 'n_tokens_mistral': 949, 'n_tokens_neox': 927, 'n_words': 226}