Program: 189026
Project: 189026
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.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);
  Log.error("String_Node_Str" + basedir);
  this.mergeCmdOptions(configs);
  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.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);
      this.setupProvisionedPath(ret.getFiles());
      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.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);
  Log.error("String_Node_Str" + basedir);
  this.mergeCmdOptions(configs);
  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.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;
}