Program: 141227
Project: 141227
Buggy source:
/** 
 * 'key': the identifier of the aligned read without the integer indicating the member of the pair. 'values': the rest of the paired alignments, i.e the SAM line of the first paired alignment and the SAM line of the second paired alignment.
 */
@Override protected void reduce(final Text key,final Iterable<Text> values,final Context context) throws IOException, InterruptedException {
  String stringVal;
  String strOutKey="String_Node_Str";
  String strOutValue="String_Node_Str";
  SAMRecord samRecord;
  String stringRecord;
  records.clear();
  for (  Text val : values) {
    stringVal=val.toString();
    stringRecord=key.toString() + stringVal;
    try {
      samRecord=this.parser.parseLine(stringRecord);
      records.add(samRecord);
    }
 catch (    SAMFormatException e) {
      context.getCounter(this.counterGroup,INVALID_SAM_ENTRIES_COUNTER.counterName()).increment(1);
      LOGGER.info("String_Node_Str" + e.getMessage() + "String_Node_Str"+ stringRecord+ "String_Node_Str");
      return;
    }
  }
  Collections.sort(records,new SAMComparator());
  int indexOfFirstTab=records.get(0).getSAMString().indexOf("String_Node_Str");
  strOutKey=records.get(0).getSAMString().substring(0,indexOfFirstTab);
  strOutValue=records.get(0).getSAMString().substring(indexOfFirstTab + 1).replaceAll("String_Node_Str","String_Node_Str");
  records.remove(0);
  for (  SAMRecord r : records) {
    if (r.getFirstOfPairFlag()) {
      strOutValue+="String_Node_Str" + r.getSAMString().replaceAll("String_Node_Str","String_Node_Str");
    }
 else {
      strOutValue+="String_Node_Str" + r.getSAMString().replaceAll("String_Node_Str","String_Node_Str");
    }
  }
  this.outKey.set(strOutKey);
  this.outValue.set(strOutValue);
  context.write(this.outKey,this.outValue);
}

Fixed version (ground truth):
/** 
 * 'key': the identifier of the aligned read without the integer indicating the member of the pair. 'values': the rest of the paired alignments, i.e the SAM line of the first paired alignment and the SAM line of the second paired alignment.
 */
@Override protected void reduce(final Text key,final Iterable<Text> values,final Context context) throws IOException, InterruptedException {
  String stringVal;
  final String strOutKey;
  StringBuilder strOutValue=new StringBuilder();
  SAMRecord samRecord;
  String stringRecord;
  records.clear();
  for (  Text val : values) {
    stringVal=val.toString();
    stringRecord=key.toString() + stringVal;
    try {
      samRecord=this.parser.parseLine(stringRecord);
      records.add(samRecord);
    }
 catch (    SAMFormatException e) {
      context.getCounter(this.counterGroup,INVALID_SAM_ENTRIES_COUNTER.counterName()).increment(1);
      LOGGER.info("String_Node_Str" + e.getMessage() + "String_Node_Str"+ stringRecord+ "String_Node_Str");
      return;
    }
  }
  Collections.sort(records,new SAMComparator());
  int indexOfFirstTab=records.get(0).getSAMString().indexOf("String_Node_Str");
  strOutKey=records.get(0).getSAMString().substring(0,indexOfFirstTab);
  strOutValue.append(records.get(0).getSAMString().substring(indexOfFirstTab + 1).replaceAll("String_Node_Str","String_Node_Str"));
  records.remove(0);
  for (  SAMRecord r : records) {
    if (r.getFirstOfPairFlag()) {
      strOutValue.append('\n');
    }
 else {
      strOutValue.append('£');
    }
    strOutValue.append(r.getSAMString().replaceAll("String_Node_Str","String_Node_Str"));
  }
  this.outKey.set(strOutKey);
  this.outValue.set(strOutValue.toString());
  context.write(this.outKey,this.outValue);
}