Program: 141036
Project: 141036
Buggy source:
/** 
 * Create JobConf object for HTSeq-count.
 * @param context the task context
 * @param alignmentsData alignment data
 * @param featureAnnotationData feature annotations data
 * @param gtfFormat true if the annotation file is in GTF format
 * @param genomeDescriptionData genome description data
 * @param genomicType genomic type
 * @param attributeId attributeId
 * @param splitAttributeValues split attribute values
 * @param stranded stranded mode
 * @param overlapMode overlap mode
 * @param removeAmbiguousCases true to remove ambiguous cases
 * @throws IOException if an error occurs while creating job
 * @throws BadBioEntryException if an entry of the annotation file is invalid
 * @throws EoulsanException
 */
private static Job createJobHTSeqCounter(final Configuration parentConf,final TaskContext context,final Data alignmentsData,final Data featureAnnotationData,final boolean gtfFormat,final Data genomeDescriptionData,final Data outData,final String genomicType,final String attributeId,final boolean splitAttributeValues,final StrandUsage stranded,final OverlapMode overlapMode,final boolean removeAmbiguousCases,final boolean tsamFormat) throws IOException, BadBioEntryException, EoulsanException {
  final Configuration jobConf=new Configuration(parentConf);
  DataFile inputDataFile=alignmentsData.getDataFile();
  if (inputDataFile == null) {
    throw new IOException("String_Node_Str");
  }
  final String dataFileSource;
  if (tsamFormat) {
    dataFileSource=StringUtils.filenameWithoutExtension(inputDataFile.getSource()) + TSAM_EXTENSION;
  }
 else {
    dataFileSource=inputDataFile.getSource();
  }
  final Path inputPath=new Path(dataFileSource);
  final DataFile annotationDataFile=featureAnnotationData.getDataFile();
  final DataFile outFile=outData.getDataFile();
  final DataFile tmpFile=new DataFile(outFile.getParent(),outFile.getBasename() + "String_Node_Str");
  getLogger().fine("String_Node_Str" + alignmentsData.getName());
  getLogger().fine("String_Node_Str" + inputPath.getName());
  getLogger().fine("String_Node_Str" + annotationDataFile.getSource());
  getLogger().fine("String_Node_Str" + outFile.getSource());
  getLogger().fine("String_Node_Str" + tmpFile.getSource());
  jobConf.set("String_Node_Str","String_Node_Str");
  jobConf.set(CommonHadoop.COUNTER_GROUP_KEY,COUNTER_GROUP);
  final DataFile genomeDescDataFile=genomeDescriptionData.getDataFile();
  jobConf.set(GENOME_DESC_PATH_KEY,genomeDescDataFile.getSource());
  jobConf.set(HTSeqCountMapper.STRANDED_PARAM,stranded.getName());
  jobConf.set(HTSeqCountMapper.OVERLAP_MODE_PARAM,overlapMode.getName());
  jobConf.setBoolean(HTSeqCountMapper.REMOVE_AMBIGUOUS_CASES,removeAmbiguousCases);
  final Path featuresIndexPath=getAnnotationIndexSerializedPath(featureAnnotationData.getDataFile());
  getLogger().info("String_Node_Str" + featuresIndexPath);
  if (!PathUtils.isFile(featuresIndexPath,jobConf)) {
    final Locker lock=createZookeeperLock(parentConf,context);
    lock.lock();
    createFeaturesIndex(context,annotationDataFile,gtfFormat,genomicType,attributeId,splitAttributeValues,stranded,genomeDescDataFile,featuresIndexPath,jobConf);
    lock.unlock();
  }
  final Job job=Job.getInstance(jobConf,"String_Node_Str" + alignmentsData.getName() + "String_Node_Str"+ inputPath.getName()+ "String_Node_Str"+ annotationDataFile.getSource()+ "String_Node_Str"+ genomicType+ "String_Node_Str"+ attributeId+ "String_Node_Str"+ stranded+ "String_Node_Str"+ removeAmbiguousCases+ "String_Node_Str");
  job.addCacheFile(featuresIndexPath.toUri());
  job.setJarByClass(ExpressionHadoopModule.class);
  FileInputFormat.setInputPaths(job,inputPath);
  job.setInputFormatClass(SAMInputFormat.class);
  job.setMapperClass(HTSeqCountMapper.class);
  job.setCombinerClass(HTSeqCountReducer.class);
  job.setReducerClass(HTSeqCountReducer.class);
  job.setOutputFormatClass(ExpressionOutputFormat.class);
  job.setOutputKeyClass(Text.class);
  job.setOutputValueClass(LongWritable.class);
  FileOutputFormat.setOutputPath(job,new Path(tmpFile.getSource()));
  return job;
}

Fixed version (ground truth):
/** 
 * Create JobConf object for HTSeq-count.
 * @param context the task context
 * @param alignmentsData alignment data
 * @param featureAnnotationData feature annotations data
 * @param gtfFormat true if the annotation file is in GTF format
 * @param genomeDescriptionData genome description data
 * @param genomicType genomic type
 * @param attributeId attributeId
 * @param splitAttributeValues split attribute values
 * @param stranded stranded mode
 * @param overlapMode overlap mode
 * @param removeAmbiguousCases true to remove ambiguous cases
 * @throws IOException if an error occurs while creating job
 * @throws BadBioEntryException if an entry of the annotation file is invalid
 * @throws EoulsanException if the job creating fails
 */
private static Job createJobHTSeqCounter(final Configuration parentConf,final TaskContext context,final Data alignmentsData,final Data featureAnnotationData,final boolean gtfFormat,final Data genomeDescriptionData,final Data outData,final String genomicType,final String attributeId,final boolean splitAttributeValues,final StrandUsage stranded,final OverlapMode overlapMode,final boolean removeAmbiguousCases,final boolean tsamFormat) throws IOException, BadBioEntryException, EoulsanException {
  final Configuration jobConf=new Configuration(parentConf);
  DataFile inputDataFile=alignmentsData.getDataFile();
  if (inputDataFile == null) {
    throw new IOException("String_Node_Str");
  }
  final String dataFileSource;
  if (tsamFormat) {
    dataFileSource=StringUtils.filenameWithoutExtension(inputDataFile.getSource()) + TSAM_EXTENSION;
  }
 else {
    dataFileSource=inputDataFile.getSource();
  }
  final Path inputPath=new Path(dataFileSource);
  final DataFile annotationDataFile=featureAnnotationData.getDataFile();
  final DataFile outFile=outData.getDataFile();
  final DataFile tmpFile=new DataFile(outFile.getParent(),outFile.getBasename() + "String_Node_Str");
  getLogger().fine("String_Node_Str" + alignmentsData.getName());
  getLogger().fine("String_Node_Str" + inputPath.getName());
  getLogger().fine("String_Node_Str" + annotationDataFile.getSource());
  getLogger().fine("String_Node_Str" + outFile.getSource());
  getLogger().fine("String_Node_Str" + tmpFile.getSource());
  jobConf.set("String_Node_Str","String_Node_Str");
  jobConf.set(CommonHadoop.COUNTER_GROUP_KEY,COUNTER_GROUP);
  final DataFile genomeDescDataFile=genomeDescriptionData.getDataFile();
  jobConf.set(GENOME_DESC_PATH_KEY,genomeDescDataFile.getSource());
  jobConf.set(HTSeqCountMapper.STRANDED_PARAM,stranded.getName());
  jobConf.set(HTSeqCountMapper.OVERLAP_MODE_PARAM,overlapMode.getName());
  jobConf.setBoolean(HTSeqCountMapper.REMOVE_AMBIGUOUS_CASES,removeAmbiguousCases);
  final Path featuresIndexPath=getAnnotationIndexSerializedPath(featureAnnotationData.getDataFile());
  getLogger().info("String_Node_Str" + featuresIndexPath);
  if (!PathUtils.isFile(featuresIndexPath,jobConf)) {
    final Locker lock=createZookeeperLock(parentConf,context);
    lock.lock();
    createFeaturesIndex(context,annotationDataFile,gtfFormat,genomicType,attributeId,splitAttributeValues,stranded,genomeDescDataFile,featuresIndexPath,jobConf);
    lock.unlock();
  }
  final Job job=Job.getInstance(jobConf,"String_Node_Str" + alignmentsData.getName() + "String_Node_Str"+ inputPath.getName()+ "String_Node_Str"+ annotationDataFile.getSource()+ "String_Node_Str"+ genomicType+ "String_Node_Str"+ attributeId+ "String_Node_Str"+ stranded+ "String_Node_Str"+ removeAmbiguousCases+ "String_Node_Str");
  job.addCacheFile(featuresIndexPath.toUri());
  job.setJarByClass(ExpressionHadoopModule.class);
  FileInputFormat.setInputPaths(job,inputPath);
  job.setInputFormatClass(SAMInputFormat.class);
  job.setMapperClass(HTSeqCountMapper.class);
  job.setCombinerClass(HTSeqCountReducer.class);
  job.setReducerClass(HTSeqCountReducer.class);
  job.setOutputFormatClass(ExpressionOutputFormat.class);
  job.setOutputKeyClass(Text.class);
  job.setOutputValueClass(LongWritable.class);
  FileOutputFormat.setOutputPath(job,new Path(tmpFile.getSource()));
  return job;
}