Program: 13698
Project: 13698
Buggy source:
protected int runHalvadeJob(Configuration halvadeConf,String tmpOutDir,int jobType) throws IOException, URISyntaxException, InterruptedException, ClassNotFoundException {
  String pipeline="String_Node_Str";
  if (jobType == HalvadeResourceManager.RNA_SHMEM_PASS2) {
    HalvadeConf.setIsPass2(halvadeConf,true);
    HalvadeResourceManager.setJobResources(halvadeOpts,halvadeConf,jobType,false,halvadeOpts.useBamInput);
    pipeline=RNA_PASS2;
  }
 else   if (jobType == HalvadeResourceManager.DNA) {
    HalvadeResourceManager.setJobResources(halvadeOpts,halvadeConf,jobType,false,halvadeOpts.useBamInput);
    pipeline=DNA;
  }
  halvadeOpts.splitChromosomes(halvadeConf);
  HalvadeConf.setOutDir(halvadeConf,tmpOutDir);
  FileSystem outFs=FileSystem.get(new URI(tmpOutDir),halvadeConf);
  if (outFs.exists(new Path(tmpOutDir))) {
    Logger.INFO("String_Node_Str" + tmpOutDir + "String_Node_Str");
    Logger.INFO("String_Node_Str");
    System.exit(-2);
  }
  if (halvadeOpts.useBamInput)   setHeaderFile(halvadeOpts.in,halvadeConf);
  if (halvadeOpts.rnaPipeline)   HalvadeConf.setPass2Suffix(halvadeConf,pass2suffix);
  Job halvadeJob=Job.getInstance(halvadeConf,"String_Node_Str" + pipeline);
  halvadeJob.addCacheArchive(new URI(halvadeOpts.halvadeBinaries));
  halvadeJob.setJarByClass(be.ugent.intec.halvade.hadoop.mapreduce.HalvadeMapper.class);
  addInputFiles(halvadeOpts.in,halvadeConf,halvadeJob);
  FileOutputFormat.setOutputPath(halvadeJob,new Path(tmpOutDir));
  if (jobType == HalvadeResourceManager.RNA_SHMEM_PASS2) {
    halvadeJob.setMapperClass(be.ugent.intec.halvade.hadoop.mapreduce.StarAlignPassXMapper.class);
    halvadeJob.setReducerClass(be.ugent.intec.halvade.hadoop.mapreduce.RnaGATKReducer.class);
  }
 else   if (jobType == HalvadeResourceManager.DNA) {
    halvadeJob.setMapperClass(halvadeOpts.alignmentTools[halvadeOpts.aln]);
    halvadeJob.setReducerClass(be.ugent.intec.halvade.hadoop.mapreduce.DnaGATKReducer.class);
  }
  halvadeJob.setMapOutputKeyClass(ChromosomeRegion.class);
  halvadeJob.setMapOutputValueClass(SAMRecordWritable.class);
  halvadeJob.setInputFormatClass(HalvadeTextInputFormat.class);
  halvadeJob.setOutputKeyClass(Text.class);
  if (halvadeOpts.mergeBam) {
    halvadeJob.setSortComparatorClass(SimpleChrRegionComparator.class);
    halvadeJob.setOutputValueClass(SAMRecordWritable.class);
  }
 else {
    halvadeJob.setPartitionerClass(ChrRgPartitioner.class);
    halvadeJob.setSortComparatorClass(ChrRgSortComparator.class);
    halvadeJob.setGroupingComparatorClass(ChrRgGroupingComparator.class);
    halvadeJob.setOutputValueClass(VariantContextWritable.class);
  }
  if (halvadeOpts.justAlign && !halvadeOpts.mergeBam)   halvadeJob.setNumReduceTasks(0);
 else   if (halvadeOpts.mergeBam) {
    halvadeJob.setReducerClass(be.ugent.intec.halvade.hadoop.mapreduce.BamMergeReducer.class);
    halvadeJob.setNumReduceTasks(1);
  }
 else {
    halvadeJob.setNumReduceTasks(halvadeOpts.reduces);
    if (halvadeOpts.countOnly) {
      halvadeJob.setReducerClass(be.ugent.intec.halvade.hadoop.mapreduce.CountReadsReducer.class);
      halvadeJob.setOutputValueClass(LongWritable.class);
    }
  }
  if (halvadeOpts.useBamInput) {
    halvadeJob.setMapperClass(be.ugent.intec.halvade.hadoop.mapreduce.AlignedBamMapper.class);
    halvadeJob.setInputFormatClass(BAMInputFormat.class);
  }
  return runTimedJob(halvadeJob,"String_Node_Str");
}

Fixed version (ground truth):
protected int runHalvadeJob(Configuration halvadeConf,String tmpOutDir,int jobType) throws IOException, URISyntaxException, InterruptedException, ClassNotFoundException {
  String pipeline="String_Node_Str";
  if (jobType == HalvadeResourceManager.RNA_SHMEM_PASS2) {
    HalvadeConf.setIsPass2(halvadeConf,true);
    HalvadeResourceManager.setJobResources(halvadeOpts,halvadeConf,jobType,false,halvadeOpts.useBamInput);
    pipeline=RNA_PASS2;
  }
 else   if (jobType == HalvadeResourceManager.DNA) {
    HalvadeResourceManager.setJobResources(halvadeOpts,halvadeConf,jobType,false,halvadeOpts.useBamInput);
    pipeline=DNA;
  }
  halvadeOpts.splitChromosomes(halvadeConf,0);
  HalvadeConf.setOutDir(halvadeConf,tmpOutDir);
  FileSystem outFs=FileSystem.get(new URI(tmpOutDir),halvadeConf);
  if (outFs.exists(new Path(tmpOutDir))) {
    Logger.INFO("String_Node_Str" + tmpOutDir + "String_Node_Str");
    Logger.INFO("String_Node_Str");
    System.exit(-2);
  }
  if (halvadeOpts.useBamInput)   setHeaderFile(halvadeOpts.in,halvadeConf);
  if (halvadeOpts.rnaPipeline)   HalvadeConf.setPass2Suffix(halvadeConf,pass2suffix);
  Job halvadeJob=Job.getInstance(halvadeConf,"String_Node_Str" + pipeline);
  halvadeJob.addCacheArchive(new URI(halvadeOpts.halvadeBinaries));
  halvadeJob.setJarByClass(be.ugent.intec.halvade.hadoop.mapreduce.HalvadeMapper.class);
  addInputFiles(halvadeOpts.in,halvadeConf,halvadeJob);
  FileOutputFormat.setOutputPath(halvadeJob,new Path(tmpOutDir));
  if (jobType == HalvadeResourceManager.RNA_SHMEM_PASS2) {
    halvadeJob.setMapperClass(be.ugent.intec.halvade.hadoop.mapreduce.StarAlignPassXMapper.class);
    halvadeJob.setReducerClass(be.ugent.intec.halvade.hadoop.mapreduce.RnaGATKReducer.class);
  }
 else   if (jobType == HalvadeResourceManager.DNA) {
    halvadeJob.setMapperClass(halvadeOpts.alignmentTools[halvadeOpts.aln]);
    halvadeJob.setReducerClass(be.ugent.intec.halvade.hadoop.mapreduce.DnaGATKReducer.class);
  }
  halvadeJob.setMapOutputKeyClass(ChromosomeRegion.class);
  halvadeJob.setMapOutputValueClass(SAMRecordWritable.class);
  halvadeJob.setInputFormatClass(HalvadeTextInputFormat.class);
  halvadeJob.setOutputKeyClass(Text.class);
  if (halvadeOpts.mergeBam) {
    halvadeJob.setSortComparatorClass(SimpleChrRegionComparator.class);
    halvadeJob.setOutputValueClass(SAMRecordWritable.class);
  }
 else {
    halvadeJob.setPartitionerClass(ChrRgPartitioner.class);
    halvadeJob.setSortComparatorClass(ChrRgSortComparator.class);
    halvadeJob.setGroupingComparatorClass(ChrRgGroupingComparator.class);
    halvadeJob.setOutputValueClass(VariantContextWritable.class);
  }
  if (halvadeOpts.justAlign && !halvadeOpts.mergeBam)   halvadeJob.setNumReduceTasks(0);
 else   if (halvadeOpts.mergeBam) {
    halvadeJob.setReducerClass(be.ugent.intec.halvade.hadoop.mapreduce.BamMergeReducer.class);
    halvadeJob.setNumReduceTasks(1);
  }
 else {
    halvadeJob.setNumReduceTasks(halvadeOpts.reduces);
    if (halvadeOpts.countOnly) {
      halvadeJob.setReducerClass(be.ugent.intec.halvade.hadoop.mapreduce.CountReadsReducer.class);
      halvadeJob.setOutputValueClass(LongWritable.class);
    }
  }
  if (halvadeOpts.useBamInput) {
    halvadeJob.setMapperClass(be.ugent.intec.halvade.hadoop.mapreduce.AlignedBamMapper.class);
    halvadeJob.setInputFormatClass(BAMInputFormat.class);
  }
  return runTimedJob(halvadeJob,"String_Node_Str");
}