Program: 61624
Project: 61624
Buggy source:
public void saveSolutionData(ProgramVariant childVariant,String srcOutput,int generation){
  try {
    Map<String,Integer> result=new HashMap<String,Integer>();
    DocumentBuilderFactory dbFactory=DocumentBuilderFactory.newInstance();
    DocumentBuilder dBuilder=dbFactory.newDocumentBuilder();
    Document root=dBuilder.newDocument();
    Element rootElement=root.createElement("String_Node_Str");
    root.appendChild(rootElement);
    for (int i=1; i <= generation; i++) {
      List<GenOperationInstance> genOperationInstances=childVariant.getOperations().get(i);
      if (genOperationInstances == null)       continue;
      for (      GenOperationInstance genOperationInstance : genOperationInstances) {
        Element op=root.createElement("String_Node_Str");
        rootElement.appendChild(op);
        Attr attr_location=root.createAttribute("String_Node_Str");
        attr_location.setValue(genOperationInstance.getGen().getCtClass().getQualifiedName());
        op.setAttributeNode(attr_location);
        if (genOperationInstance.getGen() instanceof GenSuspicious) {
          GenSuspicious gs=(GenSuspicious)genOperationInstance.getGen();
          int line=gs.getSuspicious().getLineNumber();
          Attr attr_line=root.createAttribute("String_Node_Str");
          attr_line.setValue(Integer.toString(line));
          op.setAttributeNode(attr_line);
        }
        Attr attr_gen=root.createAttribute("String_Node_Str");
        attr_gen.setValue(Integer.toString(i));
        op.setAttributeNode(attr_gen);
        Element original=root.createElement("String_Node_Str");
        op.appendChild(original);
        original.setTextContent(genOperationInstance.getOriginal().toString());
        Element mod=root.createElement("String_Node_Str");
        op.appendChild(mod);
        mod.setTextContent(genOperationInstance.getModified().toString());
      }
    }
    TransformerFactory transformerFactory=TransformerFactory.newInstance();
    Transformer transformer=transformerFactory.newTransformer();
    DOMSource source=new DOMSource(root);
    StreamResult result1=new StreamResult(new File(srcOutput + File.separator + "String_Node_Str"));
    transformer.transform(source,result1);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void saveSolutionData(ProgramVariant childVariant,String srcOutput,int generation){
  try {
    Map<String,Integer> result=new HashMap<String,Integer>();
    DocumentBuilderFactory dbFactory=DocumentBuilderFactory.newInstance();
    DocumentBuilder dBuilder=dbFactory.newDocumentBuilder();
    Document root=dBuilder.newDocument();
    Element rootElement=root.createElement("String_Node_Str");
    root.appendChild(rootElement);
    for (int i=1; i <= generation; i++) {
      List<GenOperationInstance> genOperationInstances=childVariant.getOperations().get(i);
      if (genOperationInstances == null)       continue;
      for (      GenOperationInstance genOperationInstance : genOperationInstances) {
        Element op=root.createElement("String_Node_Str");
        rootElement.appendChild(op);
        Attr attr_location=root.createAttribute("String_Node_Str");
        attr_location.setValue(genOperationInstance.getGen().getCtClass().getQualifiedName());
        op.setAttributeNode(attr_location);
        if (genOperationInstance.getGen() instanceof GenSuspicious) {
          GenSuspicious gs=(GenSuspicious)genOperationInstance.getGen();
          int line=gs.getSuspicious().getLineNumber();
          Attr attr_line=root.createAttribute("String_Node_Str");
          attr_line.setValue(Integer.toString(line));
          op.setAttributeNode(attr_line);
        }
        Attr attr_gen=root.createAttribute("String_Node_Str");
        attr_gen.setValue(Integer.toString(i));
        op.setAttributeNode(attr_gen);
        Element original=root.createElement("String_Node_Str");
        op.appendChild(original);
        original.setTextContent(genOperationInstance.getOriginal().toString());
        Element mod=root.createElement("String_Node_Str");
        op.appendChild(mod);
        if (genOperationInstance.getModified() != null)         mod.setTextContent("String_Node_Str" + genOperationInstance.getModified().toString() + "String_Node_Str");
 else {
          mod.setTextContent("String_Node_Str" + genOperationInstance.getOriginal().toString() + "String_Node_Str");
        }
      }
    }
    TransformerFactory transformerFactory=TransformerFactory.newInstance();
    Transformer transformer=transformerFactory.newTransformer();
    DOMSource source=new DOMSource(root);
    StreamResult result1=new StreamResult(new File(srcOutput + File.separator + "String_Node_Str"));
    transformer.transform(source,result1);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}