Program: 50383
Project: 50383
Buggy source:
private void processOneBasename(final Object2ObjectMap<String,ObjectList<Annotation>> allAnnots,BufferedWriter writer,final String inputFile,final String inputBasename,GenomicRange range) throws IOException {
  WeightsInfo weights=null;
  if (weightParams.useWeights) {
    weights=loadWeights(inputBasename,weightParams.useWeights,weightParams.weightId);
    if (weights != null) {
      System.err.println("String_Node_Str");
    }
  }
  final AlignmentReaderFactory factory=filterAmbiguousReads ? new NonAmbiguousAlignmentReaderFactory() : new DefaultAlignmentReaderFactory();
  final int numberOfReferences;
  final DoubleIndexedIdentifier referenceIds;
{
    final AlignmentReader reader=factory.createReader(inputBasename);
    reader.readHeader();
    numberOfReferences=reader.getNumberOfTargets();
    referenceIds=new DoubleIndexedIdentifier(reader.getTargetIdentifiers());
    reader.close();
  }
  System.out.println(String.format("String_Node_Str",numberOfReferences));
  if (genomicRange != null) {
    genomicRange.resolveChromosomeIndices(referenceIds);
  }
  final AnnotationCountIterateAlignments iterateAlignment=new AnnotationCountIterateAlignments();
  iterateAlignment.setWeightInfo(weightParams,weights);
  iterateAlignment.parseIncludeReferenceArgument(includeReferenceNameCommas);
  System.out.println("String_Node_Str" + inputBasename + "String_Node_Str");
  iterateAlignment.setAlignmentReaderFactory(factory);
  iterateAlignment.iterate(genomicRange,inputBasename);
  final int numAlignedReadsInSample=iterateAlignment.getNumAlignedReadsInSample();
  final AnnotationCountInterface[] algs=iterateAlignment.getAlgs();
  final IntSet referencesToProcess=iterateAlignment.getReferencesSelected();
  final String sampleId=FilenameUtils.getBaseName(inputBasename);
  deCalculator.setNumAlignedInSample(sampleId,numAlignedReadsInSample);
  if (outputFilename == null) {
    if (writeAnnotationCounts) {
      final String outputFileTmp=FilenameUtils.removeExtension(inputFile) + "String_Node_Str";
      writer=new BufferedWriter(new FileWriter(outputFileTmp));
      writer.write("String_Node_Str");
    }
  }
  writeAnnotationCounts(allAnnots,writer,inputBasename,referenceIds,algs,referencesToProcess);
  if (outputFilename == null) {
    IOUtils.closeQuietly(writer);
  }
}

Fixed version (ground truth):
private void processOneBasename(final Object2ObjectMap<String,ObjectList<Annotation>> allAnnots,BufferedWriter writer,final String inputFile,final String inputBasename,GenomicRange range) throws IOException {
  WeightsInfo weights=null;
  if (weightParams.useWeights) {
    weights=loadWeights(inputBasename,weightParams.useWeights,weightParams.weightId);
    if (weights != null) {
      System.err.println("String_Node_Str");
    }
  }
  final AlignmentReaderFactory factory=filterAmbiguousReads ? new NonAmbiguousAlignmentReaderFactory() : new DefaultAlignmentReaderFactory();
  final int numberOfReferences;
  final DoubleIndexedIdentifier referenceIds;
{
    final AlignmentReader reader=factory.createReader(inputBasename);
    reader.readHeader();
    numberOfReferences=reader.getNumberOfTargets();
    referenceIds=new DoubleIndexedIdentifier(reader.getTargetIdentifiers());
    reader.close();
  }
  System.out.println(String.format("String_Node_Str",numberOfReferences));
  if (genomicRange != null) {
    genomicRange.resolveChromosomeIndices(referenceIds);
  }
  final AnnotationCountIterateAlignments iterateAlignment=new AnnotationCountIterateAlignments();
  iterateAlignment.setWeightInfo(weightParams,weights);
  iterateAlignment.parseIncludeReferenceArgument(includeReferenceNameCommas);
  System.out.println("String_Node_Str" + inputBasename + "String_Node_Str");
  iterateAlignment.setAlignmentReaderFactory(factory);
  iterateAlignment.iterate(genomicRange,inputBasename);
  final long numAlignedReadsInSample=iterateAlignment.getNumAlignedReadsInSample();
  final AnnotationCountInterface[] algs=iterateAlignment.getAlgs();
  final IntSet referencesToProcess=iterateAlignment.getReferencesSelected();
  final String sampleId=FilenameUtils.getBaseName(inputBasename);
  deCalculator.setNumAlignedInSample(sampleId,numAlignedReadsInSample);
  if (outputFilename == null) {
    if (writeAnnotationCounts) {
      final String outputFileTmp=FilenameUtils.removeExtension(inputFile) + "String_Node_Str";
      writer=new BufferedWriter(new FileWriter(outputFileTmp));
      writer.write("String_Node_Str");
    }
  }
  writeAnnotationCounts(allAnnots,writer,inputBasename,referenceIds,algs,referencesToProcess);
  if (outputFilename == null) {
    IOUtils.closeQuietly(writer);
  }
}