Program: 123789
Project: 123789
Buggy source:
/** 
 * nrousseau Comment method "prepareAllMultipleComponentNodes".
 * @param itemsMap
 * @param multipleComponentManager
 * @param graphicalNode
 */
private void prepareAllMultipleComponentNodes(Map<IMultipleComponentItem,AbstractNode> itemsMap,IMultipleComponentManager multipleComponentManager,INode graphicalNode){
  List<IMultipleComponentItem> itemList=multipleComponentManager.getItemList();
  for (  IMultipleComponentItem curItem : itemList) {
    String uniqueName=graphicalNode.getUniqueName() + "String_Node_Str" + curItem.getName();
    IComponent component=ComponentsFactoryProvider.getInstance().get(curItem.getComponent());
    if (component == null) {
      continue;
    }
    AbstractNode curNode;
    if (component.getPluginExtension() == null) {
      curNode=new DataNode(component,uniqueName);
    }
 else {
      curNode=(AbstractNode)ExternalNodesFactory.getInstance(component.getPluginExtension());
      IExternalData externalData=graphicalNode.getExternalData();
      IExternalNode externalNode=graphicalNode.getExternalNode();
      if (externalData != null) {
        ((IExternalNode)curNode).setExternalData(externalData);
      }
      if (externalNode != null) {
        ((IExternalNode)curNode).setExternalEmfData(externalNode.getExternalEmfData());
      }
      curNode.setStart(graphicalNode.isStart());
      curNode.setElementParameters(graphicalNode.getComponent().createElementParameters(curNode));
      curNode.setListConnector(graphicalNode.getListConnector());
      copyElementParametersValue(graphicalNode,curNode);
      curNode.setUniqueName(uniqueName);
      curNode.setSubProcessStart(graphicalNode.isSubProcessStart());
      curNode.setThereLinkWithHash(graphicalNode.isThereLinkWithHash());
      curNode.setHasConditionalOutputs(graphicalNode.hasConditionalOutputs());
      curNode.setIsMultiplyingOutputs(graphicalNode.isMultiplyingOutputs());
      curNode.setComponent(component);
      List<IMetadataTable> metaList=new ArrayList<IMetadataTable>();
      IMetadataTable metaTable=new MetadataTable();
      metaTable.setTableName(uniqueName);
      metaList.add(metaTable);
      curNode.setMetadataList(metaList);
    }
    curNode.setActivate(graphicalNode.isActivate());
    IMetadataTable newMetadata=null;
    if (multipleComponentManager.isSetConnector()) {
      newMetadata=graphicalNode.getMetadataFromConnector(multipleComponentManager.getConnector()).clone();
    }
 else {
      String sourceConnector=null;
      for (      IMultipleComponentParameter param : multipleComponentManager.getParamList()) {
        if (curItem.getName().equals(param.getTargetComponent())) {
          for (          IElementParameter paramComp : graphicalNode.getElementParameters()) {
            if (param.getSourceValue().equals(paramComp.getName())) {
              sourceConnector=paramComp.getContext();
            }
          }
        }
      }
      if (sourceConnector == null) {
        sourceConnector=EConnectionType.FLOW_MAIN.getName();
      }
      IMetadataTable metadataTable=graphicalNode.getMetadataFromConnector(sourceConnector);
      if (metadataTable != null) {
        newMetadata=metadataTable.clone();
      }
 else {
        newMetadata=graphicalNode.getMetadataList().get(0).clone();
      }
    }
    if (newMetadata == null) {
      continue;
    }
    newMetadata.setTableName(uniqueName);
    if (graphicalNode.isDesignSubjobStartNode()) {
      curNode.setDesignSubjobStartNode(null);
    }
 else {
      curNode.setDesignSubjobStartNode(graphicalNode.getDesignSubjobStartNode());
    }
    if (multipleComponentManager.isSetConnector() && multipleComponentManager.getOutputName().equals(curItem.getName())) {
      if (curNode.getComponentName().equals("String_Node_Str")) {
        curNode.setActivate(false);
      }
 else {
        List<IMetadataTable> newMetadataList=new ArrayList<IMetadataTable>();
        if (graphicalNode.getMetadataList() != null) {
          for (          IMetadataTable metadataTable : graphicalNode.getMetadataList()) {
            newMetadataList.add(metadataTable.clone());
          }
        }
        curNode.setMetadataList(newMetadataList);
      }
    }
 else {
      if (curNode.getMetadataList() != null) {
        curNode.getMetadataList().remove(0);
        curNode.getMetadataList().add(newMetadata);
      }
    }
    List<IConnection> outgoingConnections=new ArrayList<IConnection>();
    List<IConnection> incomingConnections=new ArrayList<IConnection>();
    curNode.setIncomingConnections(incomingConnections);
    curNode.setOutgoingConnections(outgoingConnections);
    curNode.setProcess(graphicalNode.getProcess());
    curNode.setVirtualGenerateNode(true);
    addDataNode(curNode);
    itemsMap.put(curItem,curNode);
  }
}

Fixed version (ground truth):
/** 
 * nrousseau Comment method "prepareAllMultipleComponentNodes".
 * @param itemsMap
 * @param multipleComponentManager
 * @param graphicalNode
 */
private void prepareAllMultipleComponentNodes(Map<IMultipleComponentItem,AbstractNode> itemsMap,IMultipleComponentManager multipleComponentManager,INode graphicalNode){
  List<IMultipleComponentItem> itemList=multipleComponentManager.getItemList();
  for (  IMultipleComponentItem curItem : itemList) {
    String uniqueName=graphicalNode.getUniqueName() + "String_Node_Str" + curItem.getName();
    IComponent component=ComponentsFactoryProvider.getInstance().get(curItem.getComponent());
    if (component == null) {
      continue;
    }
    AbstractNode curNode;
    if (component.getPluginExtension() == null) {
      curNode=new DataNode(component,uniqueName);
    }
 else {
      curNode=(AbstractNode)ExternalNodesFactory.getInstance(component.getPluginExtension());
      IExternalData externalData=graphicalNode.getExternalData();
      IExternalNode externalNode=graphicalNode.getExternalNode();
      if (externalData != null) {
        ((IExternalNode)curNode).setExternalData(externalData);
      }
      if (externalNode != null) {
        ((IExternalNode)curNode).setExternalEmfData(externalNode.getExternalEmfData());
      }
      curNode.setStart(graphicalNode.isStart());
      curNode.setElementParameters(graphicalNode.getComponent().createElementParameters(curNode));
      curNode.setListConnector(graphicalNode.getListConnector());
      copyElementParametersValue(graphicalNode,curNode);
      curNode.setUniqueName(uniqueName);
      curNode.setSubProcessStart(graphicalNode.isSubProcessStart());
      curNode.setThereLinkWithHash(graphicalNode.isThereLinkWithHash());
      curNode.setHasConditionalOutputs(graphicalNode.hasConditionalOutputs());
      curNode.setIsMultiplyingOutputs(graphicalNode.isMultiplyingOutputs());
      curNode.setComponent(component);
      List<IMetadataTable> metaList=new ArrayList<IMetadataTable>();
      IMetadataTable metaTable=new MetadataTable();
      metaTable.setTableName(uniqueName);
      metaList.add(metaTable);
      curNode.setMetadataList(metaList);
    }
    curNode.setActivate(graphicalNode.isActivate());
    IMetadataTable newMetadata=null;
    if (multipleComponentManager.isSetConnector()) {
      newMetadata=graphicalNode.getMetadataFromConnector(multipleComponentManager.getConnector()).clone();
    }
 else {
      String sourceConnector=null;
      for (      IMultipleComponentParameter param : multipleComponentManager.getParamList()) {
        if (curItem.getName().equals(param.getTargetComponent())) {
          for (          IElementParameter paramComp : graphicalNode.getElementParameters()) {
            if (param.getSourceValue().equals(paramComp.getName())) {
              sourceConnector=paramComp.getContext();
            }
          }
        }
      }
      if (sourceConnector == null) {
        sourceConnector=EConnectionType.FLOW_MAIN.getName();
      }
      IMetadataTable metadataTable=graphicalNode.getMetadataFromConnector(sourceConnector);
      if (metadataTable != null) {
        newMetadata=metadataTable.clone();
      }
 else       if (!graphicalNode.getMetadataList().isEmpty()) {
        newMetadata=graphicalNode.getMetadataList().get(0).clone();
      }
    }
    if (newMetadata != null) {
      newMetadata.setTableName(uniqueName);
    }
    if (graphicalNode.isDesignSubjobStartNode()) {
      curNode.setDesignSubjobStartNode(null);
    }
 else {
      curNode.setDesignSubjobStartNode(graphicalNode.getDesignSubjobStartNode());
    }
    if (multipleComponentManager.isSetConnector() && multipleComponentManager.getOutputName().equals(curItem.getName())) {
      if (curNode.getComponentName().equals("String_Node_Str")) {
        curNode.setActivate(false);
      }
 else {
        List<IMetadataTable> newMetadataList=new ArrayList<IMetadataTable>();
        if (graphicalNode.getMetadataList() != null) {
          for (          IMetadataTable metadataTable : graphicalNode.getMetadataList()) {
            newMetadataList.add(metadataTable.clone());
          }
        }
        curNode.setMetadataList(newMetadataList);
      }
    }
 else {
      if (curNode.getMetadataList() != null && newMetadata != null) {
        curNode.getMetadataList().remove(0);
        curNode.getMetadataList().add(newMetadata);
      }
    }
    List<IConnection> outgoingConnections=new ArrayList<IConnection>();
    List<IConnection> incomingConnections=new ArrayList<IConnection>();
    curNode.setIncomingConnections(incomingConnections);
    curNode.setOutgoingConnections(outgoingConnections);
    curNode.setProcess(graphicalNode.getProcess());
    curNode.setVirtualGenerateNode(true);
    addDataNode(curNode);
    itemsMap.put(curItem,curNode);
  }
}