Program: 59404
Project: 59404
Buggy source:
@Override public void updateWebMvcConfigFile(){
  String webMvcXmlPath=projectOperations.getPathResolver().getIdentifier(getWebappPath(),"String_Node_Str");
  Validate.isTrue(fileManager.exists(webMvcXmlPath),"String_Node_Str");
  MutableFile webMvcXmlMutableFile=null;
  Document webMvcXml;
  try {
    webMvcXmlMutableFile=fileManager.updateFile(webMvcXmlPath);
    webMvcXml=XmlUtils.getDocumentBuilder().parse(webMvcXmlMutableFile.getInputStream());
  }
 catch (  Exception e) {
    throw new IllegalStateException(e);
  }
  Element root=webMvcXml.getDocumentElement();
  List<Element> annotationDrivenFound=XmlUtils.findElements("String_Node_Str",root);
  Validate.isTrue(!annotationDrivenFound.isEmpty(),"String_Node_Str");
  Validate.isTrue(annotationDrivenFound.size() == 1,"String_Node_Str");
  Element annotationDriven=annotationDrivenFound.get(0);
  Element argumentResolver=null;
  Element bean=null;
  boolean addBean=false;
  if (!annotationDriven.hasChildNodes()) {
    addBean=true;
  }
 else {
    bean=XmlUtils.findFirstElement("String_Node_Str".concat(DATATABLES_CRITERIA_RESOLVER).concat("String_Node_Str"),annotationDriven);
    if (bean == null) {
      addBean=true;
      argumentResolver=XmlUtils.findFirstElement(ARGUMENT_RESOLVERS,annotationDriven);
    }
  }
  if (addBean) {
    if (argumentResolver == null) {
      argumentResolver=webMvcXml.createElement("String_Node_Str" + ARGUMENT_RESOLVERS);
      annotationDriven.appendChild(argumentResolver);
    }
    bean=webMvcXml.createElement("String_Node_Str");
    bean.setAttribute("String_Node_Str",DATATABLES_CRITERIA_RESOLVER);
    argumentResolver.appendChild(bean);
    XmlUtils.writeXml(webMvcXmlMutableFile.getOutputStream(),webMvcXml);
  }
}

Fixed version (ground truth):
@Override public void updateWebMvcConfigFile(){
  LogicalPath webappPath=WebProjectUtils.getWebappPath(projectOperations);
  String webMvcXmlPath=projectOperations.getPathResolver().getIdentifier(webappPath,"String_Node_Str");
  Validate.isTrue(fileManager.exists(webMvcXmlPath),"String_Node_Str");
  MutableFile webMvcXmlMutableFile=null;
  Document webMvcXml;
  try {
    webMvcXmlMutableFile=fileManager.updateFile(webMvcXmlPath);
    webMvcXml=XmlUtils.getDocumentBuilder().parse(webMvcXmlMutableFile.getInputStream());
  }
 catch (  Exception e) {
    throw new IllegalStateException(e);
  }
  Element root=webMvcXml.getDocumentElement();
  List<Element> annotationDrivenFound=XmlUtils.findElements("String_Node_Str",root);
  Validate.isTrue(!annotationDrivenFound.isEmpty(),"String_Node_Str");
  Validate.isTrue(annotationDrivenFound.size() == 1,"String_Node_Str");
  Element annotationDriven=annotationDrivenFound.get(0);
  Element argumentResolver=null;
  Element bean=null;
  boolean addBean=false;
  if (!annotationDriven.hasChildNodes()) {
    addBean=true;
  }
 else {
    bean=XmlUtils.findFirstElement("String_Node_Str".concat(DATATABLES_CRITERIA_RESOLVER).concat("String_Node_Str"),annotationDriven);
    if (bean == null) {
      addBean=true;
      argumentResolver=XmlUtils.findFirstElement(ARGUMENT_RESOLVERS,annotationDriven);
    }
  }
  if (addBean) {
    if (argumentResolver == null) {
      argumentResolver=webMvcXml.createElement("String_Node_Str" + ARGUMENT_RESOLVERS);
      annotationDriven.appendChild(argumentResolver);
    }
    bean=webMvcXml.createElement("String_Node_Str");
    bean.setAttribute("String_Node_Str",DATATABLES_CRITERIA_RESOLVER);
    argumentResolver.appendChild(bean);
    XmlUtils.writeXml(webMvcXmlMutableFile.getOutputStream(),webMvcXml);
  }
}