Program: 59672
Project: 59672
Buggy source:
@Override public boolean execute(ExecutionContext executionContext) throws ProcessExecutionException, InterruptedException {
  log.info("String_Node_Str");
  Args args=this.getArgs();
  if (!args.getOutputDir().exists()) {
    args.getOutputDir().mkdirs();
  }
  Set<AssemblyAnalyser> requestedServices=new HashSet<>();
  for (  String requestedService : this.getArgs().getAsmAnalyses()) {
    requestedServices.add(this.assemblyAnalyserFactory.create(requestedService,this.getConanProcessService()));
  }
  try {
    List<Integer> jobIds=new ArrayList<>();
    for (    AssemblyAnalyser analyser : requestedServices) {
      for (      MassJob.Args singleMassArgs : args.getMassGroups()) {
        String massGroup=singleMassArgs.getName();
        File inputDir=new File(args.getMassDir(),massGroup);
        if (!inputDir.exists()) {
          throw new ProcessExecutionException(-1,"String_Node_Str" + massGroup + "String_Node_Str"+ inputDir.getAbsolutePath());
        }
        File unitigsDir=new File(inputDir,"String_Node_Str");
        File contigsDir=new File(inputDir,"String_Node_Str");
        File scaffoldsDir=new File(inputDir,"String_Node_Str");
        File outputDir=new File(args.getOutputDir(),massGroup + "String_Node_Str" + analyser.getName().toLowerCase());
        String jobPrefix=this.getArgs().getJobPrefix() + "String_Node_Str" + massGroup+ "String_Node_Str"+ analyser.getName().toLowerCase();
        if (analyser.isFast()) {
          if (unitigsDir.exists()) {
            jobIds.addAll(analyser.execute(AnalyseMassAssemblies.assembliesFromDir(unitigsDir),new File(outputDir,"String_Node_Str"),jobPrefix + "String_Node_Str",this.getArgs(),this.conanExecutorService));
          }
          if (contigsDir.exists()) {
            jobIds.addAll(analyser.execute(AnalyseMassAssemblies.assembliesFromDir(contigsDir),new File(outputDir,"String_Node_Str"),jobPrefix + "String_Node_Str",this.getArgs(),this.conanExecutorService));
          }
          if (scaffoldsDir.exists()) {
            jobIds.addAll(analyser.execute(AnalyseMassAssemblies.assembliesFromDir(scaffoldsDir),new File(outputDir,"String_Node_Str"),jobPrefix + "String_Node_Str",this.getArgs(),this.conanExecutorService));
          }
        }
 else {
          File seqDir=null;
          if (scaffoldsDir.exists()) {
            seqDir=scaffoldsDir;
          }
 else           if (contigsDir.exists()) {
            seqDir=contigsDir;
          }
 else           if (unitigsDir.exists()) {
            seqDir=unitigsDir;
          }
 else {
            throw new ProcessExecutionException(-2,"String_Node_Str" + massGroup);
          }
          jobIds.addAll(analyser.execute(AnalyseMassAssemblies.assembliesFromDir(seqDir),outputDir,jobPrefix,this.getArgs(),this.conanExecutorService));
        }
      }
    }
    if (this.conanExecutorService.usingScheduler() && args.isRunParallel() && !jobIds.isEmpty()) {
      log.debug("String_Node_Str");
      this.conanExecutorService.executeScheduledWait(jobIds,args.getJobPrefix() + "String_Node_Str",ExitStatus.Type.COMPLETED_ANY,args.getJobPrefix() + "String_Node_Str",args.getOutputDir());
    }
  }
 catch (  ConanParameterException|IOException e) {
    throw new ProcessExecutionException(4,e);
  }
  try {
    AssemblyStatsTable table=new AssemblyStatsTable();
    int index=0;
    for (    MassJob.Args jobArgs : args.getMassGroups()) {
      File asmDir=this.getAssemblyDir(new File(args.getMassDir(),jobArgs.getName()));
      for (      Assembler assembler : jobArgs.getAssemblers()) {
        AssemblyStats stats=new AssemblyStats();
        stats.setIndex(index++);
        stats.setDataset(jobArgs.getName());
        stats.setDesc(assembler.getAssemblerArgs().getOutputDir().getName());
        stats.setFilePath(this.getAssemblyFile(assembler,asmDir).getAbsolutePath());
        stats.setBubblePath(assembler.getBubbleFile() != null ? assembler.getBubbleFile().getAbsolutePath() : "String_Node_Str");
        table.add(stats);
      }
    }
    for (    AssemblyAnalyser analyser : requestedServices) {
      for (      MassJob.Args jobArgs : args.getMassGroups()) {
        String massGroup=jobArgs.getName();
        File asmDir=this.getAssemblyDir(new File(args.getMassDir(),massGroup));
        File reportDir=new File(args.getOutputDir(),massGroup + "String_Node_Str" + analyser.getName().toLowerCase());
        analyser.updateTable(table,assembliesFromDir(asmDir),analyser.isFast() ? new File(reportDir,asmDir.getName()) : reportDir,massGroup);
      }
    }
    AssemblySelector assemblySelector=new DefaultAssemblySelector(args.getWeightings());
    AssemblyStats selectedAssembly=assemblySelector.selectAssembly(table,args.getOrganism().getEstGenomeSize(),args.getOrganism().getEstGcPercentage(),args.getMassDir());
    File massGroupDir=new File(args.getMassDir(),selectedAssembly.getDataset());
    File bestAssembly=new File(selectedAssembly.getFilePath());
    File bubbles=new File(selectedAssembly.getBubblePath());
    File bestAssemblyLink=new File(args.getOutputDir(),"String_Node_Str");
    File bubblesLink=new File(args.getOutputDir(),"String_Node_Str");
    log.info("String_Node_Str" + bestAssembly.getAbsolutePath());
    this.getConanProcessService().createLocalSymbolicLink(bestAssembly,bestAssemblyLink);
    if (bubbles != null && bubbles.exists()) {
      this.getConanProcessService().createLocalSymbolicLink(bubbles,bubblesLink);
    }
    File finalFile=new File(args.getOutputDir(),"String_Node_Str");
    table.save(finalFile);
    log.debug("String_Node_Str" + finalFile.getAbsolutePath());
  }
 catch (  IOException ioe) {
    throw new ProcessExecutionException(5,ioe);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean execute(ExecutionContext executionContext) throws ProcessExecutionException, InterruptedException {
  log.info("String_Node_Str");
  Args args=this.getArgs();
  if (!args.getOutputDir().exists()) {
    args.getOutputDir().mkdirs();
  }
  Set<AssemblyAnalyser> requestedServices=new HashSet<>();
  for (  String requestedService : this.getArgs().getAsmAnalyses()) {
    requestedServices.add(this.assemblyAnalyserFactory.create(requestedService,this.getConanProcessService()));
  }
  try {
    List<Integer> jobIds=new ArrayList<>();
    for (    AssemblyAnalyser analyser : requestedServices) {
      for (      MassJob.Args singleMassArgs : args.getMassJobs()) {
        String massGroup=singleMassArgs.getName();
        File inputDir=new File(args.getMassDir(),massGroup);
        if (!inputDir.exists()) {
          throw new ProcessExecutionException(-1,"String_Node_Str" + massGroup + "String_Node_Str"+ inputDir.getAbsolutePath());
        }
        File unitigsDir=new File(inputDir,"String_Node_Str");
        File contigsDir=new File(inputDir,"String_Node_Str");
        File scaffoldsDir=new File(inputDir,"String_Node_Str");
        File outputDir=new File(args.getOutputDir(),massGroup + "String_Node_Str" + analyser.getName().toLowerCase());
        String jobPrefix=this.getArgs().getJobPrefix() + "String_Node_Str" + massGroup+ "String_Node_Str"+ analyser.getName().toLowerCase();
        if (analyser.isFast()) {
          if (unitigsDir.exists()) {
            jobIds.addAll(analyser.execute(AnalyseMassAssemblies.assembliesFromDir(unitigsDir),new File(outputDir,"String_Node_Str"),jobPrefix + "String_Node_Str",this.getArgs(),this.conanExecutorService));
          }
          if (contigsDir.exists()) {
            jobIds.addAll(analyser.execute(AnalyseMassAssemblies.assembliesFromDir(contigsDir),new File(outputDir,"String_Node_Str"),jobPrefix + "String_Node_Str",this.getArgs(),this.conanExecutorService));
          }
          if (scaffoldsDir.exists()) {
            jobIds.addAll(analyser.execute(AnalyseMassAssemblies.assembliesFromDir(scaffoldsDir),new File(outputDir,"String_Node_Str"),jobPrefix + "String_Node_Str",this.getArgs(),this.conanExecutorService));
          }
        }
 else {
          File seqDir=null;
          if (scaffoldsDir.exists()) {
            seqDir=scaffoldsDir;
          }
 else           if (contigsDir.exists()) {
            seqDir=contigsDir;
          }
 else           if (unitigsDir.exists()) {
            seqDir=unitigsDir;
          }
 else {
            throw new ProcessExecutionException(-2,"String_Node_Str" + massGroup);
          }
          jobIds.addAll(analyser.execute(AnalyseMassAssemblies.assembliesFromDir(seqDir),outputDir,jobPrefix,this.getArgs(),this.conanExecutorService));
        }
      }
    }
    if (this.conanExecutorService.usingScheduler() && args.isRunParallel() && !jobIds.isEmpty()) {
      log.debug("String_Node_Str");
      this.conanExecutorService.executeScheduledWait(jobIds,args.getJobPrefix() + "String_Node_Str",ExitStatus.Type.COMPLETED_ANY,args.getJobPrefix() + "String_Node_Str",args.getOutputDir());
    }
  }
 catch (  ConanParameterException|IOException e) {
    throw new ProcessExecutionException(4,e);
  }
  try {
    AssemblyStatsTable table=this.createTable();
    for (    AssemblyAnalyser analyser : requestedServices) {
      for (      MassJob.Args jobArgs : args.getMassJobs()) {
        String massGroup=jobArgs.getName();
        File asmDir=this.getAssemblyDir(new File(args.getMassDir(),massGroup));
        File reportDir=new File(args.getOutputDir(),massGroup + "String_Node_Str" + analyser.getName().toLowerCase());
        analyser.updateTable(table,assembliesFromDir(asmDir),analyser.isFast() ? new File(reportDir,asmDir.getName()) : reportDir,massGroup);
      }
    }
    AssemblySelector assemblySelector=new DefaultAssemblySelector(args.getWeightings());
    AssemblyStats selectedAssembly=assemblySelector.selectAssembly(table,args.getOrganism().getEstGenomeSize(),args.getOrganism().getEstGcPercentage(),args.getMassDir());
    File massGroupDir=new File(args.getMassDir(),selectedAssembly.getDataset());
    File bestAssembly=new File(selectedAssembly.getFilePath());
    File bubbles=new File(selectedAssembly.getBubblePath());
    File bestAssemblyLink=new File(args.getOutputDir(),"String_Node_Str");
    File bubblesLink=new File(args.getOutputDir(),"String_Node_Str");
    log.info("String_Node_Str" + bestAssembly.getAbsolutePath());
    this.getConanProcessService().createLocalSymbolicLink(bestAssembly,bestAssemblyLink);
    if (bubbles != null && bubbles.exists()) {
      this.getConanProcessService().createLocalSymbolicLink(bubbles,bubblesLink);
    }
    File finalFile=new File(args.getOutputDir(),"String_Node_Str");
    table.save(finalFile);
    log.debug("String_Node_Str" + finalFile.getAbsolutePath());
  }
 catch (  IOException ioe) {
    throw new ProcessExecutionException(5,ioe);
  }
  return true;
}