Program: 50460
Project: 50460
Buggy source:
/** 
 * Print statistics about an alignment file in the Goby compact form.
 * @param file The file to display statistics about
 * @throws IOException if the file cannot be read
 */
private void describeCompactAlignment(final File file) throws IOException {
}

Fixed version (ground truth):
/** 
 * Print statistics about an alignment file in the Goby compact form.
 * @param file The file to display statistics about
 * @throws IOException if the file cannot be read
 */
private void describeCompactAlignment(final File file) throws IOException {
  final String basename=AlignmentReader.getBasename(file.toString());
  stream.printf("String_Node_Str",basename);
  final AlignmentReader reader=new AlignmentReader(basename);
  reader.readHeader();
  stream.println("String_Node_Str");
  stream.printf("String_Node_Str",reader.isSorted());
  stream.printf("String_Node_Str",reader.isIndexed());
  stream.printf("String_Node_Str",reader.getNumberOfTargets());
  final int[] targetLength=reader.getTargetLength();
  stream.printf("String_Node_Str",ArrayUtils.getLength(reader.getTargetLength()));
  stream.printf("String_Node_Str",reader.getSmallestSplitQueryIndex());
  stream.printf("String_Node_Str",reader.getLargestSplitQueryIndex());
  final SummaryStatistics targetLengthStats=new SummaryStatistics();
  if (targetLength != null) {
    for (    final double d : targetLength) {
      targetLengthStats.addValue(d);
    }
  }
  stream.printf("String_Node_Str",(int)targetLengthStats.getMin());
  stream.printf("String_Node_Str",(int)targetLengthStats.getMax());
  stream.printf("String_Node_Str",targetLengthStats.getMean());
  stream.println();
  stream.printf("String_Node_Str",reader.getNumberOfQueries());
  final int[] queryLength=reader.getQueryLengths();
  stream.printf("String_Node_Str",ArrayUtils.getLength(queryLength));
  final SummaryStatistics queryLengthStats=new SummaryStatistics();
  if (queryLength != null) {
    System.out.println("String_Node_Str");
    for (    final double d : queryLength) {
      queryLengthStats.addValue(d);
    }
  }
  stream.println("String_Node_Str" + reader.isConstantQueryLengths());
  stream.printf("String_Node_Str",reader.getQueryIdentifiers() != null && !reader.getQueryIdentifiers().isEmpty());
  stream.printf("String_Node_Str",reader.getTargetIdentifiers() != null && !reader.getTargetIdentifiers().isEmpty());
  stream.println();
  final IntSet alignedQueryIndices=new IntOpenHashSet();
  describeAmbigousReads(basename,reader.getNumberOfQueries(),alignedQueryIndices);
  int maxQueryIndex=-1;
  int maxTargetIndex=-1;
  int numEntries=0;
  long numLogicalAlignmentEntries=0;
  long total=0;
  double avgScore=0;
  int sumNumVariations=0;
  for (  final Alignments.AlignmentEntry entry : reader) {
    numberOfReads++;
    numEntries++;
    numLogicalAlignmentEntries+=entry.getMultiplicity();
    total+=entry.getQueryAlignedLength();
    avgScore+=entry.getScore();
    maxQueryIndex=Math.max(maxQueryIndex,entry.getQueryIndex());
    maxTargetIndex=Math.max(maxTargetIndex,entry.getTargetIndex());
    cumulativeReadLength+=entry.getQueryAlignedLength();
    minReadLength=Math.min(minReadLength,entry.getQueryAlignedLength());
    maxReadLength=Math.max(maxReadLength,entry.getQueryAlignedLength());
    sumNumVariations+=entry.getSequenceVariationsCount();
    alignedQueryIndices.add(entry.getQueryIndex());
  }
  avgScore/=(double)numLogicalAlignmentEntries;
  final int numQuerySequences=maxQueryIndex + 1;
  stream.printf("String_Node_Str",numQuerySequences);
  final int numTargetSequences=maxTargetIndex + 1;
  final double avgNumVariationsPerQuery=((double)sumNumVariations) / (double)numQuerySequences;
  stream.printf("String_Node_Str",numTargetSequences);
  stream.printf("String_Node_Str",numLogicalAlignmentEntries);
  stream.printf("String_Node_Str",alignedQueryIndices.size());
  stream.printf("String_Node_Str",(double)alignedQueryIndices.size() / (double)(long)numQuerySequences * 100.0d);
  stream.printf("String_Node_Str",numEntries > 0 ? divide(total,numEntries) : -1);
  stream.printf("String_Node_Str",avgScore);
  stream.printf("String_Node_Str",avgNumVariationsPerQuery);
  final long size=file.length();
  stream.printf("String_Node_Str",divide(size,numLogicalAlignmentEntries));
  stream.printf("String_Node_Str",(int)queryLengthStats.getMin());
  stream.printf("String_Node_Str",(int)queryLengthStats.getMax());
  stream.printf("String_Node_Str",queryLengthStats.getMean());
}