Program: 188981
Project: 188981
Buggy source:
/** 
 * load metadata.xml, if FTL, parse the FTL to XML, and translate it to Java based Object if Java, load the class.
 * @param workflowAccession if this is present, we grab metadata information from the database, not the options
 * @return
 */
public AbstractWorkflowDataModel getWorkflowDataModel(Integer workflowAccession,Integer workflowRunAccession){
  String bundlePath=null;
  Map<String,String> metaInfo=null;
  Log.info("String_Node_Str");
  if (workflowAccession != null) {
    Log.info("String_Node_Str");
    metaInfo=this.metadata.get_workflow_info(workflowAccession);
    bundlePath=metaInfo.get("String_Node_Str");
  }
 else {
    Log.info("String_Node_Str");
    bundlePath=WorkflowV2Utility.determineRelativeBundlePath(options);
  }
  File bundle=new File(bundlePath);
  bundlePath=bundle.getAbsolutePath();
  Log.info("String_Node_Str" + bundlePath);
  if (bundle == null || !bundle.exists()) {
    Log.error("String_Node_Str");
    return null;
  }
  metaInfo=WorkflowV2Utility.parseMetaInfo(bundle);
  if (metaInfo == null) {
    Log.error("String_Node_Str");
    return null;
  }
  Log.info("String_Node_Str");
  boolean workflow_java=true;
  if (metaInfo.get("String_Node_Str") != null && !metaInfo.get("String_Node_Str").toString().isEmpty()) {
    workflow_java=false;
  }
  AbstractWorkflowDataModel dataModel=null;
  Class<?> clazz=null;
  if (workflow_java) {
    String classpath=metaInfo.get("String_Node_Str");
    Log.stdout("String_Node_Str" + classpath);
    WorkflowClassFinder finder=new WorkflowClassFinder();
    clazz=finder.findFirstWorkflowClass(classpath);
    if (null != clazz) {
      Log.debug("String_Node_Str");
      try {
        Object object=clazz.newInstance();
        dataModel=(AbstractWorkflowDataModel)object;
      }
 catch (      InstantiationException ex) {
        Log.error(ex,ex);
      }
catch (      IllegalAccessException ex) {
        Log.error(ex,ex);
      }
catch (      SecurityException ex) {
        Log.error(ex,ex);
      }
catch (      IllegalArgumentException ex) {
        Log.error(ex,ex);
      }
    }
 else {
      Log.stdout("String_Node_Str" + classpath);
    }
  }
 else {
    dataModel=new XmlWorkflowDataModel();
  }
  Log.info("String_Node_Str");
  dataModel.setTags(metaInfo);
  dataModel.setName(metaInfo.get("String_Node_Str"));
  dataModel.setVersion(metaInfo.get("String_Node_Str"));
  dataModel.setBundle_version(metaInfo.get("String_Node_Str"));
  dataModel.setSeqware_version(metaInfo.get("String_Node_Str"));
  dataModel.setWorkflow_directory_name(metaInfo.get("String_Node_Str"));
  dataModel.setWorkflowBundleDir(bundlePath);
  dataModel.setWorkflowBasedir(metaInfo.get("String_Node_Str"));
  dataModel.getEnv().setCompute(metaInfo.get("String_Node_Str"));
  dataModel.getEnv().setNetwork(metaInfo.get("String_Node_Str"));
  dataModel.getEnv().setMemory(metaInfo.get("String_Node_Str"));
  Log.info("String_Node_Str");
  Map<String,String> configs=this.loadIniConfigs(workflowAccession,workflowRunAccession,bundlePath);
  this.mergeCmdOptions(dataModel);
  Date date=new Date();
  dataModel.setDate(date.toString());
  Random rand=new Random(System.currentTimeMillis());
  int randInt=rand.nextInt(100000000);
  dataModel.setRandom("String_Node_Str" + randInt);
  dataModel.getEnv().setPegasusConfigDir(config.get("String_Node_Str"));
  dataModel.getEnv().setDaxDir(config.get("String_Node_Str"));
  dataModel.getEnv().setSwCluster(config.get("String_Node_Str"));
  dataModel.getEnv().setOOZIE_URL(config.get("String_Node_Str"));
  dataModel.getEnv().setOOZIE_APP_ROOT(config.get("String_Node_Str"));
  dataModel.getEnv().setOOZIE_JOBTRACKER(config.get("String_Node_Str"));
  dataModel.getEnv().setOOZIE_NAMENODE(config.get("String_Node_Str"));
  dataModel.getEnv().setOOZIE_QUEUENAME(config.get("String_Node_Str"));
  dataModel.getEnv().setHbase_master(config.get("String_Node_Str"));
  dataModel.getEnv().setHbase_zookeeper_quorum(config.get("String_Node_Str"));
  dataModel.getEnv().setHbase_zookeeper_property_clientPort(config.get("String_Node_Str"));
  dataModel.getEnv().setMapred_job_tracker(config.get("String_Node_Str"));
  dataModel.getEnv().setFs_default_name(config.get("String_Node_Str"));
  dataModel.getEnv().setFs_defaultFS(config.get("String_Node_Str"));
  dataModel.getEnv().setFs_hdfs_impl(config.get("String_Node_Str"));
  dataModel.getEnv().setOOZIE_WORK_DIR(config.get("String_Node_Str"));
  dataModel.getEnv().setOOZIE_APP_PATH(config.get("String_Node_Str"));
  if (options.has("String_Node_Str") == false && options.has(("String_Node_Str"))) {
    int workflowAccession_options=Integer.parseInt((String)options.valueOf("String_Node_Str"));
    int workflowrunaccession=this.metadata.add_workflow_run(workflowAccession_options);
    dataModel.setWorkflow_run_accession(String.valueOf(workflowrunaccession));
  }
 else   if (options.has("String_Node_Str") == false && workflowAccession != null) {
    int workflowrunaccession=this.metadata.add_workflow_run(workflowAccession);
    dataModel.setWorkflow_run_accession(String.valueOf(workflowrunaccession));
  }
  dataModel.setConfigs(configs);
  if (workflow_java) {
    try {
      Method m=null;
      m=clazz.getMethod("String_Node_Str");
      m.invoke(dataModel);
      m=clazz.getMethod("String_Node_Str");
      m.invoke(dataModel);
      m=clazz.getMethod("String_Node_Str");
      m.invoke(dataModel);
      m=clazz.getMethod("String_Node_Str");
      m.invoke(dataModel);
      m=clazz.getMethod("String_Node_Str");
      m.invoke(dataModel);
    }
 catch (    SecurityException e) {
      Log.error(e);
    }
catch (    NoSuchMethodException e) {
      Log.error(e);
    }
catch (    IllegalArgumentException e) {
      Log.error(e);
    }
catch (    IllegalAccessException e) {
      Log.error(e);
    }
catch (    InvocationTargetException e) {
      Log.error(e);
    }
  }
 else {
    WorkflowXmlParser xmlParser=new WorkflowXmlParser();
    xmlParser.parseXml(dataModel,metaInfo.get("String_Node_Str"));
  }
  dataModel.setWait(this.options.has("String_Node_Str"));
  Log.info("String_Node_Str");
  return dataModel;
}

Fixed version (ground truth):
/** 
 * load metadata.xml, if FTL, parse the FTL to XML, and translate it to Java based Object if Java, load the class.
 * @param workflowAccession if this is present, we grab metadata information from the database, not the options
 * @return
 */
public AbstractWorkflowDataModel getWorkflowDataModel(Integer workflowAccession,Integer workflowRunAccession){
  String bundlePath=null;
  Map<String,String> metaInfo=null;
  Log.info("String_Node_Str");
  if (workflowAccession != null) {
    Log.info("String_Node_Str");
    metaInfo=this.metadata.get_workflow_info(workflowAccession);
    bundlePath=metaInfo.get("String_Node_Str");
  }
 else {
    Log.info("String_Node_Str");
    bundlePath=WorkflowV2Utility.determineRelativeBundlePath(options);
  }
  File bundle=new File(bundlePath);
  bundlePath=bundle.getAbsolutePath();
  Log.info("String_Node_Str" + bundlePath);
  if (bundle == null || !bundle.exists()) {
    Log.error("String_Node_Str");
    return null;
  }
  metaInfo=WorkflowV2Utility.parseMetaInfo(bundle);
  if (metaInfo == null) {
    Log.error("String_Node_Str");
    return null;
  }
  Log.info("String_Node_Str");
  boolean workflow_java=true;
  if (metaInfo.get("String_Node_Str") != null && !metaInfo.get("String_Node_Str").toString().isEmpty()) {
    workflow_java=false;
  }
  AbstractWorkflowDataModel dataModel=null;
  Class<?> clazz=null;
  if (workflow_java) {
    String classpath=metaInfo.get("String_Node_Str");
    Log.stdout("String_Node_Str" + classpath);
    WorkflowClassFinder finder=new WorkflowClassFinder();
    clazz=finder.findFirstWorkflowClass(classpath);
    if (null != clazz) {
      Log.debug("String_Node_Str");
      try {
        Object object=clazz.newInstance();
        dataModel=(AbstractWorkflowDataModel)object;
      }
 catch (      InstantiationException ex) {
        Log.error(ex,ex);
      }
catch (      IllegalAccessException ex) {
        Log.error(ex,ex);
      }
catch (      SecurityException ex) {
        Log.error(ex,ex);
      }
catch (      IllegalArgumentException ex) {
        Log.error(ex,ex);
      }
    }
 else {
      Log.stdout("String_Node_Str" + classpath);
    }
  }
 else {
    dataModel=new XmlWorkflowDataModel();
  }
  Log.info("String_Node_Str");
  dataModel.setTags(metaInfo);
  dataModel.setName(metaInfo.get("String_Node_Str"));
  dataModel.setVersion(metaInfo.get("String_Node_Str"));
  dataModel.setBundle_version(metaInfo.get("String_Node_Str"));
  dataModel.setSeqware_version(metaInfo.get("String_Node_Str"));
  dataModel.setWorkflow_directory_name(metaInfo.get("String_Node_Str"));
  dataModel.setWorkflowBundleDir(bundlePath);
  dataModel.setWorkflowBasedir(metaInfo.get("String_Node_Str"));
  dataModel.getEnv().setCompute(metaInfo.get("String_Node_Str"));
  dataModel.getEnv().setNetwork(metaInfo.get("String_Node_Str"));
  dataModel.getEnv().setMemory(metaInfo.get("String_Node_Str"));
  Log.info("String_Node_Str");
  Map<String,String> configs=this.loadIniConfigs(workflowAccession,workflowRunAccession,bundlePath);
  this.mergeCmdOptions(dataModel);
  Date date=new Date();
  dataModel.setDate(date.toString());
  Random rand=new Random(System.currentTimeMillis());
  int randInt=rand.nextInt(100000000);
  dataModel.setRandom("String_Node_Str" + randInt);
  dataModel.getEnv().setPegasusConfigDir(config.get("String_Node_Str"));
  dataModel.getEnv().setDaxDir(config.get("String_Node_Str"));
  dataModel.getEnv().setSwCluster(config.get("String_Node_Str"));
  dataModel.getEnv().setOOZIE_URL(config.get("String_Node_Str"));
  dataModel.getEnv().setOOZIE_APP_ROOT(config.get("String_Node_Str"));
  dataModel.getEnv().setOOZIE_JOBTRACKER(config.get("String_Node_Str"));
  dataModel.getEnv().setOOZIE_NAMENODE(config.get("String_Node_Str"));
  dataModel.getEnv().setOOZIE_QUEUENAME(config.get("String_Node_Str"));
  dataModel.getEnv().setHbase_master(config.get("String_Node_Str"));
  dataModel.getEnv().setHbase_zookeeper_quorum(config.get("String_Node_Str"));
  dataModel.getEnv().setHbase_zookeeper_property_clientPort(config.get("String_Node_Str"));
  dataModel.getEnv().setMapred_job_tracker(config.get("String_Node_Str"));
  dataModel.getEnv().setFs_default_name(config.get("String_Node_Str"));
  dataModel.getEnv().setFs_defaultFS(config.get("String_Node_Str"));
  dataModel.getEnv().setFs_hdfs_impl(config.get("String_Node_Str"));
  dataModel.getEnv().setOOZIE_WORK_DIR(config.get("String_Node_Str"));
  dataModel.getEnv().setOOZIE_APP_PATH(config.get("String_Node_Str"));
  if (options.has("String_Node_Str") == false) {
    if (workflowAccession != null && workflowRunAccession == null) {
      int workflowrunaccession=this.metadata.add_workflow_run(workflowAccession);
      dataModel.setWorkflow_accession(Integer.toString(workflowAccession));
      dataModel.setWorkflow_run_accession(String.valueOf(workflowrunaccession));
    }
 else     if (workflowAccession != null && workflowRunAccession != null) {
      dataModel.setWorkflow_accession(Integer.toString(workflowAccession));
      dataModel.setWorkflow_run_accession(String.valueOf(workflowRunAccession));
    }
 else {
      assert(false);
      Log.error("String_Node_Str");
      throw new UnsupportedOperationException();
    }
  }
  dataModel.setConfigs(configs);
  if (workflow_java) {
    try {
      Method m=null;
      m=clazz.getMethod("String_Node_Str");
      m.invoke(dataModel);
      m=clazz.getMethod("String_Node_Str");
      m.invoke(dataModel);
      m=clazz.getMethod("String_Node_Str");
      m.invoke(dataModel);
      m=clazz.getMethod("String_Node_Str");
      m.invoke(dataModel);
      m=clazz.getMethod("String_Node_Str");
      m.invoke(dataModel);
    }
 catch (    SecurityException e) {
      Log.error(e);
    }
catch (    NoSuchMethodException e) {
      Log.error(e);
    }
catch (    IllegalArgumentException e) {
      Log.error(e);
    }
catch (    IllegalAccessException e) {
      Log.error(e);
    }
catch (    InvocationTargetException e) {
      Log.error(e);
    }
  }
 else {
    WorkflowXmlParser xmlParser=new WorkflowXmlParser();
    xmlParser.parseXml(dataModel,metaInfo.get("String_Node_Str"));
  }
  dataModel.setWait(this.options.has("String_Node_Str"));
  Log.info("String_Node_Str");
  return dataModel;
}