Program: 28979
Project: 28979
Buggy source:
@Override public ClassLoader getClassLoader(final ClassLoader parent,DeploymentContext context){
  WebappClassLoader cloader=AccessController.doPrivileged(new PrivilegedAction<WebappClassLoader>(){
    @Override public WebappClassLoader run(){
      return new WebappClassLoader(parent);
    }
  }
);
  try {
    FileDirContext r=new FileDirContext();
    File base=new File(context.getSource().getURI());
    r.setDocBase(base.getAbsolutePath());
    cloader.setResources(r);
    cloader.addRepository("String_Node_Str",new File(base,"String_Node_Str"));
    if (context.getScratchDir("String_Node_Str") != null) {
      cloader.addRepository(context.getScratchDir("String_Node_Str").toURI().toURL().toString().concat("String_Node_Str"));
    }
    if (context.getScratchDir("String_Node_Str") != null) {
      cloader.setWorkDir(context.getScratchDir("String_Node_Str"));
    }
    for (    URL url : getManifestLibraries(context)) {
      cloader.addRepository(url.toString());
    }
    WebXmlParser webXmlParser=null;
    boolean hasWSLDD=(new File(base,WEBLOGIC_XML)).exists();
    if (!gfDDOverWLSDD && !ignoreWLSDD && hasWSLDD) {
      webXmlParser=new WeblogicXmlParser(base.getAbsolutePath());
    }
 else     if ((new File(base,GLASSFISH_WEB_XML)).exists()) {
      webXmlParser=new GlassFishWebXmlParser(base.getAbsolutePath());
    }
 else     if ((new File(base,SUN_WEB_XML)).exists()) {
      webXmlParser=new SunWebXmlParser(base.getAbsolutePath());
    }
 else     if (gfDDOverWLSDD && !ignoreWLSDD && hasWSLDD) {
      webXmlParser=new WeblogicXmlParser(base.getAbsolutePath());
    }
 else {
      if (gfDDOverWLSDD || ignoreWLSDD) {
        webXmlParser=new GlassFishWebXmlParser(base.getAbsolutePath());
      }
 else {
        webXmlParser=new WeblogicXmlParser(base.getAbsolutePath());
      }
    }
    configureLoaderAttributes(cloader,webXmlParser,base);
    configureLoaderProperties(cloader,webXmlParser,base);
    configureContextXmlAttribute(cloader,base,context);
  }
 catch (  MalformedURLException malex) {
    logger.log(Level.SEVERE,malex.getMessage());
    if (logger.isLoggable(Level.FINE)) {
      logger.log(Level.FINE,malex.getMessage(),malex);
    }
  }
catch (  XMLStreamException xse) {
    logger.log(Level.SEVERE,xse.getMessage());
    if (logger.isLoggable(Level.FINE)) {
      logger.log(Level.FINE,xse.getMessage(),xse);
    }
  }
catch (  FileNotFoundException fnfe) {
    logger.log(Level.SEVERE,fnfe.getMessage());
    if (logger.isLoggable(Level.FINE)) {
      logger.log(Level.FINE,fnfe.getMessage(),fnfe);
    }
  }
  cloader.start();
  return cloader;
}

Fixed version (ground truth):
@Override public ClassLoader getClassLoader(final ClassLoader parent,DeploymentContext context){
  WebappClassLoader cloader=AccessController.doPrivileged(new PrivilegedAction<WebappClassLoader>(){
    @Override public WebappClassLoader run(){
      return new WebappClassLoader(parent);
    }
  }
);
  try {
    FileDirContext r=new FileDirContext();
    File base=new File(context.getSource().getURI());
    r.setDocBase(base.getAbsolutePath());
    cloader.setResources(r);
    cloader.addRepository("String_Node_Str",new File(base,"String_Node_Str"));
    if (context.getScratchDir("String_Node_Str") != null) {
      cloader.addRepository(context.getScratchDir("String_Node_Str").toURI().toURL().toString().concat("String_Node_Str"));
    }
    if (context.getScratchDir("String_Node_Str") != null) {
      cloader.setWorkDir(context.getScratchDir("String_Node_Str"));
    }
    for (    URL url : getManifestLibraries(context)) {
      cloader.addRepository(url.toString());
    }
    WebXmlParser webXmlParser=getWebXmlParser(context.getSource());
    configureLoaderAttributes(cloader,webXmlParser,base);
    configureLoaderProperties(cloader,webXmlParser,base);
    configureContextXmlAttribute(cloader,base,context);
  }
 catch (  XMLStreamException xse) {
    logger.log(Level.SEVERE,xse.getMessage());
    if (logger.isLoggable(Level.FINE)) {
      logger.log(Level.FINE,xse.getMessage(),xse);
    }
    xse.printStackTrace();
  }
catch (  IOException ioe) {
    logger.log(Level.SEVERE,ioe.getMessage());
    if (logger.isLoggable(Level.FINE)) {
      logger.log(Level.FINE,ioe.getMessage(),ioe);
    }
    ioe.printStackTrace();
  }
  cloader.start();
  return cloader;
}