Program: 189016
Project: 189016
Buggy source:
/** 
 * load metadata.xml, if FTL, parse the FTL to XML, and translate it to Java based Object if Java, load the class. 
 * @return
 */
public AbstractWorkflowDataModel getWorkflowDataModel(){
  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");
  }
  File bundle=new File(bundlePath);
  Log.info("String_Node_Str" + bundlePath);
  if (bundle == null || !bundle.exists()) {
    Log.error("String_Node_Str");
    return null;
  }
  @SuppressWarnings("String_Node_Str") Iterator<File> it=FileUtils.iterateFiles(bundle,new String[]{"String_Node_Str"},true);
  if (!it.hasNext())   return null;
  File metadataFile=null;
  while (it.hasNext()) {
    File file=it.next();
    if (file.getName().equals("String_Node_Str")) {
      metadataFile=file;
      break;
    }
  }
  if (metadataFile == null)   return null;
  Map<String,String> metaInfo=this.parseMetadataInfo(metadataFile,bundlePath);
  boolean workflow_java=true;
  if (metaInfo.get("String_Node_Str") != null && !metaInfo.get("String_Node_Str").toString().isEmpty())   workflow_java=false;
  AbstractWorkflowDataModel ret=null;
  Class<?> clazz=null;
  if (workflow_java) {
    String clazzPath=metaInfo.get("String_Node_Str");
    Log.info("String_Node_Str" + clazzPath);
    WorkflowClassFinder finder=new WorkflowClassFinder();
    clazz=finder.findFirstWorkflowClass(clazzPath);
    if (null != clazz) {
      Log.debug("String_Node_Str");
      try {
        Object object=clazz.newInstance();
        ret=(AbstractWorkflowDataModel)object;
      }
 catch (      InstantiationException ex) {
        Log.error(ex);
      }
catch (      IllegalAccessException ex) {
        Log.error(ex);
      }
catch (      SecurityException ex) {
        Log.error(ex);
      }
catch (      IllegalArgumentException ex) {
        Log.error(ex);
      }
    }
  }
 else {
    ret=new XmlWorkflowDataModel();
  }
  ret.setTags(metaInfo);
  ret.setName(metaInfo.get("String_Node_Str"));
  ret.setVersion(metaInfo.get("String_Node_Str"));
  ret.setWorkflowBundleDir(bundlePath);
  ret.getEnv().setCompute(metaInfo.get("String_Node_Str"));
  ret.getEnv().setNetwork(metaInfo.get("String_Node_Str"));
  ret.getEnv().setMemory(metaInfo.get("String_Node_Str"));
  Map<String,String> configs=this.loadIniConfigs();
  configs.put("String_Node_Str",bundlePath);
  configs.put("String_Node_Str",ret.getName());
  String basedir=bundlePath + File.separator + "String_Node_Str"+ ret.getName()+ File.separator+ ret.getVersion();
  configs.put("String_Node_Str",basedir);
  this.mergeCmdOptions(ret);
  Date date=new Date();
  ret.setDate(date.toString());
  Random rand=new Random(System.currentTimeMillis());
  int randInt=rand.nextInt(100000000);
  ret.setRandom("String_Node_Str" + randInt);
  ret.getEnv().setPegasusConfigDir(config.get("String_Node_Str"));
  ret.getEnv().setDaxDir(config.get("String_Node_Str"));
  ret.getEnv().setSwCluster(config.get("String_Node_Str"));
  if (options.has(("String_Node_Str"))) {
    int workflowAccession=Integer.parseInt((String)options.valueOf("String_Node_Str"));
    int workflowrunaccession=this.metadata.add_workflow_run(workflowAccession);
    configs.put("String_Node_Str","String_Node_Str" + workflowrunaccession);
    ret.setWorkflow_run_accession("String_Node_Str" + workflowrunaccession);
  }
  ret.setConfigs(configs);
  if (workflow_java) {
    try {
      Method m=null;
      m=clazz.getMethod("String_Node_Str");
      m.invoke(ret);
      m=clazz.getMethod("String_Node_Str");
      m.invoke(ret);
      m=clazz.getMethod("String_Node_Str");
      m.invoke(ret);
      m=clazz.getMethod("String_Node_Str");
      m.invoke(ret);
      m=clazz.getMethod("String_Node_Str");
      m.invoke(ret);
    }
 catch (    SecurityException e) {
      e.printStackTrace();
    }
catch (    NoSuchMethodException e) {
      e.printStackTrace();
    }
catch (    IllegalArgumentException e) {
      e.printStackTrace();
    }
catch (    IllegalAccessException e) {
      e.printStackTrace();
    }
catch (    InvocationTargetException e) {
      e.printStackTrace();
    }
  }
 else {
    WorkflowXmlParser xmlParser=new WorkflowXmlParser();
    xmlParser.parseXml(ret,metaInfo.get("String_Node_Str"));
  }
  ret.setWait(this.options.has("String_Node_Str"));
  return ret;
}

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. 
 * @return
 */
public AbstractWorkflowDataModel getWorkflowDataModel(){
  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");
  }
  File bundle=new File(bundlePath);
  Log.info("String_Node_Str" + bundlePath);
  if (bundle == null || !bundle.exists()) {
    Log.error("String_Node_Str");
    return null;
  }
  @SuppressWarnings("String_Node_Str") Iterator<File> it=FileUtils.iterateFiles(bundle,new String[]{"String_Node_Str"},true);
  if (!it.hasNext())   return null;
  File metadataFile=null;
  while (it.hasNext()) {
    File file=it.next();
    if (file.getName().equals("String_Node_Str")) {
      metadataFile=file;
      break;
    }
  }
  if (metadataFile == null)   return null;
  Map<String,String> metaInfo=this.parseMetadataInfo(metadataFile,bundlePath);
  boolean workflow_java=true;
  if (metaInfo.get("String_Node_Str") != null && !metaInfo.get("String_Node_Str").toString().isEmpty())   workflow_java=false;
  AbstractWorkflowDataModel ret=null;
  Class<?> clazz=null;
  if (workflow_java) {
    String clazzPath=metaInfo.get("String_Node_Str");
    Log.info("String_Node_Str" + clazzPath);
    WorkflowClassFinder finder=new WorkflowClassFinder();
    clazz=finder.findFirstWorkflowClass(clazzPath);
    if (null != clazz) {
      Log.debug("String_Node_Str");
      try {
        Object object=clazz.newInstance();
        ret=(AbstractWorkflowDataModel)object;
      }
 catch (      InstantiationException ex) {
        Log.error(ex);
      }
catch (      IllegalAccessException ex) {
        Log.error(ex);
      }
catch (      SecurityException ex) {
        Log.error(ex);
      }
catch (      IllegalArgumentException ex) {
        Log.error(ex);
      }
    }
  }
 else {
    ret=new XmlWorkflowDataModel();
  }
  ret.setTags(metaInfo);
  ret.setName(metaInfo.get("String_Node_Str"));
  ret.setVersion(metaInfo.get("String_Node_Str"));
  ret.setWorkflowBundleDir(bundlePath);
  ret.getEnv().setCompute(metaInfo.get("String_Node_Str"));
  ret.getEnv().setNetwork(metaInfo.get("String_Node_Str"));
  ret.getEnv().setMemory(metaInfo.get("String_Node_Str"));
  Map<String,String> configs=this.loadIniConfigs();
  configs.put("String_Node_Str",bundlePath);
  configs.put("String_Node_Str",ret.getName());
  String basedir=bundlePath + File.separator + "String_Node_Str"+ ret.getName()+ File.separator+ ret.getVersion();
  configs.put("String_Node_Str",basedir);
  this.mergeCmdOptions(ret);
  Date date=new Date();
  ret.setDate(date.toString());
  Random rand=new Random(System.currentTimeMillis());
  int randInt=rand.nextInt(100000000);
  ret.setRandom("String_Node_Str" + randInt);
  ret.getEnv().setPegasusConfigDir(config.get("String_Node_Str"));
  ret.getEnv().setDaxDir(config.get("String_Node_Str"));
  ret.getEnv().setSwCluster(config.get("String_Node_Str"));
  ret.getEnv().setOOZIE_URL(config.get("String_Node_Str"));
  ret.getEnv().setOOZIE_APP_ROOT(config.get("String_Node_Str"));
  ret.getEnv().setOOZIE_JOBTRACKER(config.get("String_Node_Str"));
  ret.getEnv().setOOZIE_NAMENODE(config.get("String_Node_Str"));
  ret.getEnv().setOOZIE_QUEUENAME(config.get("String_Node_Str"));
  ret.getEnv().setHADOOP_CORE_XML(config.get("String_Node_Str"));
  ret.getEnv().setHADOOP_HDFS_SITE_XML(config.get("String_Node_Str"));
  ret.getEnv().setHADOOP_MAPRED_SITE_XML(config.get("String_Node_Str"));
  ret.getEnv().setOOZIE_WORK_DIR(config.get("String_Node_Str"));
  ret.getEnv().setOOZIE_APP_PATH(config.get("String_Node_Str"));
  if (options.has(("String_Node_Str"))) {
    int workflowAccession=Integer.parseInt((String)options.valueOf("String_Node_Str"));
    int workflowrunaccession=this.metadata.add_workflow_run(workflowAccession);
    configs.put("String_Node_Str","String_Node_Str" + workflowrunaccession);
    ret.setWorkflow_run_accession("String_Node_Str" + workflowrunaccession);
  }
  ret.setConfigs(configs);
  if (workflow_java) {
    try {
      Method m=null;
      m=clazz.getMethod("String_Node_Str");
      m.invoke(ret);
      m=clazz.getMethod("String_Node_Str");
      m.invoke(ret);
      m=clazz.getMethod("String_Node_Str");
      m.invoke(ret);
      m=clazz.getMethod("String_Node_Str");
      m.invoke(ret);
      m=clazz.getMethod("String_Node_Str");
      m.invoke(ret);
    }
 catch (    SecurityException e) {
      e.printStackTrace();
    }
catch (    NoSuchMethodException e) {
      e.printStackTrace();
    }
catch (    IllegalArgumentException e) {
      e.printStackTrace();
    }
catch (    IllegalAccessException e) {
      e.printStackTrace();
    }
catch (    InvocationTargetException e) {
      e.printStackTrace();
    }
  }
 else {
    WorkflowXmlParser xmlParser=new WorkflowXmlParser();
    xmlParser.parseXml(ret,metaInfo.get("String_Node_Str"));
  }
  ret.setWait(this.options.has("String_Node_Str"));
  return ret;
}