Program: 114914
Project: 114914
Buggy source:
public static String removeExecutorsFromAPILifeCycle(String apiLifeCycle) throws APIMigrationException {
  Writer stringWriter=new StringWriter();
  Document doc=ResourceUtil.buildDocument(apiLifeCycle,"String_Node_Str");
  if (doc != null) {
    Element rootElement=doc.getDocumentElement();
    NodeList stateTags=rootElement.getElementsByTagName(Constants.API_LIFE_CYCLE_STATE_TAG);
    for (int i=0; i < stateTags.getLength(); ++i) {
      Element stateTag=(Element)stateTags.item(i);
      NodeList dataModelTags=stateTag.getElementsByTagName(Constants.API_LIFE_CYCLE_DATA_MODEL_TAG);
      if (dataModelTags.getLength() > 0) {
        Element dataModelTag=(Element)dataModelTags.item(0);
        dataModelTag.getParentNode().removeChild(dataModelTag);
      }
    }
    try {
      doc.getDocumentElement().normalize();
      Transformer transformer=TransformerFactory.newInstance().newTransformer();
      transformer.setOutputProperty(OutputKeys.ENCODING,Charset.defaultCharset().toString());
      transformer.setOutputProperty(OutputKeys.INDENT,"String_Node_Str");
      transformer.setOutputProperty("String_Node_Str","String_Node_Str");
      transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,"String_Node_Str");
      transformer.transform(new DOMSource(doc),new StreamResult(stringWriter));
    }
 catch (    TransformerException e) {
      ResourceUtil.handleException("String_Node_Str" + "String_Node_Str",e);
    }
  }
  return stringWriter.toString();
}

Fixed version (ground truth):
public static String removeExecutorsFromAPILifeCycle(String apiLifeCycle) throws APIMigrationException {
  Writer stringWriter=new StringWriter();
  Document doc=ResourceUtil.buildDocument(apiLifeCycle,"String_Node_Str");
  if (doc != null) {
    Element rootElement=doc.getDocumentElement();
    NodeList stateTags=rootElement.getElementsByTagName(Constants.API_LIFE_CYCLE_STATE_TAG);
    for (int i=0; i < stateTags.getLength(); ++i) {
      Element stateTag=(Element)stateTags.item(i);
      NodeList dataModelTags=stateTag.getElementsByTagName(Constants.API_LIFE_CYCLE_DATA_MODEL_TAG);
      if (dataModelTags.getLength() > 0) {
        Element dataModelTag=(Element)dataModelTags.item(0);
        if (APIStatus.CREATED.toString().equalsIgnoreCase(stateTag.getAttribute("String_Node_Str"))) {
          NodeList dataTags=dataModelTag.getElementsByTagName(Constants.API_LIFE_CYCLE_DATA_TAG);
          for (int j=0; j < dataTags.getLength(); j++) {
            Element dataTag=(Element)dataTags.item(j);
            if (Constants.API_LIFE_CYCLE_EXECUTORS_TAG.equals(dataTag.getAttribute("String_Node_Str"))) {
              dataTag.getParentNode().removeChild(dataTag);
            }
          }
        }
 else {
          dataModelTag.getParentNode().removeChild(dataModelTag);
        }
      }
    }
    try {
      doc.getDocumentElement().normalize();
      Transformer transformer=TransformerFactory.newInstance().newTransformer();
      transformer.setOutputProperty(OutputKeys.ENCODING,Charset.defaultCharset().toString());
      transformer.setOutputProperty(OutputKeys.INDENT,"String_Node_Str");
      transformer.setOutputProperty("String_Node_Str","String_Node_Str");
      transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,"String_Node_Str");
      transformer.transform(new DOMSource(doc),new StreamResult(stringWriter));
    }
 catch (    TransformerException e) {
      ResourceUtil.handleException("String_Node_Str" + "String_Node_Str",e);
    }
  }
  return stringWriter.toString();
}