Program: 50452
Project: 50452
Buggy source:
/** 
 * Perform the concatenation.
 * @throws java.io.IOException
 */
@Override public void execute() throws IOException {
  final String outputFilename=outputFile;
  final String[] basenames=AlignmentReader.getBasenames(inputFilenames);
  final boolean allSorted=ConcatenateAlignmentMode.isAllSorted(basenames);
  if (!allSorted) {
    System.out.println("String_Node_Str");
    System.exit(10);
  }
  if (readIndexStats != null) {
    int readerIndex=0;
    for (    String basename : basenames) {
      boolean found=false;
      for (      ReadIndexStats stat : readIndexStats) {
        if (FilenameUtils.getBaseName(basename).equals(stat.basename)) {
          stat.readerIndex=readerIndex;
          found=true;
        }
      }
      if (!found) {
        System.err.printf("String_Node_Str",basename);
      }
      readerIndex++;
    }
    Collections.sort(readIndexStats,new Comparator<ReadIndexStats>(){
      public int compare(      ReadIndexStats readIndexStats,      ReadIndexStats readIndexStatsFirst){
        return readIndexStats.readerIndex - readIndexStatsFirst.readerIndex;
      }
    }
);
    numberOfReadIndices=new int[this.deCalculator.getSampleToGroupMap().keySet().size()];
    ObjectSet<ReadIndexStats> toRemove=new ObjectArraySet<ReadIndexStats>();
    for (    ReadIndexStats stat : readIndexStats) {
      if (stat.readerIndex == -1) {
        toRemove.add(stat);
        continue;
      }
      numberOfReadIndices[stat.readerIndex]=Math.max(numberOfReadIndices[stat.readerIndex],stat.countReferenceBases.length);
    }
    readIndexStats.removeAll(toRemove);
    for (    ReadIndexStats stat : readIndexStats) {
      for (int readIndex=0; readIndex < numberOfReadIndices[stat.readerIndex]; readIndex++) {
        stat.countReferenceBases[readIndex]/=numberOfReadIndices[stat.readerIndex];
      }
    }
  }
  ConcatSortedAlignmentReader sortedReaders=new ConcatSortedAlignmentReader(basenames);
  int lastPosition=-1;
  int lastTargetIndex=-1;
  ObjectArrayList<Alignments.AlignmentEntry> entriesAtPosition=new ObjectArrayList<Alignments.AlignmentEntry>();
  IntArrayList readerIndices=new IntArrayList();
  DoubleIndexedIdentifier targetIds=new DoubleIndexedIdentifier(sortedReaders.getTargetIdentifiers());
  outWriter.printf("String_Node_Str");
  if (deAnalyzer.eval("String_Node_Str")) {
    outWriter.printf("String_Node_Str",groups[0],groups[1],groups[0],groups[1]);
  }
  for (  String group : groups) {
    outWriter.printf("String_Node_Str",group,group,group,group);
    if (deAnalyzer.eval("String_Node_Str")) {
      outWriter.printf("String_Node_Str",group);
    }
  }
  outWriter.printf("String_Node_Str");
  for (  Alignments.AlignmentEntry entry : sortedReaders) {
    if (currentReferenceId == null) {
      currentReferenceId=targetIds.getId(entry.getTargetIndex());
      currentReferenceIndex=entry.getTargetIndex();
    }
    final int position=entry.getPosition();
    final int targetIndex=entry.getTargetIndex();
    if (targetIndex != lastTargetIndex || position != lastPosition) {
      if (entriesAtPosition.size() != 0) {
        pushVariations(entriesAtPosition,readerIndices);
      }
      processVariations(lastPosition);
      if (targetIndex != lastTargetIndex) {
        variationPool.reset();
        currentReferenceId=targetIds.getId(entry.getTargetIndex());
      }
      variationPool.removePosition(lastPosition);
      entriesAtPosition.clear();
      readerIndices.clear();
      lastPosition=position;
      lastTargetIndex=targetIndex;
    }
    entriesAtPosition.add(entry);
    readerIndices.add(sortedReaders.getReaderIndex());
  }
  outWriter.flush();
}

Fixed version (ground truth):
/** 
 * Perform the concatenation.
 * @throws java.io.IOException
 */
@Override public void execute() throws IOException {
  final String outputFilename=outputFile;
  final String[] basenames=AlignmentReader.getBasenames(inputFilenames);
  final boolean allSorted=ConcatenateAlignmentMode.isAllSorted(basenames);
  if (!allSorted) {
    System.out.println("String_Node_Str");
    System.exit(10);
  }
  if (readIndexStats != null) {
    int readerIndex=0;
    for (    String basename : basenames) {
      boolean found=false;
      for (      ReadIndexStats stat : readIndexStats) {
        if (FilenameUtils.getBaseName(basename).equals(stat.basename)) {
          stat.readerIndex=readerIndex;
          found=true;
        }
      }
      if (!found) {
        System.err.printf("String_Node_Str",basename);
      }
      readerIndex++;
    }
    Collections.sort(readIndexStats,new Comparator<ReadIndexStats>(){
      public int compare(      ReadIndexStats readIndexStats,      ReadIndexStats readIndexStatsFirst){
        return readIndexStats.readerIndex - readIndexStatsFirst.readerIndex;
      }
    }
);
    numberOfReadIndices=new int[this.deCalculator.getSampleToGroupMap().keySet().size()];
    ObjectSet<ReadIndexStats> toRemove=new ObjectArraySet<ReadIndexStats>();
    for (    ReadIndexStats stat : readIndexStats) {
      if (stat.readerIndex == -1) {
        toRemove.add(stat);
        continue;
      }
      numberOfReadIndices[stat.readerIndex]=Math.max(numberOfReadIndices[stat.readerIndex],stat.countReferenceBases.length);
    }
    readIndexStats.removeAll(toRemove);
    for (    ReadIndexStats stat : readIndexStats) {
      for (int i=0; i < stat.countReferenceBases.length; i++) {
        System.out.printf("String_Node_Str",stat.basename,i + 1,stat.countReferenceBases[i]);
      }
    }
  }
  ConcatSortedAlignmentReader sortedReaders=new ConcatSortedAlignmentReader(basenames);
  int lastPosition=-1;
  int lastTargetIndex=-1;
  ObjectArrayList<Alignments.AlignmentEntry> entriesAtPosition=new ObjectArrayList<Alignments.AlignmentEntry>();
  IntArrayList readerIndices=new IntArrayList();
  DoubleIndexedIdentifier targetIds=new DoubleIndexedIdentifier(sortedReaders.getTargetIdentifiers());
  outWriter.printf("String_Node_Str");
  if (deAnalyzer.eval("String_Node_Str")) {
    outWriter.printf("String_Node_Str",groups[0],groups[1],groups[0],groups[1]);
  }
  for (  String group : groups) {
    outWriter.printf("String_Node_Str",group,group,group,group);
    if (deAnalyzer.eval("String_Node_Str")) {
      outWriter.printf("String_Node_Str",group);
    }
  }
  outWriter.printf("String_Node_Str");
  for (  Alignments.AlignmentEntry entry : sortedReaders) {
    if (currentReferenceId == null) {
      currentReferenceId=targetIds.getId(entry.getTargetIndex());
      currentReferenceIndex=entry.getTargetIndex();
    }
    final int position=entry.getPosition();
    final int targetIndex=entry.getTargetIndex();
    if (targetIndex != lastTargetIndex || position != lastPosition) {
      if (entriesAtPosition.size() != 0) {
        pushVariations(entriesAtPosition,readerIndices);
      }
      processVariations(lastPosition);
      if (targetIndex != lastTargetIndex) {
        variationPool.reset();
        currentReferenceId=targetIds.getId(entry.getTargetIndex());
      }
      variationPool.removePosition(lastPosition);
      entriesAtPosition.clear();
      readerIndices.clear();
      lastPosition=position;
      lastTargetIndex=targetIndex;
    }
    entriesAtPosition.add(entry);
    readerIndices.add(sortedReaders.getReaderIndex());
  }
  outWriter.flush();
}