Program: 13742
Project: 13742
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);
    pipeline=RNA_PASS2;
  }
 else   if (jobType == HalvadeResourceManager.RNA) {
    HalvadeResourceManager.setJobResources(halvadeOpts,halvadeConf,jobType,false);
    pipeline=RNA;
  }
 else   if (jobType == HalvadeResourceManager.DNA) {
    HalvadeResourceManager.setJobResources(halvadeOpts,halvadeConf,jobType,false);
    pipeline=DNA;
  }
  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);
  }
  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.RNA) {
    halvadeJob.setMapperClass(be.ugent.intec.halvade.hadoop.mapreduce.StarAlignMapper.class);
    halvadeJob.setReducerClass(be.ugent.intec.halvade.hadoop.mapreduce.RnaGATKReducer.class);
  }
 else   if (jobType == HalvadeResourceManager.DNA) {
    if (halvadeOpts.aln)     halvadeJob.setMapperClass(be.ugent.intec.halvade.hadoop.mapreduce.BWAAlnMapper.class);
 else     halvadeJob.setMapperClass(be.ugent.intec.halvade.hadoop.mapreduce.BWAMemMapper.class);
    halvadeJob.setReducerClass(be.ugent.intec.halvade.hadoop.mapreduce.DnaGATKReducer.class);
  }
  if (halvadeOpts.justAlign)   halvadeJob.setNumReduceTasks(0);
 else   halvadeJob.setNumReduceTasks(halvadeOpts.reduces);
  halvadeJob.setMapOutputKeyClass(ChromosomeRegion.class);
  halvadeJob.setMapOutputValueClass(SAMRecordWritable.class);
  halvadeJob.setInputFormatClass(HalvadeTextInputFormat.class);
  halvadeJob.setPartitionerClass(ChrRgPartitioner.class);
  halvadeJob.setSortComparatorClass(ChrRgSortComparator.class);
  halvadeJob.setGroupingComparatorClass(ChrRgGroupingComparator.class);
  halvadeJob.setOutputKeyClass(Text.class);
  halvadeJob.setOutputValueClass(VariantContextWritable.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);
    pipeline=RNA_PASS2;
  }
 else   if (jobType == HalvadeResourceManager.RNA) {
    HalvadeResourceManager.setJobResources(halvadeOpts,halvadeConf,jobType,false);
    pipeline=RNA;
  }
 else   if (jobType == HalvadeResourceManager.DNA) {
    HalvadeResourceManager.setJobResources(halvadeOpts,halvadeConf,jobType,false);
    pipeline=DNA;
  }
  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);
  }
  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.RNA) {
    halvadeJob.setMapperClass(be.ugent.intec.halvade.hadoop.mapreduce.StarAlignMapper.class);
    halvadeJob.setReducerClass(be.ugent.intec.halvade.hadoop.mapreduce.RnaGATKReducer.class);
  }
 else   if (jobType == HalvadeResourceManager.DNA) {
    if (halvadeOpts.aln)     halvadeJob.setMapperClass(be.ugent.intec.halvade.hadoop.mapreduce.BWAAlnMapper.class);
 else     halvadeJob.setMapperClass(be.ugent.intec.halvade.hadoop.mapreduce.BWAMemMapper.class);
    halvadeJob.setReducerClass(be.ugent.intec.halvade.hadoop.mapreduce.DnaGATKReducer.class);
  }
  if (halvadeOpts.justAlign)   halvadeJob.setNumReduceTasks(0);
 else   halvadeJob.setNumReduceTasks(halvadeOpts.reduces);
  halvadeJob.setMapOutputKeyClass(ChromosomeRegion.class);
  halvadeJob.setMapOutputValueClass(SAMRecordWritable.class);
  halvadeJob.setInputFormatClass(HalvadeTextInputFormat.class);
  halvadeJob.setPartitionerClass(ChrRgPartitioner.class);
  halvadeJob.setSortComparatorClass(ChrRgSortComparator.class);
  halvadeJob.setGroupingComparatorClass(ChrRgGroupingComparator.class);
  halvadeJob.setOutputKeyClass(Text.class);
  halvadeJob.setOutputValueClass(VariantContextWritable.class);
  if (halvadeOpts.useBamInput) {
    halvadeJob.setMapperClass(be.ugent.intec.halvade.hadoop.mapreduce.AlignedBamMapper.class);
    halvadeJob.setInputFormatClass(BAMInputFormat.class);
  }
  return runTimedJob(halvadeJob,"String_Node_Str");
}