nus-yam/ex-repair huggingface dataset:
Program: 59643
Project: 59643
Buggy source:
@SuppressWarnings("String_Node_Str") public static void main(String[] args){
  ODataConsumer.dump.requestHeaders(true);
  Enumerable<String> smallServices=Enumerable.create(ODataEndpoints.NORTHWIND,ODataEndpoints.ODATA4JSAMPLE_APPSPOT,ODataEndpoints.ODATA_WEBSITE_DATA,ODataEndpoints.ODATA_TEST_SERVICE_READONLY,ODataEndpoints.NERD_DINNER,ODataEndpoints.MIX10,ODataEndpoints.TECH_ED,ODataEndpoints.EU_TECH_ED,ODataEndpoints.PLURALSIGHT,ODataEndpoints.TELERIK_TV,ODataEndpoints.AGILITRAIN,ODataEndpoints.PROAGORA_FR,ODataEndpoints.PROAGORA_EN);
  Enumerable<String> brokenServices=Enumerable.create(ODataEndpoints.CITY_OF_EDMONTON,ODataEndpoints.DEVEXPRESS,ODataEndpoints.DEVTRANSIT,ODataEndpoints.LOGMYTIME);
  Enumerable<String> largeServices=Enumerable.create(ODataEndpoints.BASEBALL_STATS,ODataEndpoints.NETFLIX,ODataEndpoints.STACK_OVERFLOW,ODataEndpoints.SUPER_USER,ODataEndpoints.SERVER_FAULT,ODataEndpoints.META_STACK_OVERFLOW,ODataEndpoints.WORLD_CUP);
  for (  String endpoint : smallServices) {
    ODataConsumer c=ODataConsumer.create(endpoint);
    for (    String entitySet : c.getEntitySets()) {
      reportEntities(entitySet,c.getEntities(entitySet).execute());
    }
    return;
  }
  for (  String endpoint : largeServices) {
    ODataConsumer c=ODataConsumer.create(endpoint);
    for (    String entitySet : c.getEntitySets()) {
      reportEntities(entitySet,c.getEntities(entitySet).top(1).execute());
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static void main(String[] args){
  ODataConsumer.dump.requestHeaders(true);
  Enumerable<String> smallServices=Enumerable.create(ODataEndpoints.NORTHWIND,ODataEndpoints.ODATA4JSAMPLE_APPSPOT,ODataEndpoints.ODATA_WEBSITE_DATA,ODataEndpoints.ODATA_TEST_SERVICE_READONLY,ODataEndpoints.NERD_DINNER,ODataEndpoints.TECH_ED,ODataEndpoints.EU_TECH_ED,ODataEndpoints.PLURALSIGHT,ODataEndpoints.TELERIK_TV,ODataEndpoints.AGILITRAIN,ODataEndpoints.PROAGORA_FR,ODataEndpoints.PROAGORA_EN,ODataEndpoints.INETA_LIVE);
  Enumerable<String> brokenServices=Enumerable.create(ODataEndpoints.CITY_OF_EDMONTON,ODataEndpoints.DEVEXPRESS,ODataEndpoints.DEVTRANSIT,ODataEndpoints.LOGMYTIME,ODataEndpoints.PDC_2010,ODataEndpoints.MIX10);
  Enumerable<String> largeServices=Enumerable.create(ODataEndpoints.BASEBALL_STATS,ODataEndpoints.NETFLIX,ODataEndpoints.WORLD_CUP);
  for (  String endpoint : smallServices) {
    ODataConsumer c=ODataConsumer.create(endpoint);
    for (    String entitySet : c.getEntitySets()) {
      reportEntities(entitySet,c.getEntities(entitySet).execute());
    }
  }
  for (  String endpoint : largeServices) {
    ODataConsumer c=ODataConsumer.create(endpoint);
    for (    String entitySet : c.getEntitySets()) {
      reportEntities(entitySet,c.getEntities(entitySet).top(1).execute());
    }
  }
}
Program: 59647
Project: 59647
Buggy source:
public static Object parseIdObject(String id){
  String cleanid=null;
  if (id != null && id.length() > 0) {
    if (id.startsWith("String_Node_Str") && id.endsWith("String_Node_Str")) {
      cleanid=id.substring(1,id.length() - 1);
    }
  }
  if (cleanid == null) {
    throw new RuntimeException("String_Node_Str");
  }
  Object idObject;
  if (cleanid.startsWith("String_Node_Str") && cleanid.endsWith("String_Node_Str")) {
    idObject=cleanid.substring(1,cleanid.length() - 1);
  }
 else {
    idObject=Integer.parseInt(cleanid);
  }
  return idObject;
}

Fixed version (ground truth):
public static Object parseIdObject(String id){
  String cleanid=null;
  if (id != null && id.length() > 0) {
    if (id.startsWith("String_Node_Str") && id.endsWith("String_Node_Str")) {
      cleanid=id.substring(1,id.length() - 1);
    }
  }
  if (cleanid == null) {
    throw new RuntimeException("String_Node_Str");
  }
  Object idObject;
  if (cleanid.startsWith("String_Node_Str") && cleanid.endsWith("String_Node_Str")) {
    idObject=cleanid.substring(1,cleanid.length() - 1);
  }
 else   if (cleanid.endsWith("String_Node_Str")) {
    idObject=Long.parseLong(cleanid.substring(0,cleanid.length() - 1));
  }
 else {
    idObject=Integer.parseInt(cleanid);
  }
  return idObject;
}
Program: 59648
Project: 59648
Buggy source:
private Object idObject(String id){
  String cleanid=null;
  if (id != null && id.length() > 0) {
    if (id.startsWith("String_Node_Str") && id.endsWith("String_Node_Str")) {
      cleanid=id.substring(1,id.length() - 1);
    }
  }
  if (cleanid == null)   throw new RuntimeException("String_Node_Str");
  Object idObject;
  if (cleanid.startsWith("String_Node_Str") && cleanid.endsWith("String_Node_Str")) {
    idObject=cleanid.substring(1,cleanid.length() - 1);
  }
 else {
    idObject=Integer.parseInt(cleanid);
  }
  return idObject;
}

Fixed version (ground truth):
private Object idObject(String id){
  String cleanid=null;
  if (id != null && id.length() > 0) {
    if (id.startsWith("String_Node_Str") && id.endsWith("String_Node_Str")) {
      cleanid=id.substring(1,id.length() - 1);
    }
  }
  if (cleanid == null)   throw new RuntimeException("String_Node_Str");
  Object idObject;
  if (cleanid.startsWith("String_Node_Str") && cleanid.endsWith("String_Node_Str")) {
    idObject=cleanid.substring(1,cleanid.length() - 1);
  }
 else   if (cleanid.endsWith("String_Node_Str")) {
    idObject=Long.parseLong(cleanid.substring(0,cleanid.length() - 1));
  }
 else {
    idObject=Integer.parseInt(cleanid);
  }
  return idObject;
}
Program: 59649
Project: 59649
Buggy source:
private static Iterable<OProperty<?>> parseProperties(XMLEventReader2 reader,StartElement2 propertiesElement){
  List<OProperty<?>> rt=new ArrayList<OProperty<?>>();
  while (reader.hasNext()) {
    XMLEvent2 event=reader.nextEvent();
    if (event.isEndElement() && event.asEndElement().getName().equals(propertiesElement.getName())) {
      return rt;
    }
    if (event.isStartElement() && event.asStartElement().getName().getNamespaceURI().equals(NS_DATASERVICES)) {
      String name=event.asStartElement().getName().getLocalPart();
      Attribute2 typeAttribute=event.asStartElement().getAttributeByName(M_TYPE);
      Attribute2 nullAttribute=event.asStartElement().getAttributeByName(M_NULL);
      boolean isNull=nullAttribute != null && "String_Node_Str".equals(nullAttribute.getValue());
      OProperty<?> op=null;
      String type=null;
      boolean isComplexType=false;
      if (typeAttribute != null) {
        type=typeAttribute.getValue();
        EdmType et=EdmType.get(type);
        isComplexType=!et.isPrimitive();
      }
      if (isComplexType) {
        op=OProperties.complex(name,type,isNull ? null : Enumerable.create(parseProperties(reader,event.asStartElement())).toList());
      }
 else {
        op=OProperties.parse(name,type,isNull ? null : reader.getElementText());
      }
      rt.add(op);
    }
  }
  throw new RuntimeException();
}

Fixed version (ground truth):
public static Iterable<OProperty<?>> parseProperties(XMLEventReader2 reader,StartElement2 propertiesElement){
  List<OProperty<?>> rt=new ArrayList<OProperty<?>>();
  while (reader.hasNext()) {
    XMLEvent2 event=reader.nextEvent();
    if (event.isEndElement() && event.asEndElement().getName().equals(propertiesElement.getName())) {
      return rt;
    }
    if (event.isStartElement() && event.asStartElement().getName().getNamespaceURI().equals(NS_DATASERVICES)) {
      String name=event.asStartElement().getName().getLocalPart();
      Attribute2 typeAttribute=event.asStartElement().getAttributeByName(M_TYPE);
      Attribute2 nullAttribute=event.asStartElement().getAttributeByName(M_NULL);
      boolean isNull=nullAttribute != null && "String_Node_Str".equals(nullAttribute.getValue());
      OProperty<?> op=null;
      String type=null;
      boolean isComplexType=false;
      if (typeAttribute != null) {
        type=typeAttribute.getValue();
        EdmType et=EdmType.get(type);
        isComplexType=!et.isPrimitive();
      }
      if (isComplexType) {
        op=OProperties.complex(name,type,isNull ? null : Enumerable.create(parseProperties(reader,event.asStartElement())).toList());
      }
 else {
        op=OProperties.parse(name,type,isNull ? null : reader.getElementText());
      }
      rt.add(op);
    }
  }
  throw new RuntimeException();
}
Program: 59650
Project: 59650
Buggy source:
public Args(Element ele,File outputDir,String jobPrefix,List<Mecq.Sample> samples,Organism organism,CalcOptimalKmer.Args kmerCalcArgs,boolean runParallel) throws IOException {
  super(RampartStage.MASS,outputDir,jobPrefix,samples,organism,runParallel);
  if (!XmlHelper.validate(ele,new String[0],new String[]{KEY_ATTR_PARALLEL},new String[]{KEY_ELEM_MASS_JOB},new String[0])) {
    throw new IOException("String_Node_Str");
  }
  this.massJobArgMap=new HashMap<>();
  this.kmerCalcArgs=kmerCalcArgs;
  this.runParallel=ele.hasAttribute(KEY_ATTR_PARALLEL) ? XmlHelper.getBooleanValue(ele,KEY_ATTR_PARALLEL) : runParallel;
  NodeList nodes=ele.getElementsByTagName(KEY_ELEM_MASS_JOB);
  for (  Mecq.Sample sample : samples) {
    List<MassJob.Args> massJobArgs=new ArrayList<>();
    for (int i=0; i < nodes.getLength(); i++) {
      massJobArgs.add(new MassJob.Args((Element)nodes.item(i),this.getStageDir(sample),jobPrefix + "String_Node_Str",sample,this.organism,this.runParallel,i + 1,this.kmerCalcArgs != null));
    }
    this.massJobArgMap.put(sample,massJobArgs);
  }
}

Fixed version (ground truth):
public Args(Element ele,File outputDir,String jobPrefix,List<Mecq.Sample> samples,Organism organism,CalcOptimalKmer.Args kmerCalcArgs,boolean runParallel) throws IOException {
  super(RampartStage.MASS,outputDir,jobPrefix,samples,organism,runParallel);
  if (!XmlHelper.validate(ele,new String[0],new String[]{KEY_ATTR_PARALLEL},new String[]{KEY_ELEM_MASS_JOB},new String[0])) {
    throw new IOException("String_Node_Str");
  }
  this.massJobArgMap=new HashMap<>();
  this.kmerCalcArgs=kmerCalcArgs;
  this.organism=organism;
  this.runParallel=ele.hasAttribute(KEY_ATTR_PARALLEL) ? XmlHelper.getBooleanValue(ele,KEY_ATTR_PARALLEL) : runParallel;
  NodeList nodes=ele.getElementsByTagName(KEY_ELEM_MASS_JOB);
  for (  Mecq.Sample sample : samples) {
    List<MassJob.Args> massJobArgs=new ArrayList<>();
    for (int i=0; i < nodes.getLength(); i++) {
      massJobArgs.add(new MassJob.Args((Element)nodes.item(i),this.getStageDir(sample),jobPrefix + "String_Node_Str",sample,this.organism,this.runParallel,i + 1,this.kmerCalcArgs != null));
    }
    this.massJobArgMap.put(sample,massJobArgs);
  }
}
Program: 59651
Project: 59651
Buggy source:
protected final void validateCoverageRange(){
  if (coverageRange == null) {
    CoverageRange defaultCoverageRange=new CoverageRange();
    log.info("String_Node_Str" + this.name + "String_Node_Str"+ defaultCoverageRange.toString());
  }
 else   if (organism == null || !organism.isGenomeSizeAvailable()) {
    CoverageRange defaultCoverageRange=new CoverageRange();
    log.info("String_Node_Str" + "String_Node_Str" + defaultCoverageRange.toString());
  }
 else   if (coverageRange.validate()) {
    log.info("String_Node_Str" + this.name + "String_Node_Str"+ coverageRange.toString());
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + coverageRange.toString() + "String_Node_Str"+ this.name+ "String_Node_Str");
  }
}

Fixed version (ground truth):
protected final void validateCoverageRange(){
  if (coverageRange == null) {
    CoverageRange defaultCoverageRange=new CoverageRange();
    log.info("String_Node_Str" + this.name + "String_Node_Str"+ defaultCoverageRange.toString());
  }
 else   if (organism == null || !organism.isGenomeSizeAvailable()) {
    if (organism == null) {
      log.error("String_Node_Str");
    }
 else     if (!organism.isGenomeSizeAvailable()) {
      if (organism.getReference() == null) {
        log.error("String_Node_Str");
      }
    }
    CoverageRange defaultCoverageRange=new CoverageRange();
    log.warn("String_Node_Str" + "String_Node_Str" + defaultCoverageRange.toString());
  }
 else   if (coverageRange.validate()) {
    log.info("String_Node_Str" + this.name + "String_Node_Str"+ coverageRange.toString());
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + coverageRange.toString() + "String_Node_Str"+ this.name+ "String_Node_Str");
  }
}
Program: 59652
Project: 59652
Buggy source:
@Override public void updateTable(AssemblyStatsTable table,File reportDir) throws IOException {
  log.info("String_Node_Str" + reportDir.getCanonicalPath());
  Collection<File> cegmaFiles=FileUtils.listFiles(reportDir,new String[]{"String_Node_Str"},false);
  for (  AssemblyStats stats : table) {
    File c=null;
    File asm=new File(stats.getFilePath());
    for (    File cf : cegmaFiles) {
      if (FilenameUtils.getBaseName(asm.getName()).equals(FilenameUtils.getBaseName(cf.getName()))) {
        c=cf;
        break;
      }
    }
    if (c == null || !c.exists())     throw new IllegalStateException("String_Node_Str");
    if (!asm.exists())     throw new IllegalStateException("String_Node_Str" + asm.getAbsolutePath());
    CegmaV24.Report cegmaReport=new CegmaV24.Report(c);
    stats.setCompletenessPercentage(cegmaReport.getPcComplete());
  }
}

Fixed version (ground truth):
@Override public void updateTable(AssemblyStatsTable table,File reportDir) throws IOException {
  log.info("String_Node_Str" + reportDir.getCanonicalPath());
  Collection<File> cegmaFiles=FileUtils.listFiles(reportDir,new String[]{"String_Node_Str"},true);
  for (  File cf : cegmaFiles) {
    String asmName=cf.getName().substring(0,cf.getName().length() - 23);
    log.info("String_Node_Str" + cf.getCanonicalPath() + "String_Node_Str"+ asmName);
    AssemblyStats stats=table.findStatsByFilename(asmName);
    CegmaV24.Report cegmaReport=new CegmaV24.Report(cf);
    stats.setCompletenessPercentage(cegmaReport.getPcComplete());
  }
}
Program: 59653
Project: 59653
Buggy source:
@Override public List<ExecutionResult> execute(List<File> assemblies,File outputDir,String jobPrefix,ConanExecutorService ces) throws InterruptedException, ProcessExecutionException, ConanParameterException, IOException {
  List<ExecutionResult> jobResults=new ArrayList<>();
  if (outputDir.exists()) {
    FileUtils.deleteDirectory(outputDir);
  }
  outputDir.mkdirs();
  int i=1;
  for (  File f : assemblies) {
    String cegmaJobName=jobPrefix + "String_Node_Str" + i++;
    File cegOutputDir=new File(outputDir,f.getName());
    if (cegOutputDir.exists()) {
      FileUtils.deleteDirectory(cegOutputDir);
    }
    cegOutputDir.mkdirs();
    CegmaV24 cegmaProc=this.makeCegmaProcess(f,cegOutputDir,args.getThreads());
    ExecutionResult result=ces.executeProcess(cegmaProc,cegOutputDir,cegmaJobName,args.getThreads(),args.getMemory(),false);
    jobResults.add(result);
    File sourceFile=new File(((CegmaV24.Args)cegmaProc.getProcessArgs()).getOutputPrefix().getAbsolutePath() + "String_Node_Str");
    File destFile=new File(cegOutputDir,f.getName() + "String_Node_Str");
    ces.getConanProcessService().createLocalSymbolicLink(sourceFile,destFile);
  }
  return jobResults;
}

Fixed version (ground truth):
@Override public List<ExecutionResult> execute(List<File> assemblies,File outputDir,String jobPrefix,ConanExecutorService ces) throws InterruptedException, ProcessExecutionException, ConanParameterException, IOException {
  List<ExecutionResult> jobResults=new ArrayList<>();
  if (outputDir.exists()) {
    FileUtils.deleteDirectory(outputDir);
  }
  outputDir.mkdirs();
  int i=1;
  for (  File f : assemblies) {
    String cegmaJobName=jobPrefix + "String_Node_Str" + i++;
    File cegOutputDir=new File(outputDir,f.getName().substring(0,f.getName().length() - 3));
    if (cegOutputDir.exists()) {
      FileUtils.deleteDirectory(cegOutputDir);
    }
    cegOutputDir.mkdirs();
    CegmaV24 cegmaProc=this.makeCegmaProcess(f,cegOutputDir,args.getThreads());
    ExecutionResult result=ces.executeProcess(cegmaProc,cegOutputDir,cegmaJobName,args.getThreads(),args.getMemory(),false);
    jobResults.add(result);
    File sourceFile=new File(((CegmaV24.Args)cegmaProc.getProcessArgs()).getOutputPrefix().getAbsolutePath() + "String_Node_Str");
    File destFile=new File(cegOutputDir,f.getName() + "String_Node_Str");
    ces.getConanProcessService().createLocalSymbolicLink(sourceFile,destFile);
  }
  return jobResults;
}
Program: 59654
Project: 59654
Buggy source:
@Override public boolean isOperational(ExecutionContext executionContext){
  Args args=(Args)this.getProcessArgs();
  for (  MassJob.Args massJobArgs : args.getMassJobArgList()) {
    if (!new MassJob(this.conanExecutorService,massJobArgs).isOperational(executionContext)) {
      log.warn("String_Node_Str");
      return false;
    }
  }
  if (args.kmerCalcArgs != null) {
    if (!new CalcOptimalKmer(this.conanExecutorService).isOperational(executionContext)) {
      log.warn("String_Node_Str");
    }
  }
  log.info("String_Node_Str");
  return true;
}

Fixed version (ground truth):
@Override public boolean isOperational(ExecutionContext executionContext){
  Args args=(Args)this.getProcessArgs();
  for (  MassJob.Args massJobArgs : args.getMassJobArgList()) {
    if (!new MassJob(this.conanExecutorService,massJobArgs).isOperational(executionContext)) {
      log.warn("String_Node_Str");
      return false;
    }
  }
  log.info("String_Node_Str");
  return true;
}
Program: 59657
Project: 59657
Buggy source:
public ExecutionResult executeAssembler(Assembler assembler,String jobName,List<Integer> jobIds) throws ProcessExecutionException, InterruptedException, IOException, ConanParameterException {
  assembler.setup();
  Args args=this.getArgs();
  return this.conanExecutorService.executeProcess(assembler,assembler.getAssemblerArgs().getOutputDir(),jobName,args.getThreads(),args.getMemory(),args.isRunParallel(),jobIds,assembler.usesOpenMpi());
}

Fixed version (ground truth):
public ExecutionResult executeAssembler(Assembler assembler,String jobName,List<Integer> jobIds) throws ProcessExecutionException, InterruptedException, IOException, ConanParameterException {
  assembler.setup();
  Args args=this.getArgs();
  return this.conanExecutorService.executeProcess(assembler,assembler.getAssemblerArgs().getOutputDir(),jobName,args.getThreads(),args.getMemory(),args.isMassParallel() || args.isRunParallel(),jobIds,assembler.usesOpenMpi());
}
Program: 59658
Project: 59658
Buggy source:
public void createAssemblyLinks(Assembler assembler,Args jobArgs,String jobName) throws ProcessExecutionException, InterruptedException {
  ExecutionContext linkingExecutionContext=new DefaultExecutionContext(this.conanExecutorService.getExecutionContext().getLocality(),null,null);
  ConanProcessService cps=this.conanExecutorService.getConanProcessService();
  StringJoiner compoundLinkCmdLine=new StringJoiner("String_Node_Str");
  if (assembler.makesUnitigs()) {
    compoundLinkCmdLine.add(cps.makeLinkCommand(assembler.getUnitigsFile(),new File(jobArgs.getUnitigsDir(),jobName + "String_Node_Str")));
  }
  if (assembler.makesContigs()) {
    compoundLinkCmdLine.add(cps.makeLinkCommand(assembler.getContigsFile(),new File(jobArgs.getContigsDir(),jobName + "String_Node_Str")));
  }
  if (assembler.makesScaffolds()) {
    compoundLinkCmdLine.add(cps.makeLinkCommand(assembler.getScaffoldsFile(),new File(jobArgs.getScaffoldsDir(),jobName + "String_Node_Str")));
  }
  compoundLinkCmdLine.add(cps.makeLinkCommand(assembler.getScaffoldsFile(),new File(jobArgs.getLongestDir(),jobName + "String_Node_Str")));
  cps.execute(compoundLinkCmdLine.toString(),linkingExecutionContext);
}

Fixed version (ground truth):
public void createAssemblyLinks(Assembler assembler,Args jobArgs,String jobName) throws ProcessExecutionException, InterruptedException {
  ExecutionContext linkingExecutionContext=new DefaultExecutionContext(this.conanExecutorService.getExecutionContext().getLocality(),null,null);
  ConanProcessService cps=this.conanExecutorService.getConanProcessService();
  StringJoiner compoundLinkCmdLine=new StringJoiner("String_Node_Str");
  if (assembler.makesUnitigs()) {
    compoundLinkCmdLine.add(cps.makeLinkCommand(assembler.getUnitigsFile(),new File(jobArgs.getUnitigsDir(),jobName + "String_Node_Str")));
  }
  if (assembler.makesContigs()) {
    compoundLinkCmdLine.add(cps.makeLinkCommand(assembler.getContigsFile(),new File(jobArgs.getContigsDir(),jobName + "String_Node_Str")));
  }
  if (assembler.makesScaffolds()) {
    compoundLinkCmdLine.add(cps.makeLinkCommand(assembler.getScaffoldsFile(),new File(jobArgs.getScaffoldsDir(),jobName + "String_Node_Str")));
  }
  compoundLinkCmdLine.add(cps.makeLinkCommand(assembler.getBestAssembly(),new File(jobArgs.getLongestDir(),jobName + "String_Node_Str")));
  cps.execute(compoundLinkCmdLine.toString(),linkingExecutionContext);
}
Program: 59659
Project: 59659
Buggy source:
public DependencyDownloader(String[] args) throws ParseException {
  CommandLine cmdLine=new PosixParser().parse(createOptions(),args,true);
  this.help=cmdLine.hasOption(OPT_HELP);
  this.verbose=cmdLine.hasOption(OPT_VERBOSE);
  this.targetDir=cmdLine.getArgList().isEmpty() ? new File("String_Node_Str") : new File((String)cmdLine.getArgList().get(0));
}

Fixed version (ground truth):
public DependencyDownloader(String[] args) throws ParseException, IOException {
  CommandLine cmdLine=new PosixParser().parse(createOptions(),args,true);
  this.help=cmdLine.hasOption(OPT_HELP);
  this.verbose=cmdLine.hasOption(OPT_VERBOSE);
  this.targetDir=cmdLine.getArgList().isEmpty() ? new File("String_Node_Str").getCanonicalFile() : new File((String)cmdLine.getArgList().get(0)).getCanonicalFile();
}
Program: 59661
Project: 59661
Buggy source:
public Args(Element element,File analyseReadsDir,File outputDir,List<AmpStage.Args> ampStages,Organism organism,String jobPrefix) throws IOException {
  super(new Params(),element,analyseReadsDir,outputDir,organism,jobPrefix);
  this.analyseAll=element.hasAttribute(KEY_ATTR_ALL) ? XmlHelper.getBooleanValue(element,KEY_ATTR_ALL) : DEFAULT_ANALYSE_ALL;
  this.ampStages=ampStages;
}

Fixed version (ground truth):
public Args(Element element,File analyseReadsDir,File outputDir,List<AmpStage.Args> ampStages,Organism organism,String jobPrefix,boolean doingReadKmerAnalysis) throws IOException {
  super(new Params(),element,analyseReadsDir,outputDir,organism,jobPrefix,doingReadKmerAnalysis);
  this.analyseAll=element.hasAttribute(KEY_ATTR_ALL) ? XmlHelper.getBooleanValue(element,KEY_ATTR_ALL) : DEFAULT_ANALYSE_ALL;
  this.ampStages=ampStages;
}
Program: 59662
Project: 59662
Buggy source:
public ToolArgs(Element ele,File outputDir,File readsAnalysisDir,Organism organism,String jobPrefix,boolean forceParallel) throws IOException {
  this();
  if (!XmlHelper.validate(ele,new String[]{KEY_ATTR_NAME},new String[]{KEY_ATTR_THREADS,KEY_ATTR_MEMORY,KEY_ATTR_PARALLEL},new String[0],new String[0])) {
    throw new IOException("String_Node_Str");
  }
  if (!ele.hasAttribute(KEY_ATTR_NAME))   throw new IOException("String_Node_Str" + KEY_ATTR_NAME + "String_Node_Str");
  this.name=XmlHelper.getTextValue(ele,KEY_ATTR_NAME);
  this.threads=ele.hasAttribute(KEY_ATTR_THREADS) ? XmlHelper.getIntValue(ele,KEY_ATTR_THREADS) : DEFAULT_THREADS;
  this.memory=ele.hasAttribute(KEY_ATTR_MEMORY) ? XmlHelper.getIntValue(ele,KEY_ATTR_MEMORY) : DEFAULT_MEMORY;
  this.runParallel=forceParallel || (ele.hasAttribute(KEY_ATTR_PARALLEL) ? XmlHelper.getBooleanValue(ele,KEY_ATTR_PARALLEL) : DEFAULT_RUN_PARALLEL);
  this.jobPrefix=jobPrefix;
  this.organism=organism;
  this.outputDir=outputDir;
  this.readsAnalysisDir=readsAnalysisDir;
}

Fixed version (ground truth):
public ToolArgs(Element ele,File outputDir,File readsAnalysisDir,Organism organism,String jobPrefix,boolean forceParallel,boolean doingReadKmerAnalysis) throws IOException {
  this();
  if (!XmlHelper.validate(ele,new String[]{KEY_ATTR_NAME},new String[]{KEY_ATTR_THREADS,KEY_ATTR_MEMORY,KEY_ATTR_PARALLEL},new String[0],new String[0])) {
    throw new IOException("String_Node_Str");
  }
  if (!ele.hasAttribute(KEY_ATTR_NAME))   throw new IOException("String_Node_Str" + KEY_ATTR_NAME + "String_Node_Str");
  this.name=XmlHelper.getTextValue(ele,KEY_ATTR_NAME);
  if (this.name.equalsIgnoreCase("String_Node_Str") && !doingReadKmerAnalysis) {
    throw new IOException("String_Node_Str");
  }
  this.threads=ele.hasAttribute(KEY_ATTR_THREADS) ? XmlHelper.getIntValue(ele,KEY_ATTR_THREADS) : DEFAULT_THREADS;
  this.memory=ele.hasAttribute(KEY_ATTR_MEMORY) ? XmlHelper.getIntValue(ele,KEY_ATTR_MEMORY) : DEFAULT_MEMORY;
  this.runParallel=forceParallel || (ele.hasAttribute(KEY_ATTR_PARALLEL) ? XmlHelper.getBooleanValue(ele,KEY_ATTR_PARALLEL) : DEFAULT_RUN_PARALLEL);
  this.jobPrefix=jobPrefix;
  this.organism=organism;
  this.outputDir=outputDir;
  this.readsAnalysisDir=readsAnalysisDir;
}
Program: 59663
Project: 59663
Buggy source:
public AnalyseAssembliesArgs(AnalyseAssembliesParams params,Element element,File analyseReadsDir,File outputDir,Organism organism,String jobPrefix) throws IOException {
  this(params);
  if (!XmlHelper.validate(element,new String[]{},new String[]{KEY_ATTR_PARALLEL},new String[]{KEY_ELEM_TOOL},new String[0])) {
    throw new IOException("String_Node_Str");
  }
  this.analyseReadsDir=analyseReadsDir;
  this.outputDir=outputDir;
  this.organism=organism;
  this.jobPrefix=jobPrefix;
  this.runParallel=element.hasAttribute(KEY_ATTR_PARALLEL) ? XmlHelper.getBooleanValue(element,KEY_ATTR_PARALLEL) : DEFAULT_RUN_PARALLEL;
  NodeList nodes=element.getElementsByTagName(KEY_ELEM_TOOL);
  for (int i=0; i < nodes.getLength(); i++) {
    this.tools.add(new ToolArgs((Element)nodes.item(i),outputDir,analyseReadsDir,organism,jobPrefix,this.runParallel));
  }
  for (  AnalyseAssembliesArgs.ToolArgs requestedService : this.tools) {
    AssemblyAnalyser aa=this.assemblyAnalyserFactory.create(requestedService.getName());
    aa.setArgs(requestedService);
    this.assemblyAnalysers.add(aa);
  }
}

Fixed version (ground truth):
public AnalyseAssembliesArgs(AnalyseAssembliesParams params,Element element,File analyseReadsDir,File outputDir,Organism organism,String jobPrefix,boolean doingReadKmerAnalysis) throws IOException {
  this(params);
  if (!XmlHelper.validate(element,new String[]{},new String[]{KEY_ATTR_PARALLEL},new String[]{KEY_ELEM_TOOL},new String[0])) {
    throw new IOException("String_Node_Str");
  }
  this.analyseReadsDir=analyseReadsDir;
  this.outputDir=outputDir;
  this.organism=organism;
  this.jobPrefix=jobPrefix;
  this.runParallel=element.hasAttribute(KEY_ATTR_PARALLEL) ? XmlHelper.getBooleanValue(element,KEY_ATTR_PARALLEL) : DEFAULT_RUN_PARALLEL;
  NodeList nodes=element.getElementsByTagName(KEY_ELEM_TOOL);
  for (int i=0; i < nodes.getLength(); i++) {
    this.tools.add(new ToolArgs((Element)nodes.item(i),outputDir,analyseReadsDir,organism,jobPrefix,this.runParallel,doingReadKmerAnalysis));
  }
  for (  AnalyseAssembliesArgs.ToolArgs requestedService : this.tools) {
    AssemblyAnalyser aa=this.assemblyAnalyserFactory.create(requestedService.getName());
    aa.setArgs(requestedService);
    this.assemblyAnalysers.add(aa);
  }
}
Program: 59664
Project: 59664
Buggy source:
public Args(Element element,File massDir,File analyseReadsDir,File outputDir,List<MassJob.Args> massJobs,Organism organism,String jobPrefix,File kmerCalcResults) throws IOException {
  super(new Params(),element,analyseReadsDir,outputDir,organism,jobPrefix);
  this.massDir=massDir;
  this.massJobs=massJobs;
  this.kmerCalcResults=kmerCalcResults;
}

Fixed version (ground truth):
public Args(Element element,File massDir,File analyseReadsDir,File outputDir,List<MassJob.Args> massJobs,Organism organism,String jobPrefix,File kmerCalcResults,boolean doingReadKmerAnalysis) throws IOException {
  super(new Params(),element,analyseReadsDir,outputDir,organism,jobPrefix,doingReadKmerAnalysis);
  this.massDir=massDir;
  this.massJobs=massJobs;
  this.kmerCalcResults=kmerCalcResults;
}
Program: 59665
Project: 59665
Buggy source:
/** 
 * Cleans a RAMPART job directory of any known temporary information.  This will not delete any information not in the MECQ, MASS, AMP or REPORT directories.
 * @param jobDir The RAMPART job directory to clean
 * @throws java.io.IOException Thrown if there were an issues cleaning the directory
 */
public void cleanJob(File jobDir) throws IOException {
  if (this.verbose) {
    System.out.print("String_Node_Str" + jobDir.getAbsolutePath() + "String_Node_Str");
  }
  RampartJobFileSystem jobFs=new RampartJobFileSystem(jobDir);
  FileUtils.deleteDirectory(jobFs.getMeqcDir());
  FileUtils.deleteDirectory(jobFs.getAnalyseReadsDir());
  FileUtils.deleteDirectory(jobFs.getMassDir());
  FileUtils.deleteDirectory(jobFs.getAnalyseMassDir());
  FileUtils.deleteDirectory(jobFs.getAmpDir());
  FileUtils.deleteDirectory(jobFs.getAnalyseAmpDir());
  FileUtils.deleteDirectory(jobFs.getReportDir());
  FileUtils.deleteDirectory(jobFs.getFinalDir());
  if (this.verbose) {
    System.out.println("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Cleans a RAMPART job directory of any known temporary information.  This will not delete any information not in the MECQ, MASS, AMP or REPORT directories.
 * @param jobDir The RAMPART job directory to clean
 * @throws java.io.IOException Thrown if there were an issues cleaning the directory
 */
public void cleanJob(File jobDir) throws IOException {
  if (this.verbose) {
    System.out.print("String_Node_Str" + jobDir.getAbsolutePath() + "String_Node_Str");
  }
  RampartJobFileSystem jobFs=new RampartJobFileSystem(jobDir);
  FileUtils.deleteDirectory(jobFs.getMeqcDir());
  FileUtils.deleteDirectory(jobFs.getAnalyseReadsDir());
  FileUtils.deleteDirectory(jobFs.getKmerCalcDir());
  FileUtils.deleteDirectory(jobFs.getMassDir());
  FileUtils.deleteDirectory(jobFs.getAnalyseMassDir());
  FileUtils.deleteDirectory(jobFs.getSelectMassDir());
  FileUtils.deleteDirectory(jobFs.getAmpDir());
  FileUtils.deleteDirectory(jobFs.getAnalyseAmpDir());
  FileUtils.deleteDirectory(jobFs.getReportDir());
  FileUtils.deleteDirectory(jobFs.getFinalDir());
  if (this.verbose) {
    System.out.println("String_Node_Str");
  }
}
Program: 59666
Project: 59666
Buggy source:
protected final void setupFileStructure(File jobDir){
  this.meqcDir=new File(jobDir,"String_Node_Str");
  this.analyseReadsDir=new File(jobDir,"String_Node_Str");
  this.massDir=new File(jobDir,"String_Node_Str");
  this.analyseMassDir=new File(jobDir,"String_Node_Str");
  this.massStatsDir=new File(massDir,"String_Node_Str");
  this.ampDir=new File(jobDir,"String_Node_Str");
  this.ampAssembliesDir=new File(ampDir,"String_Node_Str");
  this.analyseAmpDir=new File(jobDir,"String_Node_Str");
  this.reportDir=new File(jobDir,"String_Node_Str");
  this.reportImagesDir=new File(reportDir,"String_Node_Str");
  this.finalDir=new File(jobDir,"String_Node_Str");
  this.qtLogFile=new File(this.meqcDir + "String_Node_Str");
  this.massPlotsFile=new File(this.massStatsDir.getPath() + "String_Node_Str");
  this.massStatsFile=new File(this.massStatsDir.getPath() + "String_Node_Str");
  this.massLogFile=new File(this.massDir.getPath() + "String_Node_Str");
  this.selectedAssemblyFile=new File(this.analyseMassDir.getPath() + "String_Node_Str");
  this.selectedBubbleFile=new File(this.analyseMassDir.getPath() + "String_Node_Str");
  this.ampPlotsFile=new File(this.ampAssembliesDir.getPath() + "String_Node_Str");
  this.ampStatsFile=new File(this.ampAssembliesDir.getPath() + "String_Node_Str");
  this.ampLogFile=new File(this.ampDir.getPath() + "String_Node_Str");
  this.reportTemplateFile=new File(this.reportDir.getPath() + "String_Node_Str");
  this.reportMergedFile=new File(this.reportDir.getPath() + "String_Node_Str");
}

Fixed version (ground truth):
protected final void setupFileStructure(File jobDir){
  this.meqcDir=new File(jobDir,"String_Node_Str");
  this.analyseReadsDir=new File(jobDir,"String_Node_Str");
  this.massDir=new File(jobDir,"String_Node_Str");
  this.analyseMassDir=new File(jobDir,"String_Node_Str");
  this.ampDir=new File(jobDir,"String_Node_Str");
  this.ampAssembliesDir=new File(ampDir,"String_Node_Str");
  this.analyseAmpDir=new File(jobDir,"String_Node_Str");
  this.reportDir=new File(jobDir,"String_Node_Str");
  this.reportImagesDir=new File(reportDir,"String_Node_Str");
  this.finalDir=new File(jobDir,"String_Node_Str");
  this.qtLogFile=new File(this.meqcDir + "String_Node_Str");
  this.massPlotsFile=new File(this.analyseMassDir.getPath() + "String_Node_Str");
  this.massStatsFile=new File(this.analyseMassDir.getPath() + "String_Node_Str");
  this.massLogFile=new File(this.massDir.getPath() + "String_Node_Str");
  this.selectedAssemblyFile=new File(this.analyseMassDir.getPath() + "String_Node_Str");
  this.selectedBubbleFile=new File(this.analyseMassDir.getPath() + "String_Node_Str");
  this.ampPlotsFile=new File(this.ampAssembliesDir.getPath() + "String_Node_Str");
  this.ampStatsFile=new File(this.ampAssembliesDir.getPath() + "String_Node_Str");
  this.ampLogFile=new File(this.ampDir.getPath() + "String_Node_Str");
  this.reportTemplateFile=new File(this.reportDir.getPath() + "String_Node_Str");
  this.reportMergedFile=new File(this.reportDir.getPath() + "String_Node_Str");
}
Program: 59668
Project: 59668
Buggy source:
public ReadsInput(Element ele) throws IOException {
  if (!ele.hasAttribute(KEY_ATTR_ECQ))   throw new IOException("String_Node_Str" + KEY_ATTR_ECQ + "String_Node_Str");
  if (!ele.hasAttribute(KEY_ATTR_LIB))   throw new IOException("String_Node_Str" + KEY_ATTR_LIB + "String_Node_Str");
  this.ecq=XmlHelper.getTextValue(ele,KEY_ATTR_ECQ);
  this.lib=XmlHelper.getTextValue(ele,KEY_ATTR_LIB);
}

Fixed version (ground truth):
public ReadsInput(Element ele){
  if (!ele.hasAttribute(KEY_ATTR_ECQ))   throw new IllegalArgumentException("String_Node_Str" + KEY_ATTR_ECQ + "String_Node_Str");
  if (!ele.hasAttribute(KEY_ATTR_LIB))   throw new IllegalArgumentException("String_Node_Str" + KEY_ATTR_LIB + "String_Node_Str");
  this.ecq=XmlHelper.getTextValue(ele,KEY_ATTR_ECQ);
  this.lib=XmlHelper.getTextValue(ele,KEY_ATTR_LIB);
}
Program: 59670
Project: 59670
Buggy source:
public Args(Element element,File massDir,File analyseReadsDir,File outputDir,List<MassJob.Args> massGroups,Organism organism,String jobPrefix){
  super(new Params(),element,analyseReadsDir,outputDir,organism,jobPrefix);
  this.massDir=massDir;
  this.massGroups=massGroups;
}

Fixed version (ground truth):
public Args(Element element,File massDir,File analyseReadsDir,File outputDir,List<MassJob.Args> massJobs,Organism organism,String jobPrefix){
  super(new Params(),element,analyseReadsDir,outputDir,organism,jobPrefix);
  this.massDir=massDir;
  this.massJobs=massJobs;
}
Program: 59671
Project: 59671
Buggy source:
protected File getAssemblyFile(Assembler assembler,File assemblyDir){
  if (assemblyDir.getName().equals("String_Node_Str")) {
    return assembler.getScaffoldsFile();
  }
 else   if (assemblyDir.getName().equals("String_Node_Str")) {
    return assembler.getContigsFile();
  }
 else   if (assemblyDir.getName().equals("String_Node_Str")) {
    return assembler.getUnitigsFile();
  }
 else {
    throw new IllegalStateException("String_Node_Str" + assemblyDir.getName());
  }
}

Fixed version (ground truth):
protected File getAssemblyFile(Assembler assembler,File assemblyDir){
  if (assemblyDir.getName().equals("String_Node_Str")) {
    return assembler.getScaffoldsFile().getAbsoluteFile();
  }
 else   if (assemblyDir.getName().equals("String_Node_Str")) {
    return assembler.getContigsFile().getAbsoluteFile();
  }
 else   if (assemblyDir.getName().equals("String_Node_Str")) {
    return assembler.getUnitigsFile().getAbsoluteFile();
  }
 else {
    throw new IllegalStateException("String_Node_Str" + assemblyDir.getName());
  }
}
Program: 59673
Project: 59673
Buggy source:
@Override public void updateTable(AssemblyStatsTable table,List<File> assemblies,File reportDir,String subGroup) throws IOException {
  Collection<File> cegmaFiles=FileUtils.listFiles(reportDir,new String[]{"String_Node_Str"},false);
  for (  File asm : assemblies) {
    File c=null;
    for (    File cf : cegmaFiles) {
      if (FilenameUtils.getBaseName(asm.getName()).equals(FilenameUtils.getBaseName(cf.getName()))) {
        c=cf;
        break;
      }
    }
    if (c == null || !c.exists())     throw new IllegalStateException("String_Node_Str");
    if (!asm.exists())     throw new IllegalStateException("String_Node_Str" + asm.getAbsolutePath());
    table.mergeWithCegmaResults(c,FilenameUtils.getBaseName(asm.getName()),subGroup);
  }
}

Fixed version (ground truth):
@Override public void updateTable(AssemblyStatsTable table,List<File> assemblies,File reportDir,String subGroup) throws IOException {
  Collection<File> cegmaFiles=FileUtils.listFiles(reportDir,new String[]{"String_Node_Str"},false);
  for (  File asm : assemblies) {
    File c=null;
    for (    File cf : cegmaFiles) {
      if (FilenameUtils.getBaseName(asm.getName()).equals(FilenameUtils.getBaseName(cf.getName()))) {
        c=cf;
        break;
      }
    }
    if (c == null || !c.exists())     throw new IllegalStateException("String_Node_Str");
    if (!asm.exists())     throw new IllegalStateException("String_Node_Str" + asm.getAbsolutePath());
    CegmaV2_4Report cegmaReport=new CegmaV2_4Report(c);
    AssemblyStats stats=table.findStats(subGroup,asm.getName());
    if (stats == null) {
      throw new IOException("String_Node_Str" + subGroup + "String_Node_Str"+ asm.getName());
    }
    stats.setCompletenessPercentage(cegmaReport.getPcComplete());
  }
}
Program: 59674
Project: 59674
Buggy source:
@Override public void updateTable(AssemblyStatsTable table,List<File> assemblies,File reportDir,String subGroup) throws IOException {
  File quastReportFile=new File(reportDir,QUAST_REPORT_NAME);
  if (quastReportFile.exists()) {
    table.mergeWithQuastResults(quastReportFile,subGroup);
  }
 else {
    log.warn("String_Node_Str" + quastReportFile.getAbsolutePath() + "String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void updateTable(AssemblyStatsTable table,List<File> assemblies,File reportDir,String subGroup) throws IOException {
  File quastReportFile=new File(reportDir,QUAST_REPORT_NAME);
  if (quastReportFile.exists()) {
    QuastV2_2Report quastReport=new QuastV2_2Report(quastReportFile);
    for (    QuastV2_2Report.QuastV2_2AssemblyStats qStats : quastReport.getStatList()) {
      if (!qStats.getName().endsWith("String_Node_Str")) {
        String desc=qStats.getName().substring(subGroup.length() + 1,qStats.getName().lastIndexOf("String_Node_Str"));
        AssemblyStats stats=table.findStats(subGroup,desc);
        if (stats == null) {
          throw new IOException("String_Node_Str" + subGroup + "String_Node_Str"+ desc);
        }
        stats.setN50(qStats.getN50());
        stats.setL50(qStats.getL50());
        stats.setMaxLen(qStats.getLargestContig());
        stats.setGcPercentage(qStats.getGcPc());
        stats.setNbSeqs(qStats.getNbContigsGt0());
        stats.setNbSeqsGt1K(qStats.getNbContigsGt1k());
        stats.setNbBases(qStats.getTotalLengthGt0());
        stats.setNbBasesGt1K(qStats.getTotalLengthGt1k());
        stats.setNPercentage(qStats.getNsPer100k() / 1000.0);
      }
    }
  }
 else {
    log.warn("String_Node_Str" + quastReportFile.getAbsolutePath() + "String_Node_Str");
  }
}
Program: 59675
Project: 59675
Buggy source:
/** 
 * The main entry point for RAMPART.  Looks at the first argument to decide which mode to run in.  Execution of each mode is handled by RampartMode.
 * @param args Command line arguments
 */
public static void main(String[] args){
  try {
    RampartCLI rampartCLI=new RampartCLI(args);
    if (rampartCLI == null)     throw new IllegalArgumentException("String_Node_Str");
    if (rampartCLI.isHelp()) {
      rampartCLI.printHelp();
    }
 else {
      rampartCLI.execute();
    }
  }
 catch (  IllegalArgumentException|ParseException e) {
    System.err.println(e.getMessage());
    System.exit(1);
  }
catch (  Exception e) {
    System.err.println(e.getMessage());
    System.err.println(StringUtils.join(e.getStackTrace(),"String_Node_Str"));
    System.exit(2);
  }
}

Fixed version (ground truth):
/** 
 * The main entry point for RAMPART.  Looks at the first argument to decide which mode to run in.  Execution of each mode is handled by RampartMode.
 * @param args Command line arguments
 */
public static void main(String[] args){
  try {
    RampartCLI rampartCLI=new RampartCLI(args);
    if (rampartCLI == null)     throw new IllegalArgumentException("String_Node_Str");
    if (rampartCLI.isHelp()) {
      rampartCLI.printHelp();
    }
 else {
      rampartCLI.initialise();
      rampartCLI.execute();
    }
  }
 catch (  IllegalArgumentException|ParseException e) {
    System.err.println(e.getMessage());
    System.exit(1);
  }
catch (  Exception e) {
    System.err.println(e.getMessage());
    System.err.println(StringUtils.join(e.getStackTrace(),"String_Node_Str"));
    System.exit(2);
  }
}
Program: 59676
Project: 59676
Buggy source:
@Override protected void parseExtra(CommandLine commandLine) throws ParseException {
  this.stages=commandLine.hasOption(OPT_STAGES) ? RampartStageList.parse(commandLine.getOptionValue(OPT_STAGES)) : DEFAULT_STAGES;
  if (stages == DEFAULT_STAGES) {
    if (commandLine.hasOption(OPT_RUN_FIRST_HALF)) {
      RampartStageList firstHalf=new RampartStageList();
      firstHalf.add(RampartStage.MECQ);
      firstHalf.add(RampartStage.ANALYSE_READS);
      firstHalf.add(RampartStage.MASS);
      firstHalf.add(RampartStage.ANALYSE_MASS);
      this.stages=firstHalf;
      log.info("String_Node_Str");
    }
 else     if (commandLine.hasOption(OPT_RUN_SECOND_HALF)) {
      RampartStageList secondHalf=new RampartStageList();
      secondHalf.add(RampartStage.AMP);
      secondHalf.add(RampartStage.ANALYSE_AMP);
      secondHalf.add(RampartStage.FINALISE);
      this.stages=secondHalf;
      log.info("String_Node_Str");
      if (commandLine.hasOption(OPT_AMP_INPUT)) {
        this.ampInput=new File(commandLine.getOptionValue(OPT_AMP_INPUT));
      }
    }
  }
  if (commandLine.getArgs().length != 1)   throw new ParseException("String_Node_Str" + commandLine.getArgs().length);
  this.jobConfig=new File(commandLine.getArgs()[0]);
}

Fixed version (ground truth):
@Override protected void parseExtra(CommandLine commandLine) throws ParseException {
  this.skipChecks=commandLine.hasOption(OPT_SKIP_CHECKS);
  this.stages=commandLine.hasOption(OPT_STAGES) ? RampartStageList.parse(commandLine.getOptionValue(OPT_STAGES)) : DEFAULT_STAGES;
  if (stages == DEFAULT_STAGES) {
    if (commandLine.hasOption(OPT_RUN_FIRST_HALF)) {
      RampartStageList firstHalf=new RampartStageList();
      firstHalf.add(RampartStage.MECQ);
      firstHalf.add(RampartStage.ANALYSE_READS);
      firstHalf.add(RampartStage.MASS);
      firstHalf.add(RampartStage.ANALYSE_MASS);
      this.stages=firstHalf;
      log.info("String_Node_Str");
    }
 else     if (commandLine.hasOption(OPT_RUN_SECOND_HALF)) {
      RampartStageList secondHalf=new RampartStageList();
      secondHalf.add(RampartStage.AMP);
      secondHalf.add(RampartStage.ANALYSE_AMP);
      secondHalf.add(RampartStage.FINALISE);
      this.stages=secondHalf;
      log.info("String_Node_Str");
      if (commandLine.hasOption(OPT_AMP_INPUT)) {
        this.ampInput=new File(commandLine.getOptionValue(OPT_AMP_INPUT));
      }
    }
  }
  if (commandLine.getArgs().length != 1)   throw new ParseException("String_Node_Str" + commandLine.getArgs().length);
  this.jobConfig=new File(commandLine.getArgs()[0]);
}
Program: 59677
Project: 59677
Buggy source:
@Override protected List<Option> createExtraOptions(){
  List<Option> options=new ArrayList<>();
  options.add(OptionBuilder.withArgName("String_Node_Str").withLongOpt(OPT_STAGES).hasArg().withDescription("String_Node_Str" + RampartStage.getFullListAsString() + "String_Node_Str").create("String_Node_Str"));
  options.add(OptionBuilder.withLongOpt(OPT_RUN_FIRST_HALF).withDescription("String_Node_Str").create("String_Node_Str"));
  options.add(OptionBuilder.withLongOpt(OPT_RUN_SECOND_HALF).withDescription("String_Node_Str").create("String_Node_Str"));
  options.add(OptionBuilder.withArgName("String_Node_Str").withLongOpt(OPT_AMP_INPUT).hasArg().withDescription("String_Node_Str").create("String_Node_Str"));
  return options;
}

Fixed version (ground truth):
@Override protected List<Option> createExtraOptions(){
  List<Option> options=new ArrayList<>();
  options.add(OptionBuilder.withArgName("String_Node_Str").withLongOpt(OPT_STAGES).hasArg().withDescription("String_Node_Str" + RampartStage.getFullListAsString() + "String_Node_Str").create("String_Node_Str"));
  options.add(OptionBuilder.withLongOpt(OPT_RUN_FIRST_HALF).withDescription("String_Node_Str").create("String_Node_Str"));
  options.add(OptionBuilder.withLongOpt(OPT_RUN_SECOND_HALF).withDescription("String_Node_Str").create("String_Node_Str"));
  options.add(OptionBuilder.withArgName("String_Node_Str").withLongOpt(OPT_AMP_INPUT).hasArg().withDescription("String_Node_Str").create("String_Node_Str"));
  options.add(OptionBuilder.withLongOpt(OPT_SKIP_CHECKS).withDescription("String_Node_Str").create("String_Node_Str"));
  return options;
}
Program: 59678
Project: 59678
Buggy source:
/** 
 * Creates a new RAMPART instance based on command line arguments
 * @param args List of command line arguments containing information to setup RAMPART
 * @throws ParseException Thrown if an invalid command line was encountered
 */
public RampartCLI(String[] args) throws ParseException, IOException {
  super(APP_NAME,ETC_DIR,DEFAULT_CONAN_FILE,DEFAULT_LOG_FILE,currentWorkingDir(),APP_NAME + createTimestamp(),false,false);
  this.parse(new PosixParser().parse(createOptions(),args,true));
  if (!this.isHelp()) {
    this.init();
    this.args=new RampartArgs(this.jobConfig,this.getOutputDir(),this.getJobPrefix().replaceAll("String_Node_Str",createTimestamp()),this.stages,this.ampInput);
    this.args.parseXml();
    this.args.setExecutionContext(this.buildExecutionContext());
    if (this.isVerbose()) {
      LogManager.getRootLogger().setLevel(Level.DEBUG);
    }
    log.info("String_Node_Str" + this.getOutputDir().getAbsolutePath());
    log.info("String_Node_Str" + this.getEnvironmentConfig().getAbsolutePath());
    log.info("String_Node_Str" + this.getLogConfig().getAbsolutePath());
    log.info("String_Node_Str" + this.args.getJobPrefix());
    if (ConanProperties.containsKey("String_Node_Str")) {
      log.info("String_Node_Str" + new File(ConanProperties.getProperty("String_Node_Str")).getAbsolutePath());
    }
  }
}

Fixed version (ground truth):
/** 
 * Creates a new RAMPART instance based on command line arguments
 * @param args List of command line arguments containing information to setup RAMPART
 * @throws ParseException Thrown if an invalid command line was encountered
 */
public RampartCLI(String[] args) throws ParseException, IOException {
  this();
  this.parse(new PosixParser().parse(createOptions(),args,true));
}
Program: 59679
Project: 59679
Buggy source:
public RampartArgs(File configFile,File outputDir,String jobPrefix,RampartStageList stages,File ampInput) throws IOException {
  super(configFile,outputDir,jobPrefix);
  this.stages=stages;
  this.libs=new ArrayList<>();
  this.mecqArgs=null;
  this.analyseReadsArgs=null;
  this.massArgs=null;
  this.analyseMassArgs=null;
  this.ampInput=ampInput;
  this.ampArgs=null;
  this.analyseAmpArgs=null;
  this.finaliseArgs=null;
  this.rampartJobFileSystem=new RampartJobFileSystem(outputDir.getAbsoluteFile());
}

Fixed version (ground truth):
public RampartArgs(File configFile,File outputDir,String jobPrefix,RampartStageList stages,File ampInput,boolean doInitialChecks) throws IOException {
  super(configFile,outputDir,jobPrefix);
  this.stages=stages;
  this.libs=new ArrayList<>();
  this.mecqArgs=null;
  this.analyseReadsArgs=null;
  this.massArgs=null;
  this.analyseMassArgs=null;
  this.ampInput=ampInput;
  this.ampArgs=null;
  this.analyseAmpArgs=null;
  this.finaliseArgs=null;
  this.rampartJobFileSystem=new RampartJobFileSystem(outputDir.getAbsoluteFile());
  this.doInitialChecks=doInitialChecks;
}