Program: 27285
Project: 27285
Buggy source:
/** 
 * Loads the class with the specified binary name prioritized by the "parent-first" condition. It copy-cats   {@code ClassLoader#loadClass} while the "parent-first" priorities are considered.If the specified class is "parent-first", it behaves the same as  {@code ClassLoader#loadClass} ordered as below.<ol> <li><p>Invoke the  {@code #findLoadedClass} method to check if the class has already been loaded.</p></li><li><p>Invoke the parent's  {@code #loadClass} method.<li><p>Invoke the  {@code #findClass} method of this class loader to find the class.</p></li></ol> If the specified class is "NOT parent-first", the 2nd and 3rd actions are swapped.
 * @see https://docs.oracle.com/javase/7/docs/api/java/lang/ClassLoader.html#loadClass(java.lang.String,%20boolean)
 * @see http://hg.openjdk.java.net/jdk7u/jdk7u/jdk/file/jdk7u141-b02/src/share/classes/java/lang/ClassLoader.java
 */
@Override protected Class<?> loadClass(String name,boolean resolve) throws ClassNotFoundException {
synchronized (getClassLoadingLock(name)) {
    final Class<?> loadedClass=findLoadedClass(name);
    if (loadedClass != null) {
      return resolveClass(loadedClass,resolve);
    }
    final boolean parentFirst=isParentFirstPackage(name);
    if (!parentFirst) {
      try {
        return resolveClass(findClass(name),resolve);
      }
 catch (      ClassNotFoundException ignored) {
      }
    }
    try {
      return resolveClass(getParent().loadClass(name),resolve);
    }
 catch (    ClassNotFoundException ignored) {
    }
    if (parentFirst) {
      return resolveClass(findClass(name),resolve);
    }
    throw new ClassNotFoundException(name);
  }
}

Fixed version (ground truth):
/** 
 * Loads the class with the specified binary name prioritized by the "parent-first" condition. It copy-cats   {@code ClassLoader#loadClass} while the "parent-first" priorities are considered.If the specified class is "parent-first", it behaves the same as  {@code ClassLoader#loadClass} ordered as below.<ol> <li><p>Invoke the  {@code #findLoadedClass} method to check if the class has already been loaded.</p></li><li><p>Invoke the parent's  {@code #loadClass} method.<li><p>Invoke the  {@code #findClass} method of this class loader to find the class.</p></li></ol> If the specified class is "NOT parent-first", the 2nd and 3rd actions are swapped.
 * @see <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/ClassLoader.html#loadClass(java.lang.String,%20boolean)">Oracle Java7's ClassLoader#loadClass</a>
 * @see <a href="http://hg.openjdk.java.net/jdk7u/jdk7u/jdk/file/jdk7u141-b02/src/share/classes/java/lang/ClassLoader.java">OpenJDK7's ClassLoader</a>
 */
@Override protected Class<?> loadClass(String name,boolean resolve) throws ClassNotFoundException {
synchronized (getClassLoadingLock(name)) {
    final Class<?> loadedClass=findLoadedClass(name);
    if (loadedClass != null) {
      return resolveClass(loadedClass,resolve);
    }
    final boolean parentFirst=isParentFirstPackage(name);
    if (!parentFirst) {
      try {
        return resolveClass(findClass(name),resolve);
      }
 catch (      ClassNotFoundException ignored) {
      }
    }
    try {
      return resolveClass(getParent().loadClass(name),resolve);
    }
 catch (    ClassNotFoundException ignored) {
    }
    if (parentFirst) {
      return resolveClass(findClass(name),resolve);
    }
    throw new ClassNotFoundException(name);
  }
}