Program: 96017
Project: 96017
Buggy source:
/** 
 * adds information for a Cap to the XML file
 * @param resultNode the actual node
 * @param insertInto where to insert elements in xml
 * @param node NodePO
 */
protected void addCapElements(TestResultNode resultNode,Element insertInto,ICapPO node){
  ICapPO cap=node;
  getTimestampFromResultNode(resultNode,insertInto);
  Element compEl=insertInto.addElement("String_Node_Str");
  compEl.addText(StringUtils.defaultString(resultNode.getComponentName()));
  Element compTypeEl=insertInto.addElement("String_Node_Str");
  compTypeEl.addText(CompSystemI18n.getString(cap.getComponentType()));
  Element actionEl=insertInto.addElement("String_Node_Str");
  actionEl.addText(CompSystemI18n.getString(cap.getActionName()));
  if (resultNode.getStatus() == TestResultNode.ERROR || resultNode.getStatus() == TestResultNode.RETRYING) {
    Element error=insertInto.addElement("String_Node_Str");
    Element errorType=error.addElement("String_Node_Str");
    TestErrorEvent event=resultNode.getEvent();
    if (event != null) {
      errorType.addText(I18n.getString(event.getId(),true));
      Map<Object,Object> eventProps=event.getProps();
      if (eventProps.containsKey(TestErrorEvent.Property.DESCRIPTION_KEY)) {
        String key=(String)eventProps.get(TestErrorEvent.Property.DESCRIPTION_KEY);
        Object[] args=(Object[])eventProps.get(TestErrorEvent.Property.PARAMETER_KEY);
        args=args != null ? args : new Object[0];
        Element mapEntry=error.addElement("String_Node_Str");
        if (mapEntry != null && key != null) {
          mapEntry.addText(resultNode.hasBackingNode() ? String.valueOf(I18n.getString(key,args)) : key);
        }
      }
 else {
        for (        Map.Entry<Object,Object> entry : eventProps.entrySet()) {
          if (!TestErrorEvent.Property.DESCRIPTION_KEY.equals(entry.getKey())) {
            Element mapEntry=error.addElement((String)entry.getKey());
            mapEntry.addText(String.valueOf(entry.getValue()));
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * adds information for a Cap to the XML file
 * @param resultNode the actual node
 * @param insertInto where to insert elements in xml
 * @param node NodePO
 */
protected void addCapElements(TestResultNode resultNode,Element insertInto,ICapPO node){
  ICapPO cap=node;
  getTimestampFromResultNode(resultNode,insertInto);
  Element compEl=insertInto.addElement("String_Node_Str");
  compEl.addText(StringUtils.defaultString(resultNode.getComponentName()));
  Element compTypeEl=insertInto.addElement("String_Node_Str");
  compTypeEl.addText(CompSystemI18n.getString(cap.getComponentType(),true));
  Element actionEl=insertInto.addElement("String_Node_Str");
  actionEl.addText(CompSystemI18n.getString(cap.getActionName(),true));
  if (resultNode.getStatus() == TestResultNode.ERROR || resultNode.getStatus() == TestResultNode.RETRYING) {
    Element error=insertInto.addElement("String_Node_Str");
    Element errorType=error.addElement("String_Node_Str");
    TestErrorEvent event=resultNode.getEvent();
    if (event != null) {
      errorType.addText(I18n.getString(event.getId(),true));
      Map<Object,Object> eventProps=event.getProps();
      if (eventProps.containsKey(TestErrorEvent.Property.DESCRIPTION_KEY)) {
        String key=(String)eventProps.get(TestErrorEvent.Property.DESCRIPTION_KEY);
        Object[] args=(Object[])eventProps.get(TestErrorEvent.Property.PARAMETER_KEY);
        args=args != null ? args : new Object[0];
        Element mapEntry=error.addElement("String_Node_Str");
        if (mapEntry != null && key != null) {
          mapEntry.addText(resultNode.hasBackingNode() ? String.valueOf(I18n.getString(key,args)) : key);
        }
      }
 else {
        for (        Map.Entry<Object,Object> entry : eventProps.entrySet()) {
          if (!TestErrorEvent.Property.DESCRIPTION_KEY.equals(entry.getKey())) {
            Element mapEntry=error.addElement((String)entry.getKey());
            mapEntry.addText(String.valueOf(entry.getValue()));
          }
        }
      }
    }
  }
}