Program: 59660
Project: 59660
Buggy source:
public Args(Element element,List<Library> libs,Organism organism,RampartJobFileSystem rjfs,String jobPrefix,String institution,RampartStageList stages,boolean doInitialChecks,File ampInput,File ampBubble) throws IOException {
  this();
  if (!XmlHelper.validate(element,new String[0],new String[0],new String[0],new String[]{KEY_ELEM_MECQ,KEY_ELEM_ANALYSE_READS,KEY_ELEM_KMER_CALC,KEY_ELEM_MASS,KEY_ELEM_ANALYSE_MASS,KEY_ELEM_SELECT_MASS,KEY_ELEM_AMP,KEY_ELEM_ANALYSE_AMP,KEY_ELEM_FINALISE})) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.libs=libs;
  this.organism=organism;
  this.rampartJobFileSystem=rjfs;
  this.jobPrefix=jobPrefix;
  this.institution=institution;
  this.stages=stages;
  this.doInitialChecks=doInitialChecks;
  this.ampInput=ampInput;
  this.ampBubble=ampBubble;
  Element mecqElement=XmlHelper.getDistinctElementByName(element,KEY_ELEM_MECQ);
  this.mecqArgs=mecqElement == null ? null : new Mecq.Args(mecqElement,this.rampartJobFileSystem.getMeqcDir(),this.jobPrefix + "String_Node_Str",this.libs);
  this.stages.setArgsIfPresent(RampartStage.MECQ,this.mecqArgs);
  Element analyseReadsElement=XmlHelper.getDistinctElementByName(element,KEY_ELEM_ANALYSE_READS);
  this.analyseReadsArgs=analyseReadsElement == null ? null : new AnalyseReads.Args(analyseReadsElement,this.libs,this.mecqArgs == null ? new ArrayList<Mecq.EcqArgs>() : this.mecqArgs.getEqcArgList(),this.jobPrefix + "String_Node_Str",this.rampartJobFileSystem.getMeqcDir(),this.rampartJobFileSystem.getAnalyseReadsDir(),this.organism);
  this.stages.setArgsIfPresent(RampartStage.ANALYSE_READS,this.analyseReadsArgs);
  Element kmerCalcElement=XmlHelper.getDistinctElementByName(element,KEY_ELEM_KMER_CALC);
  this.kmerCalcArgs=kmerCalcElement == null ? null : new CalcOptimalKmer.Args(kmerCalcElement,this.rampartJobFileSystem.getKmerCalcDir(),this.jobPrefix + "String_Node_Str",this.organism.getPloidy());
  this.stages.setArgsIfPresent(RampartStage.KMER_CALC,this.kmerCalcArgs);
  Element massElement=XmlHelper.getDistinctElementByName(element,KEY_ELEM_MASS);
  this.massArgs=massElement == null ? null : new Mass.Args(massElement,this.rampartJobFileSystem.getMassDir(),this.rampartJobFileSystem.getMeqcDir(),this.jobPrefix + "String_Node_Str",this.libs,this.mecqArgs == null ? new ArrayList<Mecq.EcqArgs>() : this.mecqArgs.getEqcArgList(),this.organism);
  this.stages.setArgsIfPresent(RampartStage.MASS,this.massArgs);
  if (this.kmerCalcArgs != null && this.massArgs != null) {
    this.kmerCalcArgs.setMassJobArgList(this.massArgs.getMassJobArgList());
    this.massArgs.setKmerCalcArgs(this.kmerCalcArgs);
  }
  if (this.kmerCalcArgs != null) {
    this.kmerCalcArgs.initialise();
  }
  if (this.massArgs != null) {
    this.massArgs.initialise();
  }
  Element analyseMassElement=XmlHelper.getDistinctElementByName(element,KEY_ELEM_ANALYSE_MASS);
  this.analyseMassArgs=analyseMassElement == null ? null : new AnalyseMassAssemblies.Args(analyseMassElement,this.rampartJobFileSystem.getMassDir(),this.analyseReadsArgs != null ? this.rampartJobFileSystem.getAnalyseReadsDir() : null,this.rampartJobFileSystem.getAnalyseMassDir(),this.massArgs == null ? null : this.massArgs.getMassJobArgList(),this.organism,this.jobPrefix + "String_Node_Str",this.kmerCalcArgs == null ? null : this.kmerCalcArgs.getResultFile());
  this.stages.setArgsIfPresent(RampartStage.ANALYSE_MASS,this.analyseMassArgs);
  Element selectMassElement=XmlHelper.getDistinctElementByName(element,KEY_ELEM_SELECT_MASS);
  this.selectMassArgs=selectMassElement == null ? null : new Select.Args(selectMassElement,this.rampartJobFileSystem.getAnalyseMassDir(),this.analyseMassArgs.getAssemblyLinkageFile(),this.rampartJobFileSystem.getSelectMassDir(),this.massArgs == null ? null : this.massArgs.getMassJobArgList(),new ArrayList<>(this.analyseMassArgs.getAssemblyAnalysers()),this.organism,this.jobPrefix + "String_Node_Str");
  this.stages.setArgsIfPresent(RampartStage.SELECT_MASS,this.selectMassArgs);
  Element ampElement=XmlHelper.getDistinctElementByName(element,KEY_ELEM_AMP);
  this.ampArgs=ampElement == null ? null : new Amp.Args(ampElement,this.rampartJobFileSystem.getAmpDir(),this.jobPrefix + "String_Node_Str",this.ampInput != null ? this.ampInput : this.rampartJobFileSystem.getSelectedAssemblyFile(),this.organism.getPloidy() > 1 ? this.ampBubble != null ? this.ampBubble : this.rampartJobFileSystem.getSelectedBubbleFile() : null,this.libs,this.mecqArgs == null ? new ArrayList<Mecq.EcqArgs>() : this.mecqArgs.getEqcArgList(),this.organism);
  this.stages.setArgsIfPresent(RampartStage.AMP,this.ampArgs);
  Element analyseAmpElement=XmlHelper.getDistinctElementByName(element,KEY_ELEM_ANALYSE_AMP);
  this.analyseAmpArgs=analyseAmpElement == null ? null : new AnalyseAmpAssemblies.Args(analyseAmpElement,this.analyseReadsArgs != null ? this.rampartJobFileSystem.getAnalyseReadsDir() : null,this.rampartJobFileSystem.getAnalyseAmpDir(),this.ampArgs == null ? null : this.ampArgs.getStageArgsList(),this.organism,this.jobPrefix + "String_Node_Str");
  this.stages.setArgsIfPresent(RampartStage.ANALYSE_AMP,this.analyseAmpArgs);
  File finalAssembly=this.ampArgs == null ? this.rampartJobFileSystem.getSelectedAssemblyFile() : this.ampArgs.getFinalAssembly();
  Element finaliseElement=XmlHelper.getDistinctElementByName(element,KEY_ELEM_FINALISE);
  this.finaliseArgs=finaliseElement == null ? null : new Finalise.Args(finaliseElement,finalAssembly,this.rampartJobFileSystem.getFinalDir(),this.jobPrefix + "String_Node_Str",this.organism,this.institution);
  this.stages.setArgsIfPresent(RampartStage.FINALISE,this.finaliseArgs);
}

Fixed version (ground truth):
public Args(Element element,List<Library> libs,Organism organism,RampartJobFileSystem rjfs,String jobPrefix,String institution,RampartStageList stages,boolean doInitialChecks,File ampInput,File ampBubble) throws IOException {
  this();
  if (!XmlHelper.validate(element,new String[0],new String[0],new String[0],new String[]{KEY_ELEM_MECQ,KEY_ELEM_ANALYSE_READS,KEY_ELEM_KMER_CALC,KEY_ELEM_MASS,KEY_ELEM_ANALYSE_MASS,KEY_ELEM_SELECT_MASS,KEY_ELEM_AMP,KEY_ELEM_ANALYSE_AMP,KEY_ELEM_FINALISE})) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.libs=libs;
  this.organism=organism;
  this.rampartJobFileSystem=rjfs;
  this.jobPrefix=jobPrefix;
  this.institution=institution;
  this.stages=stages;
  this.doInitialChecks=doInitialChecks;
  this.ampInput=ampInput;
  this.ampBubble=ampBubble;
  Element mecqElement=XmlHelper.getDistinctElementByName(element,KEY_ELEM_MECQ);
  this.mecqArgs=mecqElement == null ? null : new Mecq.Args(mecqElement,this.rampartJobFileSystem.getMeqcDir(),this.jobPrefix + "String_Node_Str",this.libs);
  this.stages.setArgsIfPresent(RampartStage.MECQ,this.mecqArgs);
  Element analyseReadsElement=XmlHelper.getDistinctElementByName(element,KEY_ELEM_ANALYSE_READS);
  this.analyseReadsArgs=analyseReadsElement == null ? null : new AnalyseReads.Args(analyseReadsElement,this.libs,this.mecqArgs == null ? new ArrayList<Mecq.EcqArgs>() : this.mecqArgs.getEqcArgList(),this.jobPrefix + "String_Node_Str",this.rampartJobFileSystem.getMeqcDir(),this.rampartJobFileSystem.getAnalyseReadsDir(),this.organism);
  this.stages.setArgsIfPresent(RampartStage.ANALYSE_READS,this.analyseReadsArgs);
  Element kmerCalcElement=XmlHelper.getDistinctElementByName(element,KEY_ELEM_KMER_CALC);
  this.kmerCalcArgs=kmerCalcElement == null ? null : new CalcOptimalKmer.Args(kmerCalcElement,this.rampartJobFileSystem.getKmerCalcDir(),this.jobPrefix + "String_Node_Str",this.organism.getPloidy());
  this.stages.setArgsIfPresent(RampartStage.KMER_CALC,this.kmerCalcArgs);
  Element massElement=XmlHelper.getDistinctElementByName(element,KEY_ELEM_MASS);
  this.massArgs=massElement == null ? null : new Mass.Args(massElement,this.rampartJobFileSystem.getMassDir(),this.rampartJobFileSystem.getMeqcDir(),this.jobPrefix + "String_Node_Str",this.libs,this.mecqArgs == null ? new ArrayList<Mecq.EcqArgs>() : this.mecqArgs.getEqcArgList(),this.organism);
  this.stages.setArgsIfPresent(RampartStage.MASS,this.massArgs);
  if (this.kmerCalcArgs != null && this.massArgs != null) {
    this.kmerCalcArgs.setMassJobArgList(this.massArgs.getMassJobArgList());
    this.massArgs.setKmerCalcArgs(this.kmerCalcArgs);
  }
  if (this.kmerCalcArgs != null) {
    this.kmerCalcArgs.initialise();
  }
  if (this.massArgs != null) {
    this.massArgs.initialise();
  }
  Element analyseMassElement=XmlHelper.getDistinctElementByName(element,KEY_ELEM_ANALYSE_MASS);
  this.analyseMassArgs=analyseMassElement == null ? null : new AnalyseMassAssemblies.Args(analyseMassElement,this.rampartJobFileSystem.getMassDir(),this.analyseReadsArgs != null ? this.rampartJobFileSystem.getAnalyseReadsDir() : null,this.rampartJobFileSystem.getAnalyseMassDir(),this.massArgs == null ? null : this.massArgs.getMassJobArgList(),this.organism,this.jobPrefix + "String_Node_Str",this.kmerCalcArgs == null ? null : this.kmerCalcArgs.getResultFile(),this.analyseReadsArgs.isKmerAnalysis());
  this.stages.setArgsIfPresent(RampartStage.ANALYSE_MASS,this.analyseMassArgs);
  Element selectMassElement=XmlHelper.getDistinctElementByName(element,KEY_ELEM_SELECT_MASS);
  this.selectMassArgs=selectMassElement == null ? null : new Select.Args(selectMassElement,this.rampartJobFileSystem.getAnalyseMassDir(),this.analyseMassArgs.getAssemblyLinkageFile(),this.rampartJobFileSystem.getSelectMassDir(),this.massArgs == null ? null : this.massArgs.getMassJobArgList(),new ArrayList<>(this.analyseMassArgs.getAssemblyAnalysers()),this.organism,this.jobPrefix + "String_Node_Str");
  this.stages.setArgsIfPresent(RampartStage.SELECT_MASS,this.selectMassArgs);
  Element ampElement=XmlHelper.getDistinctElementByName(element,KEY_ELEM_AMP);
  this.ampArgs=ampElement == null ? null : new Amp.Args(ampElement,this.rampartJobFileSystem.getAmpDir(),this.jobPrefix + "String_Node_Str",this.ampInput != null ? this.ampInput : this.rampartJobFileSystem.getSelectedAssemblyFile(),this.organism.getPloidy() > 1 ? this.ampBubble != null ? this.ampBubble : this.rampartJobFileSystem.getSelectedBubbleFile() : null,this.libs,this.mecqArgs == null ? new ArrayList<Mecq.EcqArgs>() : this.mecqArgs.getEqcArgList(),this.organism);
  this.stages.setArgsIfPresent(RampartStage.AMP,this.ampArgs);
  Element analyseAmpElement=XmlHelper.getDistinctElementByName(element,KEY_ELEM_ANALYSE_AMP);
  this.analyseAmpArgs=analyseAmpElement == null ? null : new AnalyseAmpAssemblies.Args(analyseAmpElement,this.analyseReadsArgs != null ? this.rampartJobFileSystem.getAnalyseReadsDir() : null,this.rampartJobFileSystem.getAnalyseAmpDir(),this.ampArgs == null ? null : this.ampArgs.getStageArgsList(),this.organism,this.jobPrefix + "String_Node_Str",this.analyseReadsArgs.isKmerAnalysis());
  this.stages.setArgsIfPresent(RampartStage.ANALYSE_AMP,this.analyseAmpArgs);
  File finalAssembly=this.ampArgs == null ? this.rampartJobFileSystem.getSelectedAssemblyFile() : this.ampArgs.getFinalAssembly();
  Element finaliseElement=XmlHelper.getDistinctElementByName(element,KEY_ELEM_FINALISE);
  this.finaliseArgs=finaliseElement == null ? null : new Finalise.Args(finaliseElement,finalAssembly,this.rampartJobFileSystem.getFinalDir(),this.jobPrefix + "String_Node_Str",this.organism,this.institution);
  this.stages.setArgsIfPresent(RampartStage.FINALISE,this.finaliseArgs);
}