Program: 189029
Project: 189029
Buggy source:
@Override public ReturnValue do_run(){
  AbstractWorkflowEngine engine=new PegasusWorkflowEngine();
  WorkflowDataModelFactory factory=new WorkflowDataModelFactory(options,config,params,metadata);
  AbstractWorkflowDataModel dataModel=factory.getWorkflowDataModel();
  ReturnValue retPegasus=engine.launchWorkflow(dataModel);
  if (!Boolean.parseBoolean(dataModel.getConfigs().get("String_Node_Str"))) {
    return retPegasus;
  }
  String wra=dataModel.getConfigs().get("String_Node_Str");
  if (wra == null || wra.isEmpty()) {
    return retPegasus;
  }
  int workflowrunaccession=Integer.parseInt(wra);
  int workflowrun=this.metadata.get_workflow_run_id(workflowrunaccession);
  String stdOut=retPegasus.getStdout();
  Pattern p=Pattern.compile("String_Node_Str");
  Matcher m=p.matcher(stdOut);
  String statusCmd=null;
  if (m.find()) {
    statusCmd=m.group(1);
  }
  p=Pattern.compile("String_Node_Str");
  m=p.matcher(stdOut);
  String statusDir=null;
  if (m.find()) {
    statusDir=m.group(1);
  }
  List<String> parentsLinkedToWR=new ArrayList<String>();
  WorkflowRun wr=null;
  for (  String parentLinkedToWR : parentsLinkedToWR) {
    try {
      this.metadata.linkWorkflowRunAndParent(workflowrun,Integer.parseInt(parentLinkedToWR));
    }
 catch (    Exception e) {
      Log.error(e.getMessage());
    }
  }
  wr=metadata.getWorkflowRun(workflowrunaccession);
  if (retPegasus.getProcessExitStatus() != ReturnValue.SUCCESS || statusCmd == null) {
    metadata.update_workflow_run(workflowrun,dataModel.getTags().get("String_Node_Str"),dataModel.getTags().get("String_Node_Str"),"String_Node_Str",statusCmd,dataModel.getWorkflowBundleDir(),"String_Node_Str","String_Node_Str",wr.getHost(),0,0,retPegasus.getStderr(),retPegasus.getStdout());
    return (retPegasus);
  }
 else {
    metadata.update_workflow_run(workflowrun,dataModel.getTags().get("String_Node_Str"),dataModel.getTags().get("String_Node_Str"),"String_Node_Str",statusCmd,dataModel.getWorkflowBundleDir(),"String_Node_Str","String_Node_Str",wr.getHost(),Integer.parseInt(retPegasus.getAttribute("String_Node_Str")),Integer.parseInt(retPegasus.getAttribute("String_Node_Str")),retPegasus.getStderr(),retPegasus.getStdout());
    return ret;
  }
}

Fixed version (ground truth):
@Override public ReturnValue do_run(){
  AbstractWorkflowEngine engine=new PegasusWorkflowEngine();
  WorkflowDataModelFactory factory=new WorkflowDataModelFactory(options,config,params,metadata);
  AbstractWorkflowDataModel dataModel=factory.getWorkflowDataModel();
  ReturnValue retPegasus=engine.launchWorkflow(dataModel);
  if (!Boolean.parseBoolean(dataModel.getConfigs().get("String_Node_Str"))) {
    return retPegasus;
  }
  String wra=dataModel.getConfigs().get("String_Node_Str");
  if (wra == null || wra.isEmpty()) {
    return retPegasus;
  }
  int workflowrunId=Integer.parseInt(wra);
  int workflowrunaccession=this.metadata.get_workflow_run_accession(workflowrunId);
  String stdOut=retPegasus.getStdout();
  Pattern p=Pattern.compile("String_Node_Str");
  Matcher m=p.matcher(stdOut);
  String statusCmd=null;
  if (m.find()) {
    statusCmd=m.group(1);
  }
  p=Pattern.compile("String_Node_Str");
  m=p.matcher(stdOut);
  String statusDir=null;
  if (m.find()) {
    statusDir=m.group(1);
  }
  List<String> parentsLinkedToWR=new ArrayList<String>();
  WorkflowRun wr=null;
  for (  String parentLinkedToWR : parentsLinkedToWR) {
    try {
      this.metadata.linkWorkflowRunAndParent(workflowrunId,Integer.parseInt(parentLinkedToWR));
    }
 catch (    Exception e) {
      Log.error(e.getMessage());
    }
  }
  wr=metadata.getWorkflowRun(workflowrunaccession);
  if (retPegasus.getProcessExitStatus() != ReturnValue.SUCCESS || statusCmd == null) {
    metadata.update_workflow_run(workflowrunId,dataModel.getTags().get("String_Node_Str"),dataModel.getTags().get("String_Node_Str"),"String_Node_Str",statusCmd,dataModel.getWorkflowBundleDir(),"String_Node_Str","String_Node_Str",wr.getHost(),0,0,retPegasus.getStderr(),retPegasus.getStdout());
    return (retPegasus);
  }
 else {
    metadata.update_workflow_run(workflowrunId,dataModel.getTags().get("String_Node_Str"),dataModel.getTags().get("String_Node_Str"),"String_Node_Str",statusCmd,dataModel.getWorkflowBundleDir(),"String_Node_Str","String_Node_Str",wr.getHost(),Integer.parseInt(retPegasus.getAttribute("String_Node_Str")),Integer.parseInt(retPegasus.getAttribute("String_Node_Str")),retPegasus.getStderr(),retPegasus.getStdout());
    return ret;
  }
}