Program: 29764
Project: 29764
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;
    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 ((new File(base,WEBLOGIC_XML)).exists()) {
      webXmlParser=new WeblogicXmlParser(base.getAbsolutePath());
    }
 else {
      webXmlParser=new GlassFishWebXmlParser(base.getAbsolutePath());
    }
    configureLoaderAttributes(cloader,webXmlParser,base);
    configureLoaderProperties(cloader,webXmlParser,base);
  }
 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=null;
    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 ((new File(base,WEBLOGIC_XML)).exists()) {
      webXmlParser=new WeblogicXmlParser(base.getAbsolutePath());
    }
 else {
      webXmlParser=new GlassFishWebXmlParser(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;
}