Program: 29827
Project: 29827
Buggy source:
/** 
 * Process the default configuration file, if it exists. The default config must be read with the container loader - so container servlets can be loaded
 */
protected void defaultConfig() throws LifecycleException {
  long t1=System.currentTimeMillis();
  if (defaultWebXml == null && context instanceof StandardContext) {
    defaultWebXml=((StandardContext)context).getDefaultWebXml();
  }
  if (defaultWebXml == null)   getDefaultWebXml();
  File file=new File(this.defaultWebXml);
  if (!file.isAbsolute()) {
    file=new File(getBaseDir(),this.defaultWebXml);
  }
  InputStream stream=null;
  InputSource source=null;
  try {
    if (!file.exists()) {
      stream=getClass().getClassLoader().getResourceAsStream(defaultWebXml);
      if (stream != null) {
        source=new InputSource(getClass().getClassLoader().getResource(defaultWebXml).toString());
      }
      if (stream == null) {
        stream=getClass().getClassLoader().getResourceAsStream("String_Node_Str");
        if (stream != null) {
          source=new InputSource(getClass().getClassLoader().getResource("String_Node_Str").toString());
        }
      }
      if (stream == null) {
        if (log.isLoggable(Level.INFO)) {
          log.info("String_Node_Str");
        }
        return;
      }
    }
 else {
      source=new InputSource("String_Node_Str" + file.getAbsolutePath());
      stream=new FileInputStream(file);
    }
  }
 catch (  Exception e) {
    throw new LifecycleException(sm.getString("String_Node_Str") + "String_Node_Str" + defaultWebXml+ "String_Node_Str"+ file,e);
  }
synchronized (webDigester) {
    try {
      source.setByteStream(stream);
      webDigester.setDebug(getDebug());
      if (context instanceof StandardContext)       ((StandardContext)context).setReplaceWelcomeFiles(true);
      webDigester.clear();
      webDigester.setClassLoader(classLoader);
      webDigester.setUseContextClassLoader(false);
      webDigester.push(context);
      webDigester.parse(source);
    }
 catch (    SAXParseException e) {
      throw new LifecycleException(sm.getString("String_Node_Str",e.getLineNumber(),e.getColumnNumber()),e);
    }
catch (    Exception e) {
      throw new LifecycleException(sm.getString("String_Node_Str"),e);
    }
 finally {
      try {
        if (stream != null) {
          stream.close();
        }
      }
 catch (      IOException e) {
        log.log(Level.SEVERE,sm.getString("String_Node_Str"),e);
      }
    }
  }
  webRuleSet.recycle();
  long t2=System.currentTimeMillis();
  if ((t2 - t1) > 200 && log.isLoggable(Level.FINE))   log.fine("String_Node_Str" + file + "String_Node_Str"+ (t2 - t1));
}

Fixed version (ground truth):
/** 
 * Process the default configuration file, if it exists. The default config must be read with the container loader - so container servlets can be loaded
 */
protected void defaultConfig() throws LifecycleException {
  long t1=System.currentTimeMillis();
  if (defaultWebXml == null && context instanceof StandardContext) {
    defaultWebXml=((StandardContext)context).getDefaultWebXml();
  }
  if (defaultWebXml == null)   getDefaultWebXml();
  File file=new File(this.defaultWebXml);
  if (!file.isAbsolute()) {
    file=new File(getBaseDir(),this.defaultWebXml);
  }
  InputStream stream=null;
  InputSource source=null;
  try {
    if (!file.exists()) {
      stream=getClass().getClassLoader().getResourceAsStream(defaultWebXml);
      if (stream != null) {
        source=new InputSource(getClass().getClassLoader().getResource(defaultWebXml).toString());
      }
      if (stream == null) {
        stream=getClass().getClassLoader().getResourceAsStream("String_Node_Str");
        if (stream != null) {
          source=new InputSource(getClass().getClassLoader().getResource("String_Node_Str").toString());
        }
      }
      if (stream == null) {
        if (log.isLoggable(Level.INFO)) {
          log.info("String_Node_Str");
        }
        return;
      }
    }
 else {
      source=new InputSource("String_Node_Str" + file.getAbsolutePath());
      stream=new FileInputStream(file);
    }
  }
 catch (  Exception e) {
    throw new LifecycleException(sm.getString("String_Node_Str") + "String_Node_Str" + defaultWebXml+ "String_Node_Str"+ file,e);
  }
synchronized (webDigester) {
    try {
      source.setByteStream(stream);
      webDigester.setDebug(getDebug());
      if (context instanceof StandardContext)       ((StandardContext)context).setReplaceWelcomeFiles(true);
      webDigester.clear();
      webDigester.setClassLoader(this.getClass().getClassLoader());
      webDigester.setUseContextClassLoader(false);
      webDigester.push(context);
      webDigester.parse(source);
    }
 catch (    SAXParseException e) {
      throw new LifecycleException(sm.getString("String_Node_Str",e.getLineNumber(),e.getColumnNumber()),e);
    }
catch (    Exception e) {
      throw new LifecycleException(sm.getString("String_Node_Str"),e);
    }
 finally {
      try {
        if (stream != null) {
          stream.close();
        }
      }
 catch (      IOException e) {
        log.log(Level.SEVERE,sm.getString("String_Node_Str"),e);
      }
    }
  }
  webRuleSet.recycle();
  long t2=System.currentTimeMillis();
  if ((t2 - t1) > 200 && log.isLoggable(Level.FINE))   log.fine("String_Node_Str" + file + "String_Node_Str"+ (t2 - t1));
}