Program: 50245
Project: 50245
Buggy source:
/** 
 * Suggests slices to process a large alignment file in parallel.
 * @throws java.io.IOException error reading / writing
 */
@Override public void execute() throws IOException {
  PrintStream stream=null;
  try {
    stream=outputFilename == null ? System.out : new PrintStream(new FileOutputStream(outputFilename));
    ConcatSortedAlignmentReader input=new ConcatSortedAlignmentReader(basenames);
    input.readHeader();
    DoubleIndexedIdentifier ids=new DoubleIndexedIdentifier(input.getTargetIdentifiers());
    Ranges ranges=null;
    if (annotationFilename != null) {
      ranges=convertAnnotationsToRanges(annotationFilename,ids,input);
    }
    ReferenceLocation[] breakpoints=useModulo ? getReferenceLocationsWithModulo(stream,input,ids) : getReferenceLocationsWithBytes(stream,input,ids);
    if (ranges != null) {
      adjustBreakpointsWithAnnotations(breakpoints,ranges);
    }
    if (restrictPerChromosome) {
      breakpoints=restrictPerChromosome(breakpoints,input);
    }
    for (int i=0; i < numberOfSlices; i++) {
      if (!restrictPerChromosome || (restrictPerChromosome && breakpoints[i].targetIndex == breakpoints[i + 1].targetIndex))       stream.printf(String.format("String_Node_Str",ids.getId(breakpoints[i].targetIndex),breakpoints[i].position,ids.getId(breakpoints[i].targetIndex),breakpoints[i].position,ids.getId(breakpoints[i + 1].targetIndex),breakpoints[i + 1].position,ids.getId(breakpoints[i + 1].targetIndex),breakpoints[i + 1].position));
    }
  }
  finally {
    if (stream != System.out) {
      IOUtils.closeQuietly(stream);
    }
  }
}

Fixed version (ground truth):
/** 
 * Suggests slices to process a large alignment file in parallel.
 * @throws java.io.IOException error reading / writing
 */
@Override public void execute() throws IOException {
  PrintStream stream=null;
  try {
    stream=outputFilename == null ? System.out : new PrintStream(new FileOutputStream(outputFilename));
    ConcatSortedAlignmentReader input=new ConcatSortedAlignmentReader(basenames);
    input.readHeader();
    DoubleIndexedIdentifier ids=new DoubleIndexedIdentifier(input.getTargetIdentifiers());
    Ranges ranges=null;
    if (annotationFilename != null) {
      ranges=convertAnnotationsToRanges(annotationFilename,ids,input);
    }
    ReferenceLocation[] breakpoints=useModulo ? getReferenceLocationsWithModulo(stream,input,ids) : getReferenceLocationsWithBytes(stream,input,ids);
    if (ranges != null) {
      adjustBreakpointsWithAnnotations(breakpoints,ranges);
    }
    if (restrictPerChromosome) {
      breakpoints=restrictPerChromosome(breakpoints,input);
    }
    for (int i=0; i < breakpoints.length - 1; i++) {
      if (!restrictPerChromosome || (restrictPerChromosome && breakpoints[i].targetIndex == breakpoints[i + 1].targetIndex))       stream.printf(String.format("String_Node_Str",ids.getId(breakpoints[i].targetIndex),breakpoints[i].position,ids.getId(breakpoints[i].targetIndex),breakpoints[i].position,ids.getId(breakpoints[i + 1].targetIndex),breakpoints[i + 1].position,ids.getId(breakpoints[i + 1].targetIndex),breakpoints[i + 1].position));
    }
  }
  finally {
    if (stream != System.out) {
      IOUtils.closeQuietly(stream);
    }
  }
}