Program: 33522
Project: 33522
Buggy source:
@Override protected int run(CmdLineParser parser){
  final List<String> args=parser.getRemainingArgs();
  if (args.isEmpty()) {
    System.err.println("String_Node_Str");
    return 3;
  }
  if (args.size() == 1) {
    System.err.println("String_Node_Str");
    return 3;
  }
  if (!cacheAndSetProperties(parser))   return 3;
  final SAMFileReader.ValidationStringency stringency=Utils.toStringency(parser.getOptionValue(stringencyOpt),"String_Node_Str");
  if (stringency == null)   return 3;
  Path wrkDir=new Path(args.get(0));
  final List<String> strInputs=args.subList(1,args.size());
  final List<Path> inputs=new ArrayList<Path>(strInputs.size());
  for (  final String in : strInputs)   inputs.add(new Path(in));
  final Configuration conf=getConf();
  Utils.setHeaderMergerSortOrder(conf,SortOrder.coordinate);
  conf.setStrings(Utils.HEADERMERGER_INPUTS_PROPERTY,strInputs.toArray(new String[0]));
  if (stringency != null)   conf.set(SAMHeaderReader.VALIDATION_STRINGENCY_PROPERTY,stringency.toString());
  final String intermediateOutName=(outPath == null ? inputs.get(0) : outPath).getName();
  conf.set(Utils.WORK_FILENAME_PROPERTY,intermediateOutName);
  final Timer t=new Timer();
  try {
    wrkDir=wrkDir.getFileSystem(conf).makeQualified(wrkDir);
    Utils.configureSampling(wrkDir,intermediateOutName,conf);
    final Job job=new Job(conf);
    job.setJarByClass(Sort.class);
    job.setMapperClass(Mapper.class);
    job.setReducerClass(SortReducer.class);
    job.setMapOutputKeyClass(LongWritable.class);
    job.setOutputKeyClass(NullWritable.class);
    job.setOutputValueClass(SAMRecordWritable.class);
    job.setInputFormatClass(SortInputFormat.class);
    job.setOutputFormatClass(CLIMergingAnySAMOutputFormat.class);
    for (    final Path in : inputs)     FileInputFormat.addInputPath(job,in);
    FileOutputFormat.setOutputPath(job,wrkDir);
    job.setPartitionerClass(TotalOrderPartitioner.class);
    System.out.println("String_Node_Str");
    t.start();
    InputSampler.<LongWritable,SAMRecordWritable>writePartitionFile(job,new InputSampler.RandomSampler<LongWritable,SAMRecordWritable>(0.01,10000,Math.max(100,reduceTasks)));
    System.out.printf("String_Node_Str",t.stopS(),t.fms());
    job.submit();
    System.out.println("String_Node_Str");
    t.start();
    if (!job.waitForCompletion(verbose)) {
      System.err.println("String_Node_Str");
      return 4;
    }
    System.out.printf("String_Node_Str",t.stopS(),t.fms());
  }
 catch (  IOException e) {
    System.err.printf("String_Node_Str",e);
    return 4;
  }
catch (  ClassNotFoundException e) {
    throw new RuntimeException(e);
  }
catch (  InterruptedException e) {
    throw new RuntimeException(e);
  }
  if (outPath != null)   try {
    Utils.mergeSAMInto(outPath,wrkDir,"String_Node_Str","String_Node_Str",samFormat,conf,"String_Node_Str");
  }
 catch (  IOException e) {
    System.err.printf("String_Node_Str",e);
    return 5;
  }
  return 0;
}

Fixed version (ground truth):
@Override protected int run(CmdLineParser parser){
  final List<String> args=parser.getRemainingArgs();
  if (args.isEmpty()) {
    System.err.println("String_Node_Str");
    return 3;
  }
  if (args.size() == 1) {
    System.err.println("String_Node_Str");
    return 3;
  }
  if (!cacheAndSetProperties(parser))   return 3;
  final SAMFileReader.ValidationStringency stringency=Utils.toStringency(parser.getOptionValue(stringencyOpt,SAMFileReader.ValidationStringency.DEFAULT_STRINGENCY.toString()),"String_Node_Str");
  if (stringency == null)   return 3;
  Path wrkDir=new Path(args.get(0));
  final List<String> strInputs=args.subList(1,args.size());
  final List<Path> inputs=new ArrayList<Path>(strInputs.size());
  for (  final String in : strInputs)   inputs.add(new Path(in));
  final Configuration conf=getConf();
  Utils.setHeaderMergerSortOrder(conf,SortOrder.coordinate);
  conf.setStrings(Utils.HEADERMERGER_INPUTS_PROPERTY,strInputs.toArray(new String[0]));
  if (stringency != null)   conf.set(SAMHeaderReader.VALIDATION_STRINGENCY_PROPERTY,stringency.toString());
  final String intermediateOutName=(outPath == null ? inputs.get(0) : outPath).getName();
  conf.set(Utils.WORK_FILENAME_PROPERTY,intermediateOutName);
  final Timer t=new Timer();
  try {
    wrkDir=wrkDir.getFileSystem(conf).makeQualified(wrkDir);
    Utils.configureSampling(wrkDir,intermediateOutName,conf);
    final Job job=new Job(conf);
    job.setJarByClass(Sort.class);
    job.setMapperClass(Mapper.class);
    job.setReducerClass(SortReducer.class);
    job.setMapOutputKeyClass(LongWritable.class);
    job.setOutputKeyClass(NullWritable.class);
    job.setOutputValueClass(SAMRecordWritable.class);
    job.setInputFormatClass(SortInputFormat.class);
    job.setOutputFormatClass(CLIMergingAnySAMOutputFormat.class);
    for (    final Path in : inputs)     FileInputFormat.addInputPath(job,in);
    FileOutputFormat.setOutputPath(job,wrkDir);
    job.setPartitionerClass(TotalOrderPartitioner.class);
    System.out.println("String_Node_Str");
    t.start();
    InputSampler.<LongWritable,SAMRecordWritable>writePartitionFile(job,new InputSampler.RandomSampler<LongWritable,SAMRecordWritable>(0.01,10000,Math.max(100,reduceTasks)));
    System.out.printf("String_Node_Str",t.stopS(),t.fms());
    job.submit();
    System.out.println("String_Node_Str");
    t.start();
    if (!job.waitForCompletion(verbose)) {
      System.err.println("String_Node_Str");
      return 4;
    }
    System.out.printf("String_Node_Str",t.stopS(),t.fms());
  }
 catch (  IOException e) {
    System.err.printf("String_Node_Str",e);
    return 4;
  }
catch (  ClassNotFoundException e) {
    throw new RuntimeException(e);
  }
catch (  InterruptedException e) {
    throw new RuntimeException(e);
  }
  if (outPath != null)   try {
    Utils.mergeSAMInto(outPath,wrkDir,"String_Node_Str","String_Node_Str",samFormat,conf,"String_Node_Str");
  }
 catch (  IOException e) {
    System.err.printf("String_Node_Str",e);
    return 5;
  }
  return 0;
}