Program: 29591
Project: 29591
Buggy source:
/** 
 * Gets the context root of the web module that the user/configuration has designated as the default-web-module for this virtual server. The default-web-module for a virtual server is specified via the 'default-web-module' attribute of the 'virtual-server' element in server.xml. This is an optional attribute and if the configuration does not specify another web module (standalone or part of a j2ee-application) that is configured at a context-root="", then a default web module will be created and loaded. The value for this attribute is either "${standalone-web-module-name}" or "${j2ee-app-name}:${web-module-uri}".
 * @return null if the default-web-module has not been specified orif the web module specified either could not be found or is disabled or does not specify this virtual server (if it specifies a value for the virtual-servers attribute) or if there was an error loading its deployment descriptors.
 */
protected String getDefaultContextPath(Domain domain,ApplicationRegistry appRegistry){
  String contextRoot=null;
  String wmID=getDefaultWebModuleID();
  if (wmID != null) {
    Applications appsBean=domain.getApplications();
    WebModuleConfig wmInfo=findWebModuleInJ2eeApp(appsBean,wmID,appRegistry);
    if (wmInfo == null) {
      contextRoot=ConfigBeansUtilities.getContextRoot(wmID);
    }
 else {
      contextRoot=wmInfo.getContextPath();
    }
    if (contextRoot == null) {
      Object[] params={wmID,getID()};
      _logger.log(Level.SEVERE,"String_Node_Str",params);
    }
  }
  return contextRoot;
}

Fixed version (ground truth):
/** 
 * Gets the context root of the web module that the user/configuration has designated as the default-web-module for this virtual server. The default-web-module for a virtual server is specified via the 'default-web-module' attribute of the 'virtual-server' element in server.xml. This is an optional attribute and if the configuration does not specify another web module (standalone or part of a j2ee-application) that is configured at a context-root="", then a default web module will be created and loaded. The value for this attribute is either "${standalone-web-module-name}" or "${j2ee-app-name}:${web-module-uri}".
 * @return null if the default-web-module has not been specified orif the web module specified either could not be found or is disabled or does not specify this virtual server (if it specifies a value for the virtual-servers attribute) or if there was an error loading its deployment descriptors.
 */
protected String getDefaultContextPath(Domain domain,ApplicationRegistry appRegistry){
  String contextRoot=null;
  String wmID=getDefaultWebModuleID();
  if (wmID != null) {
    Applications appsBean=domain.getApplications();
    WebModuleConfig wmInfo=findWebModuleInJ2eeApp(appsBean,wmID,appRegistry);
    if (wmInfo == null) {
      ConfigBeansUtilities cbu=getConfigBeansUtilities();
      if (cbu == null) {
        contextRoot=null;
      }
 else {
        contextRoot=cbu.getContextRoot(wmID);
      }
    }
 else {
      contextRoot=wmInfo.getContextPath();
    }
    if (contextRoot == null) {
      Object[] params={wmID,getID()};
      _logger.log(Level.SEVERE,"String_Node_Str",params);
    }
  }
  return contextRoot;
}