Program: 122314
Project: 122314
Buggy source:
public void buildFromGraphicalProcess(List<INode> graphicalNodeList){
  initialize();
  if (graphicalNodeList.size() == 0) {
    return;
  }
  List<INode> newGraphicalNodeList=buildCopyOfGraphicalNodeList(graphicalNodeList);
  replaceNodeFromProviders(newGraphicalNodeList);
  if (JobSettingsManager.isImplicittContextLoadActived(duplicatedProcess)) {
    List<DataNode> contextLoadNodes=JobSettingsManager.createExtraContextLoadNodes(duplicatedProcess);
    for (    DataNode node : contextLoadNodes) {
      buildCheckMap.put(node,node);
      addDataNode(node);
      replaceMultipleComponents(node);
    }
  }
  for (  INode node : graphicalNodeList) {
    boolean exist=false;
    for (    INode newNode : newGraphicalNodeList) {
      if (node.getUniqueName().equals(newNode.getUniqueName())) {
        exist=true;
      }
    }
    if (!exist && node.isELTComponent()) {
      buildDataNodeFromNode(node);
    }
  }
  for (  INode node : newGraphicalNodeList) {
    if (node.isSubProcessStart() && node.isActivate()) {
      buildDataNodeFromNode(node);
    }
  }
  for (  INode graphicalNode : graphicalNodeList) {
    if (graphicalNode.getComponent().useMerge()) {
      for (      INode dataNode : dataNodeList) {
        if (graphicalNode.getUniqueName().equals(dataNode.getUniqueName())) {
          adjustMergeOrderForDuplicateNode(graphicalNode,dataNode);
          break;
        }
      }
    }
  }
  for (  INode node : newGraphicalNodeList) {
    if (node.isSubProcessStart() && node.isActivate()) {
      checkFlowRefLink(node);
    }
  }
  for (  INode node : newGraphicalNodeList) {
    checkUseParallelize(node);
  }
  for (  INode node : dataNodeList) {
    Map<INode,Integer> mergeInfo=NodeUtil.getLinkedMergeInfo(node);
    if (!mergeInfo.isEmpty()) {
      ((AbstractNode)node).setThereLinkWithMerge(true);
      ((AbstractNode)node).setLinkedMergeInfo(mergeInfo);
    }
  }
  for (  INode dataNode : dataNodeList) {
    if (dataNode instanceof AbstractNode) {
      INode graphicalNode=((AbstractNode)dataNode).getDesignSubjobStartNode();
      INode currentDataNode=buildCheckMap.get(graphicalNode);
      if (currentDataNode == null || !dataNodeList.contains(currentDataNode)) {
        ((AbstractNode)dataNode).setDesignSubjobStartNode(null);
        currentDataNode=((AbstractNode)dataNode).getDesignSubjobStartNode();
      }
      ((AbstractNode)dataNode).setDesignSubjobStartNode(currentDataNode);
    }
  }
  for (  INode node : newGraphicalNodeList) {
    if (node.isSubProcessStart() && node.isActivate()) {
      if (!hasSingleMergeComponent(node)) {
        checkMergeComponents(node);
      }
    }
  }
  for (  INode node : newGraphicalNodeList) {
    if (node.isSubProcessStart() && node.isActivate()) {
      replaceForValidationRules(node);
    }
  }
  for (  INode node : newGraphicalNodeList) {
    if (node.isSubProcessStart() && node.isActivate()) {
      replaceMultipleComponents(node);
    }
  }
  for (  INode node : newGraphicalNodeList) {
    if (node.isSubProcessStart() && node.isActivate()) {
      replaceFileScalesComponents(node);
    }
  }
  for (  INode node : newGraphicalNodeList) {
    if (node.isSubProcessStart() && node.isActivate()) {
      replaceEltComponents(node);
    }
  }
  for (  INode dataNode : dataNodeList) {
    if (dataNode instanceof AbstractNode) {
      INode currentDataNode=null;
      ((AbstractNode)dataNode).setDesignSubjobStartNode(null);
      currentDataNode=((AbstractNode)dataNode).getDesignSubjobStartNode();
      ((AbstractNode)dataNode).setDesignSubjobStartNode(currentDataNode);
    }
  }
  if (JobSettingsManager.isStatsAndLogsActivated(duplicatedProcess)) {
    Boolean realTimeStats=((Boolean)duplicatedProcess.getElementParameter(EParameterName.CATCH_REALTIME_STATS.getName()).getValue()) && duplicatedProcess.getElementParameter(EParameterName.CATCH_REALTIME_STATS.getName()).isShow(duplicatedProcess.getElementParameters());
    if (!realTimeStats) {
      for (      INode node : dataNodeList) {
        IElementParameter param=node.getElementParameter(EParameterName.TSTATCATCHER_STATS.getName());
        if (param != null) {
          param.setValue(Boolean.FALSE);
        }
      }
    }
    List<DataNode> statsAndLogsNodeList=JobSettingsManager.createStatsAndLogsNodes(duplicatedProcess);
    for (    DataNode node : statsAndLogsNodeList) {
      buildCheckMap.put(node,node);
      addDataNode(node);
      replaceMultipleComponents(node);
    }
  }
  for (  INode node : dataNodeList) {
    Map<INode,Integer> mergeInfo=NodeUtil.getLinkedMergeInfo(node);
    if (!mergeInfo.isEmpty()) {
      ((AbstractNode)node).setThereLinkWithMerge(true);
      ((AbstractNode)node).setLinkedMergeInfo(mergeInfo);
    }
  }
  INode preStaLogConNode=null;
  for (  INode node : dataNodeList) {
    if (node.getComponent().getName().equals(StatsAndLogsManager.TPREJOB) && node.getUniqueName().equals(StatsAndLogsManager.PRE_STA_LOG_CON)) {
      preStaLogConNode=node;
      break;
    }
    ((AbstractNode)node).setUniqueShortName(UniqueNodeNameGenerator.generateUniqueNodeName(((AbstractNode)node).getComponent().getShortName(),shortUniqueNameList));
    shortUniqueNameList.add(node.getUniqueShortName());
  }
  if (preStaLogConNode != null) {
    dataNodeList.remove(preStaLogConNode);
    dataNodeList.add(0,preStaLogConNode);
  }
  checkRefList=null;
  checkMultipleMap=null;
  checktUniteMap=null;
  buildCheckMap=null;
  buildGraphicalMap=null;
  connectionsToIgnoreInMerge=null;
  shortUniqueNameList=null;
  checkValidationList=null;
}

Fixed version (ground truth):
public void buildFromGraphicalProcess(List<INode> graphicalNodeList){
  initialize();
  if (graphicalNodeList.size() == 0) {
    return;
  }
  List<INode> newGraphicalNodeList=buildCopyOfGraphicalNodeList(graphicalNodeList);
  replaceNodeFromProviders(newGraphicalNodeList);
  if (JobSettingsManager.isImplicittContextLoadActived(duplicatedProcess)) {
    List<DataNode> contextLoadNodes=JobSettingsManager.createExtraContextLoadNodes(duplicatedProcess);
    for (    DataNode node : contextLoadNodes) {
      buildCheckMap.put(node,node);
      addDataNode(node);
      replaceMultipleComponents(node);
    }
  }
  for (  INode node : graphicalNodeList) {
    boolean exist=false;
    for (    INode newNode : newGraphicalNodeList) {
      if (node.getUniqueName().equals(newNode.getUniqueName())) {
        exist=true;
      }
    }
    if (!exist && node.isELTComponent()) {
      buildDataNodeFromNode(node);
    }
  }
  for (  INode node : newGraphicalNodeList) {
    if (node.isSubProcessStart() && node.isActivate()) {
      buildDataNodeFromNode(node);
    }
  }
  for (  INode graphicalNode : graphicalNodeList) {
    if (graphicalNode.getComponent().useMerge()) {
      for (      INode dataNode : dataNodeList) {
        if (graphicalNode.getUniqueName().equals(dataNode.getUniqueName())) {
          adjustMergeOrderForDuplicateNode(graphicalNode,dataNode);
          break;
        }
      }
    }
  }
  for (  INode node : newGraphicalNodeList) {
    if (node.isSubProcessStart() && node.isActivate()) {
      checkFlowRefLink(node);
    }
  }
  for (  INode node : newGraphicalNodeList) {
    checkUseParallelize(node);
  }
  for (  INode node : dataNodeList) {
    Map<INode,Integer> mergeInfo=NodeUtil.getLinkedMergeInfo(node);
    if (!mergeInfo.isEmpty()) {
      ((AbstractNode)node).setThereLinkWithMerge(true);
      ((AbstractNode)node).setLinkedMergeInfo(mergeInfo);
    }
  }
  for (  INode dataNode : dataNodeList) {
    if (dataNode instanceof AbstractNode) {
      INode graphicalNode=((AbstractNode)dataNode).getDesignSubjobStartNode();
      INode currentDataNode=buildCheckMap.get(graphicalNode);
      if (currentDataNode == null || !dataNodeList.contains(currentDataNode)) {
        ((AbstractNode)dataNode).setDesignSubjobStartNode(null);
        currentDataNode=((AbstractNode)dataNode).getDesignSubjobStartNode();
      }
      ((AbstractNode)dataNode).setDesignSubjobStartNode(currentDataNode);
    }
  }
  for (  INode node : newGraphicalNodeList) {
    if (node.isSubProcessStart() && node.isActivate()) {
      if (!hasSingleMergeComponent(node)) {
        checkMergeComponents(node);
      }
    }
  }
  for (  INode node : newGraphicalNodeList) {
    if (node.isSubProcessStart() && node.isActivate()) {
      replaceForValidationRules(node);
    }
  }
  for (  INode node : newGraphicalNodeList) {
    if (node.isSubProcessStart() && node.isActivate()) {
      replaceMultipleComponents(node);
    }
  }
  for (  INode node : newGraphicalNodeList) {
    if (node.isSubProcessStart() && node.isActivate()) {
      replaceFileScalesComponents(node);
    }
  }
  for (  INode node : newGraphicalNodeList) {
    if (node.isSubProcessStart() && node.isActivate()) {
      replaceEltComponents(node);
    }
  }
  for (  INode dataNode : dataNodeList) {
    if (dataNode instanceof AbstractNode) {
      INode currentDataNode=null;
      ((AbstractNode)dataNode).setDesignSubjobStartNode(null);
      currentDataNode=((AbstractNode)dataNode).getDesignSubjobStartNode();
      ((AbstractNode)dataNode).setDesignSubjobStartNode(currentDataNode);
    }
  }
  if (JobSettingsManager.isStatsAndLogsActivated(duplicatedProcess)) {
    Boolean realTimeStats=((Boolean)duplicatedProcess.getElementParameter(EParameterName.CATCH_REALTIME_STATS.getName()).getValue()) && duplicatedProcess.getElementParameter(EParameterName.CATCH_REALTIME_STATS.getName()).isShow(duplicatedProcess.getElementParameters());
    if (!realTimeStats) {
      for (      INode node : dataNodeList) {
        IElementParameter param=node.getElementParameter(EParameterName.TSTATCATCHER_STATS.getName());
        if (param != null) {
          param.setValue(Boolean.FALSE);
        }
      }
    }
    List<DataNode> statsAndLogsNodeList=JobSettingsManager.createStatsAndLogsNodes(duplicatedProcess);
    for (    DataNode node : statsAndLogsNodeList) {
      buildCheckMap.put(node,node);
      addDataNode(node);
      replaceMultipleComponents(node);
    }
  }
  for (  INode node : dataNodeList) {
    Map<INode,Integer> mergeInfo=NodeUtil.getLinkedMergeInfo(node);
    if (!mergeInfo.isEmpty()) {
      ((AbstractNode)node).setThereLinkWithMerge(true);
      ((AbstractNode)node).setLinkedMergeInfo(mergeInfo);
    }
 else {
      ((AbstractNode)node).setThereLinkWithMerge(false);
      ((AbstractNode)node).setLinkedMergeInfo(null);
    }
  }
  INode preStaLogConNode=null;
  for (  INode node : dataNodeList) {
    if (node.getComponent().getName().equals(StatsAndLogsManager.TPREJOB) && node.getUniqueName().equals(StatsAndLogsManager.PRE_STA_LOG_CON)) {
      preStaLogConNode=node;
      break;
    }
    ((AbstractNode)node).setUniqueShortName(UniqueNodeNameGenerator.generateUniqueNodeName(((AbstractNode)node).getComponent().getShortName(),shortUniqueNameList));
    shortUniqueNameList.add(node.getUniqueShortName());
  }
  if (preStaLogConNode != null) {
    dataNodeList.remove(preStaLogConNode);
    dataNodeList.add(0,preStaLogConNode);
  }
  checkRefList=null;
  checkMultipleMap=null;
  checktUniteMap=null;
  buildCheckMap=null;
  buildGraphicalMap=null;
  connectionsToIgnoreInMerge=null;
  shortUniqueNameList=null;
  checkValidationList=null;
}