Program: 3342
Project: 3342
Buggy source:
/** 
 * output the report block based on the passed mapping, where the mapping sould be "name of report element" => "value", where both sides of the mapping should be Strings.  This class also assumes that the reference is a linkable URL to the resource
 * @param content     the statistic object array to be displayed
 * @return              a string containing the statistics block HTML formatted
 */
public String statBlock(Statistics content){
  StringBuffer frag=new StringBuffer();
  Stat[] stats=content.getStats();
  frag.append("String_Node_Str");
  if (content.getStatName() != null || content.getResultName() != null) {
    frag.append("String_Node_Str");
    frag.append("String_Node_Str");
    if (content.getStatName() != null) {
      frag.append("String_Node_Str" + content.getStatName() + "String_Node_Str");
    }
 else {
      frag.append("String_Node_Str");
    }
    frag.append("String_Node_Str");
    frag.append("String_Node_Str");
    if (content.getResultName() != null) {
      frag.append("String_Node_Str" + content.getResultName() + "String_Node_Str");
    }
 else {
      frag.append("String_Node_Str");
    }
    frag.append("String_Node_Str");
    frag.append("String_Node_Str");
  }
  for (int i=0; i < stats.length; i++) {
    String style=null;
    if ((i % 2) == 1) {
      style="String_Node_Str";
    }
 else {
      style="String_Node_Str";
    }
    frag.append("String_Node_Str" + style + "String_Node_Str");
    frag.append("String_Node_Str");
    if (stats[i].getReference() != null) {
      frag.append("String_Node_Str" + stats[i].getReference() + "String_Node_Str");
      frag.append("String_Node_Str");
    }
    frag.append(stats[i].getKey());
    if (stats[i].getReference() != null) {
      frag.append("String_Node_Str");
    }
    frag.append("String_Node_Str");
    frag.append("String_Node_Str");
    frag.append("String_Node_Str" + ReportTools.numberFormat(stats[i].getValue()));
    if (stats[i].getUnits() != null) {
      frag.append("String_Node_Str" + stats[i].getUnits());
    }
    frag.append("String_Node_Str");
    frag.append("String_Node_Str");
  }
  frag.append("String_Node_Str");
  return frag.toString();
}

Fixed version (ground truth):
/** 
 * output the report block based on the passed mapping, where the mapping sould be "name of report element" => "value", where both sides of the mapping should be Strings.  This class also assumes that the reference is a linkable URL to the resource
 * @param content     the statistic object array to be displayed
 * @return              a string containing the statistics block HTML formatted
 */
public String statBlock(Statistics content){
  StringBuffer frag=new StringBuffer();
  Stat[] stats=content.getStats();
  frag.append("String_Node_Str");
  if (content.getStatName() != null || content.getResultName() != null) {
    frag.append("String_Node_Str");
    frag.append("String_Node_Str");
    if (content.getStatName() != null) {
      frag.append("String_Node_Str" + content.getStatName() + "String_Node_Str");
    }
 else {
      frag.append("String_Node_Str");
    }
    frag.append("String_Node_Str");
    frag.append("String_Node_Str");
    if (content.getResultName() != null) {
      frag.append("String_Node_Str" + content.getResultName() + "String_Node_Str");
    }
 else {
      frag.append("String_Node_Str");
    }
    frag.append("String_Node_Str");
    frag.append("String_Node_Str");
  }
  for (int i=0; i < stats.length; i++) {
    String style=null;
    if ((i % 2) == 1) {
      style="String_Node_Str";
    }
 else {
      style="String_Node_Str";
    }
    frag.append("String_Node_Str" + style + "String_Node_Str");
    frag.append("String_Node_Str");
    if (stats[i].getReference() != null) {
      frag.append("String_Node_Str" + stats[i].getReference() + "String_Node_Str");
      frag.append("String_Node_Str");
    }
    frag.append(this.clean(stats[i].getKey()));
    if (stats[i].getReference() != null) {
      frag.append("String_Node_Str");
    }
    frag.append("String_Node_Str");
    frag.append("String_Node_Str");
    frag.append("String_Node_Str" + ReportTools.numberFormat(stats[i].getValue()));
    if (stats[i].getUnits() != null) {
      frag.append("String_Node_Str" + stats[i].getUnits());
    }
    frag.append("String_Node_Str");
    frag.append("String_Node_Str");
  }
  frag.append("String_Node_Str");
  return frag.toString();
}