Program: 29757
Project: 29757
Buggy source:
/** 
 * Create and return a new class loader, based on the configuration defaults and the specified directory paths:
 * @param unpacked Array of pathnames to unpacked directories that shouldbe added to the repositories of the class loader, or <code>null</code>  for no unpacked directories to be considered
 * @param packed Array of pathnames to directories containing JAR filesthat should be added to the repositories of the class loader,  or <code>null</code> for no directories of JAR files to be considered
 * @param urls Array of URLs to remote repositories, designing either JAR resources or uncompressed directories that should be added to  the repositories of the class loader, or <code>null</code> for no  directories of JAR files to be considered
 * @param parent Parent class loader for the new class loader, or<code>null</code> for the system class loader.
 * @exception Exception if an error occurs constructing the class loader
 */
public static ClassLoader createClassLoader(File unpacked[],File packed[],URL urls[],ClassLoader parent) throws Exception {
  if (log.isLoggable(Level.FINE))   log.fine("String_Node_Str");
  Set<URL> set=new LinkedHashSet<URL>();
  if (unpacked != null) {
    for (int i=0; i < unpacked.length; i++) {
      File file=unpacked[i];
      if (!file.exists() || !file.canRead())       continue;
      if (log.isLoggable(Level.FINE))       log.fine("String_Node_Str" + file.getAbsolutePath());
      URL url=new URL("String_Node_Str",null,file.getCanonicalPath() + File.separator);
      set.add(url);
    }
  }
  if (packed != null) {
    for (int i=0; i < packed.length; i++) {
      File directory=packed[i];
      if (!directory.isDirectory() || !directory.exists() || !directory.canRead())       continue;
      String filenames[]=directory.list();
      for (int j=0; j < filenames.length; j++) {
        String filename=filenames[j].toLowerCase(Locale.ENGLISH);
        if (!filename.endsWith("String_Node_Str"))         continue;
        File file=new File(directory,filenames[j]);
        if (log.isLoggable(Level.FINE))         log.fine("String_Node_Str" + file.getAbsolutePath());
        URL url=new URL("String_Node_Str",null,file.getCanonicalPath());
        set.add(url);
      }
    }
  }
  if (urls != null) {
    for (int i=0; i < urls.length; i++) {
      set.add(urls[i]);
    }
  }
  URL array[]=set.toArray(new URL[set.size()]);
  StandardClassLoader classLoader=null;
  if (parent == null)   classLoader=new StandardClassLoader(array);
 else   classLoader=new StandardClassLoader(array,parent);
  classLoader.setDelegate(true);
  return (classLoader);
}

Fixed version (ground truth):
/** 
 * Create and return a new class loader, based on the configuration defaults and the specified directory paths:
 * @param unpacked Array of pathnames to unpacked directories that shouldbe added to the repositories of the class loader, or <code>null</code>  for no unpacked directories to be considered
 * @param packed Array of pathnames to directories containing JAR filesthat should be added to the repositories of the class loader,  or <code>null</code> for no directories of JAR files to be considered
 * @param urls Array of URLs to remote repositories, designing either JAR resources or uncompressed directories that should be added to  the repositories of the class loader, or <code>null</code> for no  directories of JAR files to be considered
 * @param parent Parent class loader for the new class loader, or<code>null</code> for the system class loader.
 * @exception Exception if an error occurs constructing the class loader
 */
public static ClassLoader createClassLoader(File unpacked[],File packed[],URL urls[],ClassLoader parent) throws Exception {
  if (log.isLoggable(Level.FINE))   log.fine("String_Node_Str");
  Set<URL> set=new LinkedHashSet<URL>();
  if (unpacked != null) {
    for (int i=0; i < unpacked.length; i++) {
      File file=unpacked[i];
      if (!file.exists() || !file.canRead())       continue;
      if (log.isLoggable(Level.FINE))       log.fine("String_Node_Str" + file.getAbsolutePath());
      URL url=new URL("String_Node_Str",null,file.getCanonicalPath() + File.separator);
      set.add(url);
    }
  }
  if (packed != null) {
    for (int i=0; i < packed.length; i++) {
      File directory=packed[i];
      if (!directory.isDirectory() || !directory.exists() || !directory.canRead())       continue;
      String filenames[]=directory.list();
      for (int j=0; j < filenames.length; j++) {
        String filename=filenames[j].toLowerCase(Locale.ENGLISH);
        if (!filename.endsWith("String_Node_Str"))         continue;
        File file=new File(directory,filenames[j]);
        if (log.isLoggable(Level.FINE))         log.fine("String_Node_Str" + file.getAbsolutePath());
        URL url=new URL("String_Node_Str",null,file.getCanonicalPath());
        set.add(url);
      }
    }
  }
  if (urls != null) {
    for (int i=0; i < urls.length; i++) {
      set.add(urls[i]);
    }
  }
  final URL array[]=set.toArray(new URL[set.size()]);
  final ClassLoader parentCL=parent;
  StandardClassLoader classLoader=null;
  if (parentCL == null) {
    classLoader=AccessController.doPrivileged(new PrivilegedAction<StandardClassLoader>(){
      @Override public StandardClassLoader run(){
        return new StandardClassLoader(array);
      }
    }
);
  }
 else {
    classLoader=AccessController.doPrivileged(new PrivilegedAction<StandardClassLoader>(){
      @Override public StandardClassLoader run(){
        return new StandardClassLoader(array,parentCL);
      }
    }
);
  }
  classLoader.setDelegate(true);
  return (classLoader);
}