Program: 73804
Project: 73804
Buggy source:
private String _buildCompleteModel(Node p_currentNode) throws DBExecutionException {
  if (_xmlModelHerarichyMap == null) {
    _xmlModelHerarichyMap=new HashMap<String,String>();
  }
  NamedNodeMap attributes=p_currentNode.getAttributes();
  String strCurrentModelName="String_Node_Str";
  if (attributes != null) {
    for (int i=0; i < attributes.getLength(); i++) {
      Node node=attributes.item(i);
      if (node.getNodeName().equalsIgnoreCase("String_Node_Str")) {
        strCurrentModelName=node.getNodeValue();
        break;
      }
    }
  }
  if (strCurrentModelName != null && strCurrentModelName.length() > 0) {
    if (_xmlModelHerarichyMap.containsKey(strCurrentModelName)) {
      return (String)_xmlModelHerarichyMap.get(strCurrentModelName);
    }
    if (_xmlContainer == null) {
      throw new DBExecutionException("String_Node_Str" + "String_Node_Str");
    }
    XmlDocument currentDbModel;
    String strCurrentModelContent="String_Node_Str";
    try {
      currentDbModel=_xmlContainer.getDocument(strCurrentModelName);
      if (currentDbModel == null) {
        throw new DBExecutionException("String_Node_Str" + "String_Node_Str" + strCurrentModelName + "String_Node_Str");
      }
      strCurrentModelContent=currentDbModel.getContentAsString();
    }
 catch (    XmlException e) {
      throw new DBExecutionException("String_Node_Str" + e.getMessage(),e);
    }
    if (p_currentNode.hasChildNodes()) {
      NodeList children=p_currentNode.getChildNodes();
      for (int i=0; i < children.getLength(); i++) {
        if (children.item(i).getNodeType() == Node.ELEMENT_NODE) {
          Node child=children.item(i);
          String strChildContent=_buildCompleteModel(child);
          strChildContent=strChildContent.substring(strChildContent.indexOf("String_Node_Str"));
          String strChildNode=_getParentEntityNodeAsString(strChildContent);
          if (strChildNode != null && strChildNode.length() > 0) {
            strCurrentModelContent=strCurrentModelContent.replaceAll(strChildNode,strChildContent);
          }
          strCurrentModelContent=strCurrentModelContent.replaceAll("String_Node_Str","String_Node_Str");
        }
      }
      _xmlModelHerarichyMap.put(strCurrentModelName,strCurrentModelContent);
      return strCurrentModelContent;
    }
 else {
      _xmlModelHerarichyMap.put(strCurrentModelName,strCurrentModelContent);
      return strCurrentModelContent;
    }
  }
 else {
    return "String_Node_Str";
  }
}

Fixed version (ground truth):
/** 
 * Build the complete model by resolving all the references in it.
 * @param p_currentNode the node in the reference file that points to the model
 * @return String that represents the model body without references
 * @throws DBExecutionException Thrown if there is a problem executing the task.
 */
private String _buildCompleteModel(Node p_currentNode) throws DBExecutionException {
  if (_xmlModelHerarichyMap == null) {
    _xmlModelHerarichyMap=new HashMap<String,String>();
  }
  NamedNodeMap attributes=p_currentNode.getAttributes();
  String strCurrentModelName="String_Node_Str";
  if (attributes != null) {
    for (int i=0; i < attributes.getLength(); i++) {
      Node node=attributes.item(i);
      if (node.getNodeName().equalsIgnoreCase("String_Node_Str")) {
        strCurrentModelName=node.getNodeValue();
        break;
      }
    }
  }
  if (strCurrentModelName != null && strCurrentModelName.length() > 0) {
    if (_xmlModelHerarichyMap.containsKey(strCurrentModelName)) {
      return (String)_xmlModelHerarichyMap.get(strCurrentModelName);
    }
    if (_xmlContainer == null) {
      throw new DBExecutionException("String_Node_Str" + "String_Node_Str");
    }
    XmlDocument currentDbModel;
    String strCurrentModelContent="String_Node_Str";
    try {
      currentDbModel=_xmlContainer.getDocument(strCurrentModelName);
      if (currentDbModel == null) {
        throw new DBExecutionException("String_Node_Str" + "String_Node_Str" + strCurrentModelName + "String_Node_Str");
      }
      strCurrentModelContent=currentDbModel.getContentAsString();
    }
 catch (    XmlException e) {
      throw new DBExecutionException("String_Node_Str" + e.getMessage(),e);
    }
    if (p_currentNode.hasChildNodes()) {
      NodeList children=p_currentNode.getChildNodes();
      for (int i=0; i < children.getLength(); i++) {
        if (children.item(i).getNodeType() == Node.ELEMENT_NODE) {
          Node child=children.item(i);
          String strChildContent=_buildCompleteModel(child);
          strChildContent=strChildContent.substring(strChildContent.indexOf("String_Node_Str"));
          String strChildNode=_getParentEntityNodeAsString(strChildContent);
          if (strChildNode != null && strChildNode.length() > 0) {
            strCurrentModelContent=strCurrentModelContent.replaceAll(strChildNode,strChildContent);
          }
          strCurrentModelContent=strCurrentModelContent.replaceAll("String_Node_Str","String_Node_Str");
        }
      }
    }
    _xmlModelHerarichyMap.put(strCurrentModelName,strCurrentModelContent);
    return strCurrentModelContent;
  }
 else {
    return "String_Node_Str";
  }
}