Program: 50341
Project: 50341
Buggy source:
@Override public void run(){
  final String threadId=String.format("String_Node_Str",Thread.currentThread().getId());
  final List<String> mergeFromBasenames=new LinkedList<String>();
  try {
    System.gc();
    final SortMergeSplit merged=toMerge.get(0);
    final int numSplits=toMerge.size();
    for (int i=1; i < numSplits; i++) {
      merged.addRangesFomSplit(toMerge.get(i));
      merged.numFiles+=toMerge.get(i).numFiles;
    }
    merged.ranges=mergeRangeList(merged.ranges);
    LOG.debug(String.format("String_Node_Str",threadId,numSplits,ArrayUtils.toString(toMerge),ArrayUtils.toString(merged)));
    for (    final SortMergeSplit mergeFrom : toMerge) {
      final String inputBasename=tempDir + "String_Node_Str" + mergeFrom.tag;
      mergeFromBasenames.add(inputBasename);
    }
    final ConcatSortedAlignmentReader concatReader=new ConcatSortedAlignmentReader(false,mergeFromBasenames.toArray(new String[mergeFromBasenames.size()]));
    concatReader.readHeader();
    merged.makeNewTag();
    final String subBasename;
    final String subOutputFilename;
    if (lastMerge) {
      subBasename=FilenameUtils.getName(basename);
      subOutputFilename=outputFilename;
    }
 else {
      subBasename="String_Node_Str" + merged.tag;
      subOutputFilename=tempDir + "String_Node_Str" + subBasename;
    }
    final AlignmentWriter writer=new AlignmentWriter(subOutputFilename);
    writer.setSorted(true);
    if (concatReader.getTargetLength() != null) {
      writer.setTargetLengths(concatReader.getTargetLength());
    }
    for (    final Alignments.AlignmentEntry entry : concatReader) {
      writer.appendEntry(entry);
    }
    writer.close();
    numMergesExecuted.incrementAndGet();
    sortedSplits.add(merged);
  }
 catch (  IOException e) {
    LOG.error(String.format("String_Node_Str",threadId,e.getMessage()));
    exceptions.add(e);
  }
catch (  Throwable t) {
    LOG.error(String.format("String_Node_Str",threadId,t.getMessage()));
    exceptions.add(t);
  }
 finally {
    for (    final String mergeFromBasename : mergeFromBasenames) {
      deleteFile(new File(mergeFromBasename + "String_Node_Str"),true);
      deleteFile(new File(mergeFromBasename + "String_Node_Str"),true);
      deleteFile(new File(mergeFromBasename + "String_Node_Str"),true);
      deleteFile(new File(mergeFromBasename + "String_Node_Str"),true);
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  final String threadId=String.format("String_Node_Str",Thread.currentThread().getId());
  final List<String> mergeFromBasenames=new LinkedList<String>();
  try {
    System.gc();
    final SortMergeSplit merged=toMerge.get(0);
    final int numSplits=toMerge.size();
    for (int i=1; i < numSplits; i++) {
      merged.addRangesFomSplit(toMerge.get(i));
      merged.numFiles+=toMerge.get(i).numFiles;
    }
    merged.ranges=mergeRangeList(merged.ranges);
    LOG.debug(String.format("String_Node_Str",threadId,numSplits,ArrayUtils.toString(toMerge),ArrayUtils.toString(merged)));
    for (    final SortMergeSplit mergeFrom : toMerge) {
      final String inputBasename=tempDir + "String_Node_Str" + mergeFrom.tag;
      mergeFromBasenames.add(inputBasename);
    }
    final ConcatSortedAlignmentReader concatReader=new ConcatSortedAlignmentReader(false,mergeFromBasenames.toArray(new String[mergeFromBasenames.size()]));
    concatReader.readHeader();
    merged.makeNewTag();
    final String subBasename;
    final String subOutputFilename;
    if (lastMerge) {
      subBasename=FilenameUtils.getName(basename);
      subOutputFilename=outputFilename;
    }
 else {
      subBasename="String_Node_Str" + merged.tag;
      subOutputFilename=tempDir + "String_Node_Str" + subBasename;
    }
    final AlignmentWriter writer=new AlignmentWriter(subOutputFilename);
    if (concatReader.getTargetLength() != null) {
      writer.setTargetLengths(concatReader.getTargetLength());
    }
    writer.setTargetIdentifiers(concatReader.getTargetIdentifiers());
    writer.setSorted(true);
    for (    final Alignments.AlignmentEntry entry : concatReader) {
      writer.appendEntry(entry);
    }
    writer.close();
    numMergesExecuted.incrementAndGet();
    sortedSplits.add(merged);
  }
 catch (  IOException e) {
    LOG.error(String.format("String_Node_Str",threadId,e.getMessage()));
    exceptions.add(e);
  }
catch (  Throwable t) {
    LOG.error(String.format("String_Node_Str",threadId,t.getMessage()));
    exceptions.add(t);
  }
 finally {
    for (    final String mergeFromBasename : mergeFromBasenames) {
      deleteFile(new File(mergeFromBasename + "String_Node_Str"),true);
      deleteFile(new File(mergeFromBasename + "String_Node_Str"),true);
      deleteFile(new File(mergeFromBasename + "String_Node_Str"),true);
      deleteFile(new File(mergeFromBasename + "String_Node_Str"),true);
    }
  }
}