Program: 78938
Project: 78938
Buggy source:
/** 
 * Loads the class with the specified <a href="#name">binary name</a>.  The default implementation of this method searches for classes in the following order: <p><ol> <li><p> Invoke   {@link #findLoadedClass(String)} to check if the classhas already been loaded.  </p></li> <li><p> Invoke the  {@link #loadClass(String) <tt>loadClass</tt>} methodon the parent class loader.  If the parent is <tt>null</tt> the class loader built-in to the virtual machine is used, instead.  </p></li> <li><p> Invoke the  {@link #findClass(String)} method to find theclass.  </p></li> </ol> <p> If the class was found using the above steps, and the <tt>resolve</tt> flag is true, this method will then invoke the  {@link #resolveClass(Class)} method on the resulting <tt>Class</tt> object.<p> Subclasses of <tt>ClassLoader</tt> are encouraged to override  {@link #findClass(String)}, rather than this method.  </p> <p> Unless overridden, this method synchronizes on the result of  {@link #getClassLoadingLock <tt>getClassLoadingLock</tt>} methodduring the entire class loading process.
 * @param name The <a href="#name">binary name</a> of the class
 * @param resolve If <tt>true</tt> then resolve the class
 * @return  The resulting <tt>Class</tt> object
 * @throws ClassNotFoundException If the class could not be found
 */
protected Class<?> loadClass(String name,boolean resolve) throws ClassNotFoundException {
synchronized (getClassLoadingLock(name)) {
    Class<?> c=findLoadedClass(name);
    if (c == null) {
      long t0=System.nanoTime();
      try {
        if (parent != null) {
          c=parent.loadClass(name,false);
        }
 else {
          c=findBootstrapClassOrNull(name);
        }
      }
 catch (      ClassNotFoundException e) {
      }
      if (c == null) {
        long t1=System.nanoTime();
        c=findClass(name);
        sun.misc.PerfCounter.getParentDelegationTime().addTime(t1 - t0);
        sun.misc.PerfCounter.getFindClassTime().addElapsedTimeFrom(t1);
        sun.misc.PerfCounter.getFindClasses().increment();
      }
    }
    if (resolve) {
      resolveClass(c);
    }
    return c;
  }
}

Fixed version (ground truth):
/** 
 * Loads the class with the specified <a href="#name">binary name</a>.  The default implementation of this method searches for classes in the following order: <ol> <li><p> Invoke   {@link #findLoadedClass(String)} to check if the classhas already been loaded.  </p></li> <li><p> Invoke the  {@link #loadClass(String) <tt>loadClass</tt>} methodon the parent class loader.  If the parent is <tt>null</tt> the class loader built-in to the virtual machine is used, instead.  </p></li> <li><p> Invoke the  {@link #findClass(String)} method to find theclass.  </p></li> </ol> <p> If the class was found using the above steps, and the <tt>resolve</tt> flag is true, this method will then invoke the  {@link #resolveClass(Class)} method on the resulting <tt>Class</tt> object.<p> Subclasses of <tt>ClassLoader</tt> are encouraged to override  {@link #findClass(String)}, rather than this method.  </p> <p> Unless overridden, this method synchronizes on the result of  {@link #getClassLoadingLock <tt>getClassLoadingLock</tt>} methodduring the entire class loading process.
 * @param name The <a href="#name">binary name</a> of the class
 * @param resolve If <tt>true</tt> then resolve the class
 * @return  The resulting <tt>Class</tt> object
 * @throws ClassNotFoundException If the class could not be found
 */
protected Class<?> loadClass(String name,boolean resolve) throws ClassNotFoundException {
synchronized (getClassLoadingLock(name)) {
    Class<?> c=findLoadedClass(name);
    if (c == null) {
      long t0=System.nanoTime();
      try {
        if (parent != null) {
          c=parent.loadClass(name,false);
        }
 else {
          c=findBootstrapClassOrNull(name);
        }
      }
 catch (      ClassNotFoundException e) {
      }
      if (c == null) {
        long t1=System.nanoTime();
        c=findClass(name);
        sun.misc.PerfCounter.getParentDelegationTime().addTime(t1 - t0);
        sun.misc.PerfCounter.getFindClassTime().addElapsedTimeFrom(t1);
        sun.misc.PerfCounter.getFindClasses().increment();
      }
    }
    if (resolve) {
      resolveClass(c);
    }
    return c;
  }
}