Program: 50235
Project: 50235
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 < 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);
    }
  }
}

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);
    }
    breakpoints=removeDuplicates(breakpoints);
    if (restrictPerChromosome) {
      breakpoints=restrictPerChromosome(breakpoints,input);
    }
    assertPostcondition(breakpoints);
    for (int i=0; i < breakpoints.length - 1; i++) {
      final int startTargetIndex=breakpoints[i].targetIndex;
      final int endTargetIndex=breakpoints[i + 1].targetIndex;
      final int startPosition=breakpoints[i].position;
      final int endPosition=breakpoints[i + 1].position;
      if (!restrictPerChromosome || (restrictPerChromosome && startTargetIndex == endTargetIndex)) {
        stream.printf(String.format("String_Node_Str",ids.getId(startTargetIndex),startPosition,ids.getId(startTargetIndex),startPosition,ids.getId(endTargetIndex),endPosition,ids.getId(endTargetIndex),endPosition));
      }
    }
  }
  finally {
    if (stream != System.out) {
      IOUtils.closeQuietly(stream);
    }
    System.out.println("String_Node_Str");
  }
}