Program: 59746
Project: 59746
Buggy source:
/** 
 * Dispatches assembly jobs to the specified environments
 * @param executionContext The environment to dispatch jobs too
 * @throws IOException
 * @throws IllegalArgumentException
 * @throws ProcessExecutionException
 * @throws InterruptedException
 */
@Override public boolean execute(ExecutionContext executionContext) throws ProcessExecutionException, InterruptedException {
  try {
    SingleMassArgs args=(SingleMassArgs)this.getProcessArgs();
    RampartConfiguration config=new RampartConfiguration();
    config.load(args.getConfig());
    args.validateKmers(args.getKmin(),args.getKmax());
    args.getAssembler().getArgs().setLibraries(args.getLibs());
    ExecutionContext asmExeCtx=createAssemblerExecutionContext(executionContext);
    createSupportDirectories();
    for (int k=getFirstValidKmer(args.getKmin()); k <= args.getKmax(); k=nextKmer(k)) {
      File kDir=new File(args.getOutputDir(),String.valueOf(k));
      if (kDir.exists()) {
        FileUtils.deleteDirectory(kDir);
      }
      kDir.mkdir();
      args.getAssembler().getArgs().setKmer(k);
      if (asmExeCtx.usingScheduler()) {
        asmExeCtx.getScheduler().getArgs().setJobName(args.getJobPrefix() + "String_Node_Str" + k);
      }
      this.conanProcessService.execute(args.getAssembler(),asmExeCtx);
    }
    if (asmExeCtx.usingScheduler() && !asmExeCtx.isForegroundJob()) {
      this.conanProcessService.waitFor(asmExeCtx.getScheduler().createWaitCondition(ExitStatus.Type.COMPLETED_SUCCESS,args.getJobPrefix() + "String_Node_Str"),asmExeCtx);
    }
    this.dispatchStatsJob(executionContext);
  }
 catch (  IOException ioe) {
    throw new ProcessExecutionException(-1,ioe);
  }
catch (  CommandExecutionException cee) {
    throw new ProcessExecutionException(-2,cee);
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Dispatches assembly jobs to the specified environments
 * @param executionContext The environment to dispatch jobs too
 * @throws IOException
 * @throws IllegalArgumentException
 * @throws ProcessExecutionException
 * @throws InterruptedException
 */
@Override public boolean execute(ExecutionContext executionContext) throws ProcessExecutionException, InterruptedException {
  try {
    SingleMassArgs args=(SingleMassArgs)this.getProcessArgs();
    RampartConfiguration config=new RampartConfiguration();
    config.load(args.getConfig());
    args.validateKmers(args.getKmin(),args.getKmax());
    args.getAssembler().getArgs().setLibraries(args.getLibs());
    ExecutionContext asmExeCtx=createAssemblerExecutionContext(executionContext);
    createSupportDirectories();
    for (int k=getFirstValidKmer(args.getKmin()); k <= args.getKmax(); k=nextKmer(k)) {
      File kDir=new File(args.getOutputDir(),String.valueOf(k));
      if (kDir.exists()) {
        FileUtils.deleteDirectory(kDir);
      }
      kDir.mkdir();
      args.getAssembler().getArgs().setKmer(k);
      if (asmExeCtx.usingScheduler()) {
        String jobName=args.getJobPrefix() + "String_Node_Str" + k;
        asmExeCtx.getScheduler().getArgs().setJobName(jobName);
        asmExeCtx.getScheduler().getArgs().setMonitorFile(new File(((SingleMassArgs)this.getProcessArgs()).getOutputDir(),jobName + "String_Node_Str"));
      }
      this.conanProcessService.execute(args.getAssembler(),asmExeCtx);
    }
    if (asmExeCtx.usingScheduler() && !asmExeCtx.isForegroundJob()) {
      this.conanProcessService.waitFor(asmExeCtx.getScheduler().createWaitCondition(ExitStatus.Type.COMPLETED_SUCCESS,args.getJobPrefix() + "String_Node_Str"),asmExeCtx);
    }
    this.dispatchStatsJob(executionContext);
  }
 catch (  IOException ioe) {
    throw new ProcessExecutionException(-1,ioe);
  }
catch (  CommandExecutionException cee) {
    throw new ProcessExecutionException(-2,cee);
  }
  return true;
}