Program: 118281
Project: 118281
Buggy source:
@Override public void buildFromGraphicalProcess(List<INode> graphicalNodeList){
  initialize();
  if (graphicalNodeList.size() == 0) {
    return;
  }
  List<INode> newGraphicalNodeList=buildCopyOfGraphicalNodeList(graphicalNodeList);
  if (ProcessUtils.isTestContainer(graphicalNodeList.get(0).getProcess())) {
    for (    IReplaceNodeInProcess replaceProvider : ReplaceNodesInProcessProvider.findReplaceNodesProvider()) {
      replaceProvider.rebuildGraphicProcessFromNode(newGraphicalNodeList.get(0),newGraphicalNodeList);
    }
  }
 else {
    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);
    }
  }
  checkPigLoadComponent();
  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);
  }
  for (  INode node : dataNodeList) {
    if (node.isSubProcessStart() && node.isActivate()) {
      tagComponentAfterParallelIterator(node);
    }
  }
  for (  INode node : dataNodeList) {
    if (node.isSubProcessStart() && node.isActivate()) {
      tagSubProcessAfterParallelIterator(node);
    }
  }
  checkRefList=null;
  checkMultipleMap=null;
  checktUniteMap=null;
  buildCheckMap=null;
  buildGraphicalMap=null;
  connectionsToIgnoreInMerge=null;
  shortUniqueNameList=null;
  checkValidationList=null;
}

Fixed version (ground truth):
@Override 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);
    }
  }
  checkPigLoadComponent();
  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);
  }
  for (  INode node : dataNodeList) {
    if (node.isSubProcessStart() && node.isActivate()) {
      tagComponentAfterParallelIterator(node);
    }
  }
  for (  INode node : dataNodeList) {
    if (node.isSubProcessStart() && node.isActivate()) {
      tagSubProcessAfterParallelIterator(node);
    }
  }
  checkRefList=null;
  checkMultipleMap=null;
  checktUniteMap=null;
  buildCheckMap=null;
  buildGraphicalMap=null;
  connectionsToIgnoreInMerge=null;
  shortUniqueNameList=null;
  checkValidationList=null;
}