Program: 62376
Project: 62376
Buggy source:
public void addNode(Workflow wf,String nodeId,TopologyContext toscaTypeFinder,boolean isCompute){
  if (WorkflowUtils.isNativeNode(nodeId,toscaTypeFinder)) {
    WorkflowUtils.addDelegateWorkflowStep(wf,nodeId);
  }
 else {
    AbstractStep lastStep=null;
    String parentId=WorkflowUtils.getParentId(wf,nodeId,toscaTypeFinder);
    if (parentId != null) {
      if (WorkflowUtils.isNativeNode(parentId,toscaTypeFinder)) {
        lastStep=WorkflowUtils.getDelegateWorkflowStepByNode(wf,parentId);
      }
 else {
        NodeActivityStep startedStep=WorkflowUtils.getStateStepByNode(wf,parentId,ToscaNodeLifecycleConstants.STARTED);
        if (startedStep != null) {
          lastStep=startedStep;
        }
      }
    }
    lastStep=appendStateStep(wf,lastStep,nodeId,ToscaNodeLifecycleConstants.INITIAL);
    lastStep=appendStateStep(wf,lastStep,nodeId,ToscaNodeLifecycleConstants.CREATING);
    lastStep=eventuallyAddStdOperationStep(wf,lastStep,nodeId,ToscaNodeLifecycleConstants.CREATE,toscaTypeFinder,false);
    lastStep=appendStateStep(wf,lastStep,nodeId,ToscaNodeLifecycleConstants.CREATED);
    lastStep=appendStateStep(wf,lastStep,nodeId,ToscaNodeLifecycleConstants.CONFIGURING);
    lastStep=eventuallyAddStdOperationStep(wf,lastStep,nodeId,ToscaNodeLifecycleConstants.CONFIGURE,toscaTypeFinder,true);
    lastStep=appendStateStep(wf,lastStep,nodeId,ToscaNodeLifecycleConstants.CONFIGURED);
    lastStep=appendStateStep(wf,lastStep,nodeId,ToscaNodeLifecycleConstants.STARTING);
    lastStep=eventuallyAddStdOperationStep(wf,lastStep,nodeId,ToscaNodeLifecycleConstants.START,toscaTypeFinder,true);
    lastStep=appendStateStep(wf,lastStep,nodeId,ToscaNodeLifecycleConstants.STARTED);
  }
}

Fixed version (ground truth):
public void addNode(Workflow wf,String nodeId,TopologyContext toscaTypeFinder,boolean isCompute){
  if (WorkflowUtils.isNativeOrSubstitutionNode(nodeId,toscaTypeFinder)) {
    WorkflowUtils.addDelegateWorkflowStep(wf,nodeId);
  }
 else {
    AbstractStep lastStep=null;
    String parentId=WorkflowUtils.getParentId(wf,nodeId,toscaTypeFinder);
    if (parentId != null) {
      if (WorkflowUtils.isNativeOrSubstitutionNode(parentId,toscaTypeFinder)) {
        lastStep=WorkflowUtils.getDelegateWorkflowStepByNode(wf,parentId);
      }
 else {
        NodeActivityStep startedStep=WorkflowUtils.getStateStepByNode(wf,parentId,ToscaNodeLifecycleConstants.STARTED);
        if (startedStep != null) {
          lastStep=startedStep;
        }
      }
    }
    lastStep=appendStateStep(wf,lastStep,nodeId,ToscaNodeLifecycleConstants.INITIAL);
    lastStep=appendStateStep(wf,lastStep,nodeId,ToscaNodeLifecycleConstants.CREATING);
    lastStep=eventuallyAddStdOperationStep(wf,lastStep,nodeId,ToscaNodeLifecycleConstants.CREATE,toscaTypeFinder,false);
    lastStep=appendStateStep(wf,lastStep,nodeId,ToscaNodeLifecycleConstants.CREATED);
    lastStep=appendStateStep(wf,lastStep,nodeId,ToscaNodeLifecycleConstants.CONFIGURING);
    lastStep=eventuallyAddStdOperationStep(wf,lastStep,nodeId,ToscaNodeLifecycleConstants.CONFIGURE,toscaTypeFinder,true);
    lastStep=appendStateStep(wf,lastStep,nodeId,ToscaNodeLifecycleConstants.CONFIGURED);
    lastStep=appendStateStep(wf,lastStep,nodeId,ToscaNodeLifecycleConstants.STARTING);
    lastStep=eventuallyAddStdOperationStep(wf,lastStep,nodeId,ToscaNodeLifecycleConstants.START,toscaTypeFinder,true);
    lastStep=appendStateStep(wf,lastStep,nodeId,ToscaNodeLifecycleConstants.STARTED);
  }
}