Program: 61560
Project: 61560
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<ModificationInstance> genOperationInstances=childVariant.getOperations().get(i);
      if (genOperationInstances == null)       continue;
      for (      ModificationInstance genOperationInstance : genOperationInstances) {
        Element op=root.createElement("String_Node_Str");
        rootElement.appendChild(op);
        Attr attr_location=root.createAttribute("String_Node_Str");
        attr_location.setValue(genOperationInstance.getModificationPoint().getCtClass().getQualifiedName());
        op.setAttributeNode(attr_location);
        if (genOperationInstance.getModificationPoint() instanceof SuspiciousModificationPoint) {
          SuspiciousModificationPoint gs=(SuspiciousModificationPoint)genOperationInstance.getModificationPoint();
          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);
        Attr attr_type=root.createAttribute("String_Node_Str");
        attr_type.setValue(genOperationInstance.getOperationApplied().toString());
        op.setAttributeNode(attr_type);
        Element original=root.createElement("String_Node_Str");
        op.appendChild(original);
        original.setNodeValue(genOperationInstance.getOriginal().toString());
        Element mod=root.createElement("String_Node_Str");
        op.appendChild(mod);
        if (genOperationInstance.getModified() != null) {
          mod.setNodeValue(genOperationInstance.getModified().toString());
          if (genOperationInstance.getIngredientScope() != null) {
            Attr attr_ing=root.createAttribute("String_Node_Str");
            attr_ing.setValue(genOperationInstance.getIngredientScope().toString());
            mod.setAttributeNode(attr_ing);
          }
        }
 else {
          mod.setNodeValue(genOperationInstance.getOriginal().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<ModificationInstance> genOperationInstances=childVariant.getOperations().get(i);
      if (genOperationInstances == null)       continue;
      for (      ModificationInstance genOperationInstance : genOperationInstances) {
        Element op=root.createElement("String_Node_Str");
        rootElement.appendChild(op);
        Attr attr_location=root.createAttribute("String_Node_Str");
        attr_location.setValue(genOperationInstance.getModificationPoint().getCtClass().getQualifiedName());
        op.setAttributeNode(attr_location);
        if (genOperationInstance.getModificationPoint() instanceof SuspiciousModificationPoint) {
          SuspiciousModificationPoint gs=(SuspiciousModificationPoint)genOperationInstance.getModificationPoint();
          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);
        Attr attr_type=root.createAttribute("String_Node_Str");
        attr_type.setValue(genOperationInstance.getOperationApplied().toString());
        op.setAttributeNode(attr_type);
        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(genOperationInstance.getModified().toString());
          if (genOperationInstance.getIngredientScope() != null) {
            Attr attr_ing=root.createAttribute("String_Node_Str");
            attr_ing.setValue(genOperationInstance.getIngredientScope().toString());
            mod.setAttributeNode(attr_ing);
          }
        }
 else {
          mod.setNodeValue(genOperationInstance.getOriginal().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();
  }
}