Program: 50409
Project: 50409
Buggy source:
/** 
 * Run the mode.
 */
@Override public void execute(){
  for (  String basename : inputBasenames) {
    try {
      final AlignmentReaderImpl alignment=new AlignmentReaderImpl(basename);
      alignment.readHeader();
      alignment.close();
      final IndexedIdentifier referenceIds=alignment.getTargetIdentifiers();
      final DoubleIndexedIdentifier backwards=new DoubleIndexedIdentifier(referenceIds);
      CountsArchiveReader archiveReader=new CountsArchiveReader(basename);
      CountsArchiveReader annotationArchiveReader=new CountsArchiveReader(annotationBasename);
      LongArrayList depthTallyInAnnotation=new LongArrayList(10000);
      LongArrayList depthTallyOutsideAnnotation=new LongArrayList(10000);
      ObjectOpenHashSet<String> archiveIdentifiers=new ObjectOpenHashSet<String>();
      archiveIdentifiers.addAll(annotationArchiveReader.getIdentifiers());
      long sumDepth=0;
      int countDepth=0;
      long countAllBases=0;
      for (int referenceIndex=0; referenceIndex < archiveReader.getNumberOfIndices(); referenceIndex++) {
        CountsReader reader=archiveReader.getCountReader(referenceIndex);
        String countArchiveRefId=backwards.getId(referenceIndex).toString();
        if (archiveIdentifiers.contains(countArchiveRefId)) {
          System.out.println(countArchiveRefId);
          CountsReader annotationReader=annotationArchiveReader.getCountReader(countArchiveRefId);
          AnyTransitionCountsIterator orIterator=new AnyTransitionCountsIterator(reader,annotationReader);
          while (orIterator.hasNextTransition()) {
            orIterator.nextTransition();
            int annotationCount=orIterator.getCount(1);
            int readerCount=orIterator.getCount(0);
            int position=orIterator.getPosition();
            int length=orIterator.getLength();
            int end=position + length;
            boolean inAnnotation=annotationCount == 1;
            LongArrayList update=inAnnotation ? depthTallyInAnnotation : depthTallyOutsideAnnotation;
            int depth=readerCount;
            if (depth != 0) {
              sumDepth+=depth;
              countDepth++;
            }
            grow(depthTallyInAnnotation,depth);
            grow(depthTallyOutsideAnnotation,depth);
            update.set(depth,update.get(depth) + length);
            countAllBases+=length;
          }
        }
 else {
          System.out.printf("String_Node_Str",countArchiveRefId);
        }
      }
      System.out.printf("String_Node_Str",divide(sumDepth,countDepth));
      System.out.printf("String_Node_Str",100d * divide(sum(depthTallyInAnnotation,1),sum(depthTallyOutsideAnnotation,1) + sum(depthTallyInAnnotation,1)));
      final int length=depthTallyInAnnotation.size();
      long[] cumulativeCaptured=new long[length];
      long[] cumulativeNotCaptured=new long[length];
      for (int depth=length - 2; depth >= 0; --depth) {
        cumulativeCaptured[depth]=cumulativeCaptured[depth + 1] + depthTallyInAnnotation.get(depth);
        cumulativeNotCaptured[depth]=cumulativeNotCaptured[depth + 1] + depthTallyOutsideAnnotation.get(depth);
      }
      System.out.printf("String_Node_Str",100d * divide(cumulativeCaptured[0],countAllBases));
      double[] fractionOfBasesCoveredCumulative=new double[length];
      for (int i=0; i < length; i++) {
        fractionOfBasesCoveredCumulative[i]=((double)cumulativeCaptured[i]) / ((double)(cumulativeCaptured[i] + cumulativeNotCaptured[i]));
      }
      for (int depth=0; depth < 100; depth++) {
        System.out.printf("String_Node_Str",depth,divide(cumulativeCaptured[depth],countAllBases) * 100,divide(cumulativeNotCaptured[depth],countAllBases) * 100);
      }
    }
 catch (    IOException e) {
      System.err.println("String_Node_Str" + basename);
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
/** 
 * Run the mode.
 */
@Override public void execute(){
  for (  String basename : inputBasenames) {
    try {
      final AlignmentReaderImpl alignment=new AlignmentReaderImpl(basename);
      alignment.readHeader();
      alignment.close();
      final IndexedIdentifier referenceIds=alignment.getTargetIdentifiers();
      final DoubleIndexedIdentifier backwards=new DoubleIndexedIdentifier(referenceIds);
      CountsArchiveReader archiveReader=new CountsArchiveReader(basename);
      CountsArchiveReader annotationArchiveReader=new CountsArchiveReader(annotationBasename);
      LongArrayList depthTallyInAnnotation=new LongArrayList(10000);
      LongArrayList depthTallyOutsideAnnotation=new LongArrayList(10000);
      ObjectOpenHashSet<String> archiveIdentifiers=new ObjectOpenHashSet<String>();
      archiveIdentifiers.addAll(annotationArchiveReader.getIdentifiers());
      long sumDepth=0;
      int countDepth=0;
      long sumDepthAnnot=0;
      int countDepthAnnot=0;
      long countAllBases=0;
      for (int referenceIndex=0; referenceIndex < archiveReader.getNumberOfIndices(); referenceIndex++) {
        CountsReader reader=archiveReader.getCountReader(referenceIndex);
        String countArchiveRefId=backwards.getId(referenceIndex).toString();
        if (archiveIdentifiers.contains(countArchiveRefId)) {
          System.out.println(countArchiveRefId);
          CountsReader annotationReader=annotationArchiveReader.getCountReader(countArchiveRefId);
          AnyTransitionCountsIterator orIterator=new AnyTransitionCountsIterator(reader,annotationReader);
          while (orIterator.hasNextTransition()) {
            orIterator.nextTransition();
            int annotationCount=orIterator.getCount(1);
            int readerCount=orIterator.getCount(0);
            int position=orIterator.getPosition();
            int length=orIterator.getLength();
            int end=position + length;
            boolean inAnnotation=annotationCount == 1;
            LongArrayList update=inAnnotation ? depthTallyInAnnotation : depthTallyOutsideAnnotation;
            int depth=readerCount;
            if (depth != 0) {
              sumDepth+=depth;
              countDepth++;
              if (inAnnotation) {
                sumDepthAnnot+=depth;
                countDepthAnnot++;
              }
            }
            grow(depthTallyInAnnotation,depth);
            grow(depthTallyOutsideAnnotation,depth);
            final int numBases=depth * length;
            update.set(depth,update.get(depth) + numBases);
            countAllBases+=depth * length;
          }
        }
 else {
          System.out.printf("String_Node_Str",countArchiveRefId);
        }
      }
      System.out.printf("String_Node_Str",divide(sumDepth,countDepth));
      System.out.printf("String_Node_Str",divide(sumDepthAnnot,countDepthAnnot));
      System.out.printf("String_Node_Str",100d * divide(sum(depthTallyInAnnotation,1),sum(depthTallyOutsideAnnotation,1) + sum(depthTallyInAnnotation,1)));
      final int length=depthTallyInAnnotation.size();
      long[] cumulativeCaptured=new long[length];
      long[] cumulativeNotCaptured=new long[length];
      long sumCaptured=(long)sum(depthTallyInAnnotation,0);
      long sumNotCaptured=(long)sum(depthTallyOutsideAnnotation,0);
      for (int depth=0; depth < length; ++depth) {
        cumulativeCaptured[depth]=sumCaptured;
        sumCaptured-=depthTallyInAnnotation.get(depth);
        cumulativeNotCaptured[depth]=sumNotCaptured;
        sumNotCaptured-=depthTallyOutsideAnnotation.get(depth);
      }
      System.out.printf("String_Node_Str",100d * divide(cumulativeCaptured[0],countAllBases));
      double[] fractionOfBasesCoveredCumulative=new double[length];
      for (int i=0; i < length; i++) {
        fractionOfBasesCoveredCumulative[i]=((double)cumulativeCaptured[i]) / ((double)(cumulativeCaptured[i] + cumulativeNotCaptured[i]));
      }
      for (int depth=0; depth < 300; depth++) {
        System.out.printf("String_Node_Str",depth,divide(cumulativeCaptured[depth],countAllBases) * 100,divide(cumulativeNotCaptured[depth],countAllBases) * 100);
      }
    }
 catch (    IOException e) {
      System.err.println("String_Node_Str" + basename);
      e.printStackTrace();
    }
  }
}