Program: 188894
Project: 188894
Buggy source:
/** 
 * This is the original run method from the old Workflow launcher. This still does scheduling since the new workflow launcher does not understand scheduling.
 * @return
 */
public ReturnValue doOldRun(){
  BasicWorkflow w=this.createWorkflow();
  boolean metadataWriteback=true;
  if (options.has("String_Node_Str") || options.has("String_Node_Str")) {
    metadataWriteback=false;
  }
  ArrayList<String> parentAccessions=new ArrayList<String>();
  if (options.has("String_Node_Str")) {
    List opts=options.valuesOf("String_Node_Str");
    for (    Object opt : opts) {
      String[] tokens=((String)opt).split("String_Node_Str");
      parentAccessions.addAll(Arrays.asList(tokens));
    }
  }
  ArrayList<String> parentsLinkedToWR=new ArrayList<String>();
  if (options.has("String_Node_Str")) {
    List opts=options.valuesOf("String_Node_Str");
    for (    Object opt : opts) {
      String[] tokens=((String)opt).split("String_Node_Str");
      parentsLinkedToWR.addAll(Arrays.asList(tokens));
    }
  }
  ArrayList<String> iniFiles=new ArrayList<String>();
  if (options.has("String_Node_Str")) {
    List opts=options.valuesOf("String_Node_Str");
    for (    Object opt : opts) {
      String[] tokens=((String)opt).split("String_Node_Str");
      iniFiles.addAll(Arrays.asList(tokens));
    }
  }
  Set<Integer> inputFiles=WorkflowPlugin.collectInputFiles(options,metadata);
  if (options.has(INPUT_FILES) && (inputFiles == null || inputFiles.isEmpty())) {
    Log.error("String_Node_Str");
    ret.setExitStatus(ReturnValue.INVALIDARGUMENT);
    return ret;
  }
  List<String> nonOptions=options.nonOptionArguments();
  Log.info("String_Node_Str" + nonOptions.size());
  if (options.has("String_Node_Str") && options.has("String_Node_Str")) {
    if (options.has(SCHEDULE)) {
      if (!options.has(HOST)) {
        Log.error("String_Node_Str");
        Log.info(this.get_syntax());
        ret.setExitStatus(ReturnValue.INVALIDARGUMENT);
        return ret;
      }
      String host=(String)options.valueOf(HOST);
      String engine=getEngineParam();
      Log.info("String_Node_Str" + host + "String_Node_Str");
      ret=w.scheduleInstalledBundle((String)options.valueOf("String_Node_Str"),(String)options.valueOf("String_Node_Str"),iniFiles,metadataWriteback,parentAccessions,parentsLinkedToWR,false,nonOptions,host,engine,inputFiles);
    }
 else {
      Log.info("String_Node_Str");
      ret=w.launchInstalledBundle((String)options.valueOf("String_Node_Str"),(String)options.valueOf("String_Node_Str"),iniFiles,metadataWriteback,parentAccessions,parentsLinkedToWR,options.has(WAIT),nonOptions,inputFiles);
    }
  }
 else   if ((options.has("String_Node_Str") || options.has("String_Node_Str")) && options.has("String_Node_Str") && options.has("String_Node_Str")&& options.has("String_Node_Str")) {
    Log.info("String_Node_Str");
    String bundlePath="String_Node_Str";
    if (options.has("String_Node_Str")) {
      bundlePath=(String)options.valueOf("String_Node_Str");
    }
 else {
      bundlePath=(String)options.valueOf("String_Node_Str");
    }
    Log.info("String_Node_Str" + bundlePath);
    String workflow=(String)options.valueOf("String_Node_Str");
    String version=(String)options.valueOf("String_Node_Str");
    String metadataFile=(String)options.valueOf("String_Node_Str");
    ret=w.launchBundle(workflow,version,metadataFile,bundlePath,iniFiles,false,new ArrayList<String>(),new ArrayList<String>(),options.has(WAIT),nonOptions,inputFiles);
  }
 else   if (options.has(LAUNCH_SCHEDULED)) {
    try {
      JUnique.acquireLock(appID);
    }
 catch (    AlreadyLockedException e) {
      Log.error("String_Node_Str" + appID + "String_Node_Str",e);
      ret.setExitStatus(ReturnValue.FAILURE);
      return ret;
    }
    launchScheduledWorkflows(w,metadataWriteback);
  }
 else {
    Log.error("String_Node_Str");
    Log.info(this.get_syntax());
    ret.setExitStatus(ReturnValue.INVALIDARGUMENT);
  }
  return ret;
}

Fixed version (ground truth):
/** 
 * This is the original run method from the old Workflow launcher. This still does scheduling since the new workflow launcher does not understand scheduling.
 * @return
 */
public ReturnValue doOldRun(){
  BasicWorkflow w=this.createWorkflow();
  boolean metadataWriteback=true;
  if (options.has("String_Node_Str") || options.has("String_Node_Str")) {
    metadataWriteback=false;
  }
  ArrayList<String> parentAccessions=new ArrayList<String>();
  if (options.has("String_Node_Str")) {
    List opts=options.valuesOf("String_Node_Str");
    for (    Object opt : opts) {
      String[] tokens=((String)opt).split("String_Node_Str");
      parentAccessions.addAll(Arrays.asList(tokens));
    }
  }
  ArrayList<String> parentsLinkedToWR=new ArrayList<String>();
  if (options.has("String_Node_Str")) {
    List opts=options.valuesOf("String_Node_Str");
    for (    Object opt : opts) {
      String[] tokens=((String)opt).split("String_Node_Str");
      parentsLinkedToWR.addAll(Arrays.asList(tokens));
    }
  }
  ArrayList<String> iniFiles=new ArrayList<String>();
  if (options.has("String_Node_Str")) {
    List opts=options.valuesOf("String_Node_Str");
    for (    Object opt : opts) {
      String[] tokens=((String)opt).split("String_Node_Str");
      iniFiles.addAll(Arrays.asList(tokens));
    }
  }
  Set<Integer> inputFiles=WorkflowPlugin.collectInputFiles(options,metadata);
  if (options.has(INPUT_FILES) && (inputFiles == null || inputFiles.isEmpty())) {
    Log.error("String_Node_Str");
    ret.setExitStatus(ReturnValue.INVALIDARGUMENT);
    return ret;
  }
  List<String> nonOptions=options.nonOptionArguments();
  Log.info("String_Node_Str" + nonOptions.size());
  if (options.has("String_Node_Str") && options.has("String_Node_Str")) {
    if (options.has(SCHEDULE)) {
      if (!options.has(HOST)) {
        Log.error("String_Node_Str");
        Log.info(this.get_syntax());
        ret.setExitStatus(ReturnValue.INVALIDARGUMENT);
        return ret;
      }
      String host=(String)options.valueOf(HOST);
      String engine=getEngineParam();
      Log.info("String_Node_Str" + host + "String_Node_Str");
      ret=w.scheduleInstalledBundle((String)options.valueOf("String_Node_Str"),(String)options.valueOf("String_Node_Str"),iniFiles,metadataWriteback,parentAccessions,parentsLinkedToWR,false,nonOptions,host,engine,inputFiles);
    }
 else {
      Log.info("String_Node_Str");
      ret=w.launchInstalledBundle((String)options.valueOf("String_Node_Str"),(String)options.valueOf("String_Node_Str"),iniFiles,metadataWriteback,parentAccessions,parentsLinkedToWR,options.has(WAIT),nonOptions,inputFiles);
    }
  }
 else   if ((options.has("String_Node_Str") || options.has("String_Node_Str")) && options.has("String_Node_Str") && options.has("String_Node_Str")&& options.has("String_Node_Str")) {
    Log.info("String_Node_Str");
    String bundlePath="String_Node_Str";
    if (options.has("String_Node_Str")) {
      bundlePath=(String)options.valueOf("String_Node_Str");
    }
 else {
      bundlePath=(String)options.valueOf("String_Node_Str");
    }
    Log.info("String_Node_Str" + bundlePath);
    String workflow=(String)options.valueOf("String_Node_Str");
    String version=(String)options.valueOf("String_Node_Str");
    String metadataFile=(String)options.valueOf("String_Node_Str");
    ret=w.launchBundle(workflow,version,metadataFile,bundlePath,iniFiles,false,new ArrayList<String>(),new ArrayList<String>(),options.has(WAIT),nonOptions,inputFiles);
  }
 else   if (options.has(LAUNCH_SCHEDULED)) {
    RunLock.acquire();
    launchScheduledWorkflows(w,metadataWriteback);
  }
 else {
    Log.error("String_Node_Str");
    Log.info(this.get_syntax());
    ret.setExitStatus(ReturnValue.INVALIDARGUMENT);
  }
  return ret;
}