Program: 54662
Project: 54662
Buggy source:
/** 
 * Load the class with the specified name, searching using the following algorithm until it finds and returns the class.  If the class cannot be found, returns <code>ClassNotFoundException</code>. <ul> <li>Call <code>findLoadedClass(String)</code> to check if the class has already been loaded.  If it has, the same <code>Class</code> object is returned.</li> <li>If the <code>delegate</code> property is set to <code>true</code>, call the <code>loadClass()</code> method of the parent class loader, if any.</li> <li>Call <code>findClass()</code> to find this class in our locally defined repositories.</li> <li>Call the <code>loadClass()</code> method of our parent class loader, if any.</li> </ul> If the class was found using the above steps, and the <code>resolve</code> flag is <code>true</code>, this method will then call <code>resolveClass(Class)</code> on the resulting Class object.
 * @param name Name of the class to be loaded
 * @param resolve If <code>true</code> then resolve the class
 * @exception ClassNotFoundException if the class was not found
 */
public Class loadClass(String name,boolean resolve) throws ClassNotFoundException {
  if (log.isDebugEnabled())   log.debug("String_Node_Str" + name + "String_Node_Str"+ resolve+ "String_Node_Str");
  Class clazz=null;
  if (!started) {
    log.info(sm.getString("String_Node_Str"));
    throw new ThreadDeath();
  }
  clazz=findLoadedClass0(name);
  if (clazz != null) {
    if (log.isDebugEnabled())     log.debug("String_Node_Str");
    if (resolve)     resolveClass(clazz);
    return (clazz);
  }
  clazz=findLoadedClass(name);
  if (clazz != null) {
    if (log.isDebugEnabled())     log.debug("String_Node_Str");
    if (resolve)     resolveClass(clazz);
    return (clazz);
  }
  try {
    clazz=system.loadClass(name);
    if (clazz != null) {
      if (resolve)       resolveClass(clazz);
      return (clazz);
    }
  }
 catch (  ClassNotFoundException e) {
  }
  if (securityManager != null) {
    int i=name.lastIndexOf('.');
    if (i >= 0) {
      try {
        securityManager.checkPackageAccess(name.substring(0,i));
      }
 catch (      SecurityException se) {
        String error="String_Node_Str" + "String_Node_Str" + name;
        log.info(error,se);
        throw new ClassNotFoundException(error,se);
      }
    }
  }
  boolean delegateLoad=delegate || filter(name);
  if (delegateLoad) {
    if (log.isDebugEnabled())     log.debug("String_Node_Str" + parent);
    ClassLoader loader=parent;
    if (loader == null)     loader=system;
    try {
      clazz=loader.loadClass(name);
      if (clazz != null) {
        if (log.isDebugEnabled())         log.debug("String_Node_Str");
        if (resolve)         resolveClass(clazz);
        return (clazz);
      }
    }
 catch (    ClassNotFoundException e) {
      ;
    }
  }
  if (log.isDebugEnabled())   log.debug("String_Node_Str");
  try {
    clazz=findClass(name);
    if (clazz != null) {
      if (log.isDebugEnabled())       log.debug("String_Node_Str");
      if (resolve)       resolveClass(clazz);
      return (clazz);
    }
  }
 catch (  ClassNotFoundException e) {
    ;
  }
  if (!delegateLoad) {
    if (log.isDebugEnabled())     log.debug("String_Node_Str" + parent);
    ClassLoader loader=parent;
    if (loader == null)     loader=system;
    try {
      clazz=loader.loadClass(name);
      if (clazz != null) {
        if (log.isDebugEnabled())         log.debug("String_Node_Str");
        if (resolve)         resolveClass(clazz);
        return (clazz);
      }
    }
 catch (    ClassNotFoundException e) {
      ;
    }
  }
  throw new ClassNotFoundException(name);
}

Fixed version (ground truth):
/** 
 * Load the class with the specified name, searching using the following algorithm until it finds and returns the class.  If the class cannot be found, returns <code>ClassNotFoundException</code>. <ul> <li>Call <code>findLoadedClass(String)</code> to check if the class has already been loaded.  If it has, the same <code>Class</code> object is returned.</li> <li>If the <code>delegate</code> property is set to <code>true</code>, call the <code>loadClass()</code> method of the parent class loader, if any.</li> <li>Call <code>findClass()</code> to find this class in our locally defined repositories.</li> <li>Call the <code>loadClass()</code> method of our parent class loader, if any.</li> </ul> If the class was found using the above steps, and the <code>resolve</code> flag is <code>true</code>, this method will then call <code>resolveClass(Class)</code> on the resulting Class object.
 * @param name Name of the class to be loaded
 * @param resolve If <code>true</code> then resolve the class
 * @exception ClassNotFoundException if the class was not found
 */
public Class loadClass(String name,boolean resolve) throws ClassNotFoundException {
  if (log.isDebugEnabled())   log.debug("String_Node_Str" + name + "String_Node_Str"+ resolve+ "String_Node_Str");
  Class clazz=null;
  if (!started) {
    log.info(sm.getString("String_Node_Str"));
    throw new ThreadDeath();
  }
  clazz=findLoadedClass0(name);
  if (clazz != null) {
    if (log.isDebugEnabled())     log.debug("String_Node_Str");
    if (resolve)     resolveClass(clazz);
    return (clazz);
  }
  clazz=findLoadedClass(name);
  if (clazz != null) {
    if (log.isDebugEnabled())     log.debug("String_Node_Str");
    if (resolve)     resolveClass(clazz);
    return (clazz);
  }
  try {
    clazz=Class.forName(name,false,null);
    if (clazz != null) {
      if (resolve)       resolveClass(clazz);
      return (clazz);
    }
  }
 catch (  ClassNotFoundException e) {
  }
  if (securityManager != null) {
    int i=name.lastIndexOf('.');
    if (i >= 0) {
      try {
        securityManager.checkPackageAccess(name.substring(0,i));
      }
 catch (      SecurityException se) {
        String error="String_Node_Str" + "String_Node_Str" + name;
        log.info(error,se);
        throw new ClassNotFoundException(error,se);
      }
    }
  }
  boolean delegateLoad=delegate || filter(name);
  if (delegateLoad) {
    if (log.isDebugEnabled())     log.debug("String_Node_Str" + parent);
    ClassLoader loader=parent;
    if (loader == null)     loader=system;
    try {
      clazz=loader.loadClass(name);
      if (clazz != null) {
        if (log.isDebugEnabled())         log.debug("String_Node_Str");
        if (resolve)         resolveClass(clazz);
        return (clazz);
      }
    }
 catch (    ClassNotFoundException e) {
      ;
    }
  }
  if (log.isDebugEnabled())   log.debug("String_Node_Str");
  try {
    clazz=findClass(name);
    if (clazz != null) {
      if (log.isDebugEnabled())       log.debug("String_Node_Str");
      if (resolve)       resolveClass(clazz);
      return (clazz);
    }
  }
 catch (  ClassNotFoundException e) {
    ;
  }
  if (!delegateLoad) {
    if (log.isDebugEnabled())     log.debug("String_Node_Str" + parent);
    ClassLoader loader=parent;
    if (loader == null)     loader=system;
    try {
      clazz=loader.loadClass(name);
      if (clazz != null) {
        if (log.isDebugEnabled())         log.debug("String_Node_Str");
        if (resolve)         resolveClass(clazz);
        return (clazz);
      }
    }
 catch (    ClassNotFoundException e) {
      ;
    }
  }
  throw new ClassNotFoundException(name);
}