Program: 29131
Project: 29131
Buggy source:
/** 
 * Create a web module/application.
 * @param ctxPath  Context path for the web module
 * @param location Absolute pathname to the web module directory
 * @param defaultWebXmlLocation Location of default-web.xml
 */
public Context createContext(String id,String ctxPath,File location,String defaultContextXmlLocation,String defaultWebXmlLocation,boolean useDOLforDeployment,WebModuleConfig wmInfo){
  File configFile=null;
  if (ctxPath.equals("String_Node_Str")) {
    configFile=new File(getCatalinaHome() + "String_Node_Str","String_Node_Str");
  }
 else {
    configFile=new File(getCatalinaHome() + "String_Node_Str",ctxPath + "String_Node_Str");
  }
  if (!configFile.exists()) {
    configFile=new File(location,Constants.WEB_CONTEXT_XML);
  }
  WebModule context=new WebModule(services);
  context.setID(id);
  context.setWebContainer(webContainer);
  context.setDebug(debug);
  context.setPath(ctxPath);
  context.setDocBase(location.getAbsolutePath());
  context.setCrossContext(true);
  context.setUseNaming(isUseNaming());
  context.setHasWebXml(wmInfo.getDescriptor() != null);
  context.setWebBundleDescriptor(wmInfo.getDescriptor());
  context.setManagerChecksFrequency(1);
  context.setServerContext(serverContext);
  context.setWebModuleConfig(wmInfo);
  context.setDefaultWebXml(defaultWebXmlLocation);
  if (embeddedDirectoryListing) {
    context.setDirectoryListing(embeddedDirectoryListing);
  }
  if (configFile.exists()) {
    context.setConfigFile(configFile.getAbsolutePath());
  }
  ContextConfig config;
  if (useDOLforDeployment) {
    config=new WebModuleContextConfig();
    ((WebModuleContextConfig)config).setDescriptor(wmInfo.getDescriptor());
    ((WebModuleContextConfig)config).setServices(services);
  }
 else {
    config=new ContextConfig();
  }
  config.setDefaultContextXml(defaultContextXmlLocation);
  config.setDefaultWebXml(defaultWebXmlLocation);
  context.addLifecycleListener(config);
  context.addLifecycleListener(new WebModuleListener(webContainer,wmInfo.getDescriptor()));
  context.addContainerListener(new WebContainerListener(invocationManager,injectionManager));
  for (  WebModuleDecorator d : services.<WebModuleDecorator>getAllServices(WebModuleDecorator.class)) {
    d.decorate(context);
  }
  return context;
}

Fixed version (ground truth):
/** 
 * Create a web module/application.
 * @param ctxPath  Context path for the web module
 * @param location Absolute pathname to the web module directory
 * @param defaultWebXmlLocation Location of default-web.xml
 */
public Context createContext(String id,String ctxPath,File location,String defaultContextXmlLocation,String defaultWebXmlLocation,boolean useDOLforDeployment,WebModuleConfig wmInfo){
  File configFile=null;
  if (ctxPath.equals("String_Node_Str")) {
    configFile=new File(getCatalinaHome() + "String_Node_Str","String_Node_Str");
  }
 else {
    configFile=new File(getCatalinaHome() + "String_Node_Str",ctxPath + "String_Node_Str");
  }
  if (!configFile.exists()) {
    configFile=new File(location,Constants.WEB_CONTEXT_XML);
  }
  WebModule context=new WebModule(services);
  context.setID(id);
  context.setWebContainer(webContainer);
  context.setDebug(debug);
  context.setPath(ctxPath);
  context.setDocBase(location.getAbsolutePath());
  context.setCrossContext(true);
  context.setUseNaming(isUseNaming());
  context.setHasWebXml(wmInfo.getDescriptor() != null);
  context.setWebBundleDescriptor(wmInfo.getDescriptor());
  context.setManagerChecksFrequency(1);
  context.setServerContext(serverContext);
  context.setWebModuleConfig(wmInfo);
  context.setDefaultWebXml(defaultWebXmlLocation);
  if (embeddedDirectoryListing) {
    context.setDirectoryListing(embeddedDirectoryListing);
  }
  if (configFile.exists()) {
    context.setConfigFile(configFile.getAbsolutePath());
  }
  ContextConfig config;
  if (useDOLforDeployment) {
    config=new WebModuleContextConfig(services);
    ((WebModuleContextConfig)config).setDescriptor(wmInfo.getDescriptor());
  }
 else {
    config=new ContextConfig();
  }
  config.setDefaultContextXml(defaultContextXmlLocation);
  config.setDefaultWebXml(defaultWebXmlLocation);
  context.addLifecycleListener(config);
  context.addLifecycleListener(new WebModuleListener(webContainer,wmInfo.getDescriptor()));
  context.addContainerListener(new WebContainerListener(invocationManager,injectionManager));
  for (  WebModuleDecorator d : services.<WebModuleDecorator>getAllServices(WebModuleDecorator.class)) {
    d.decorate(context);
  }
  return context;
}