Program: 50287
Project: 50287
Buggy source:
private void alignmentToReadSet(final String basename) throws IOException {
  final AlignmentReaderImpl reader=new AlignmentReaderImpl(basename);
  reader.readHeader();
  final ReadSet outputSet=new ReadSet();
  final int maxQueryIndex=reader.getSmallestSplitQueryIndex();
  final int minQueryIndex=reader.getLargestSplitQueryIndex();
  final IntSet matchingIndices=new IntOpenHashSet();
  for (  final Alignments.AlignmentEntry entry : reader) {
    final int queryIndex=entry.getQueryIndex();
    matchingIndices.add(queryIndex);
  }
  final boolean alignmentHasPermutation=reader.getQueryIndicesWerePermuted();
  final PermutationReaderInterface permReader=alignmentHasPermutation ? new PermutationReader(basename) : new NoOpPermutationReader();
  reader.close();
  final AlignmentTooManyHitsReader tmhReader=new AlignmentTooManyHitsReader(basename);
  for (int smallIndex=minQueryIndex; smallIndex <= maxQueryIndex; ++smallIndex) {
    final int queryIndex=permReader.getQueryIndex(smallIndex);
    if (matchingReads) {
      if (matchingIndices.contains(smallIndex)) {
        if (passesTmhFilter(tmhReader,smallIndex)) {
          if (preFilter == null || preFilter.contains(queryIndex)) {
            outputSet.add(queryIndex,1);
          }
        }
      }
    }
    if (nonMatchingReads) {
      if (!matchingIndices.contains(smallIndex)) {
        if (passesTmhFilter(tmhReader,smallIndex)) {
          if (preFilter == null || preFilter.contains(queryIndex)) {
            outputSet.add(queryIndex,1);
          }
        }
      }
    }
  }
  outputSet.save(basename,suffix);
  System.out.printf("String_Node_Str",outputSet.size());
}

Fixed version (ground truth):
private void alignmentToReadSet(final String basename) throws IOException {
  final AlignmentReaderImpl reader=new AlignmentReaderImpl(basename);
  reader.readHeader();
  final ReadSet outputSet=new ReadSet();
  final int minQueryIndex=reader.getSmallestSplitQueryIndex();
  final int maxQueryIndex=reader.getLargestSplitQueryIndex();
  final IntSet matchingIndices=new IntOpenHashSet();
  for (  final Alignments.AlignmentEntry entry : reader) {
    final int queryIndex=entry.getQueryIndex();
    matchingIndices.add(queryIndex);
  }
  final boolean alignmentHasPermutation=reader.getQueryIndicesWerePermuted();
  final PermutationReaderInterface permReader=alignmentHasPermutation ? new PermutationReader(basename) : new NoOpPermutationReader();
  reader.close();
  final AlignmentTooManyHitsReader tmhReader=new AlignmentTooManyHitsReader(basename);
  for (int smallIndex=minQueryIndex; smallIndex <= maxQueryIndex; ++smallIndex) {
    final int queryIndex=permReader.getQueryIndex(smallIndex);
    if (matchingReads) {
      if (matchingIndices.contains(smallIndex)) {
        if (passesTmhFilter(tmhReader,smallIndex)) {
          if (preFilter == null || preFilter.contains(queryIndex)) {
            outputSet.add(queryIndex,1);
          }
        }
      }
    }
    if (nonMatchingReads) {
      if (!matchingIndices.contains(smallIndex)) {
        if (passesTmhFilter(tmhReader,smallIndex)) {
          if (preFilter == null || preFilter.contains(queryIndex)) {
            outputSet.add(queryIndex,1);
          }
        }
      }
    }
  }
  outputSet.save(basename,suffix);
  System.out.printf("String_Node_Str",outputSet.size());
}