Program: 122375
Project: 122375
Buggy source:
/** 
 * DOC ycbai Comment method "replaceReferenceValidationRules".
 * @param connection
 * @param rulesConnection
 * @param isOutput
 * @param graphicalNode
 */
private void replaceReferenceValidationRules(INode graphicalNode,IConnection connection,ValidationRulesConnection rulesConnection,boolean isOutput){
  INode node=getApplicableNode(connection,isOutput);
  INode endNode=null;
  if (!checkTriggerAndDBSettings(node,rulesConnection,isOutput)) {
    return;
  }
  String baseSchema=rulesConnection.getBaseSchema();
  String refSchema=rulesConnection.getRefSchema();
  if (baseSchema == null || refSchema == null) {
    return;
  }
  String[] values=refSchema.split("String_Node_Str");
  String itemId=values[0];
  String tabName=values[1];
  if (itemId == null) {
    return;
  }
  IComponent inputComponent=ValidationRulesUtil.getComponentsFromItemId(itemId,ERepositoryObjectType.METADATA_CONNECTIONS,true,false);
  if (inputComponent == null) {
    return;
  }
  DatabaseConnection dbConnection=(DatabaseConnection)MetadataTool.getConnectionFromRepository(refSchema);
  IMetadataTable refMetadataTable=MetadataTool.getMetadataFromRepository(refSchema);
  AbstractNode nodeUseValidationRule=(AbstractNode)node;
  endNode=nodeUseValidationRule;
  List<IConnection> validRuleConnections;
  List<? extends IConnection> mainConnections;
  IMetadataTable rejectMetadataTable=null;
  IConnection dataConnection=null;
  if (isOutput) {
    validRuleConnections=(List<IConnection>)nodeUseValidationRule.getIncomingConnections();
    mainConnections=nodeUseValidationRule.getIncomingConnections("String_Node_Str");
  }
 else {
    validRuleConnections=(List<IConnection>)nodeUseValidationRule.getOutgoingConnections();
    mainConnections=nodeUseValidationRule.getOutgoingConnections("String_Node_Str");
  }
  if (validRuleConnections == null || validRuleConnections.size() == 0)   return;
  if (mainConnections != null && mainConnections.size() > 0) {
    dataConnection=(DataConnection)mainConnections.get(0);
  }
  if (dataConnection != null) {
    validRuleConnections.remove(dataConnection);
  }
  IComponent component=ComponentsFactoryProvider.getInstance().get("String_Node_Str");
  String typeStr;
  if (isOutput) {
    typeStr="String_Node_Str";
  }
 else {
    typeStr="String_Node_Str";
  }
  String uniqueName=component.getName() + "String_Node_Str" + typeStr;
  if (dataConnection != null) {
    uniqueName+="String_Node_Str" + dataConnection.getName();
  }
  DataNode joinNode=new DataNode(component,uniqueName);
  joinNode.setActivate(connection.isActivate());
  joinNode.setStart(false);
  joinNode.setDesignSubjobStartNode(null);
  IMetadataTable joinNodeMetadataTable=null;
  if (dataConnection != null) {
    if (dataConnection.getMetadataTable() != null) {
      joinNodeMetadataTable=dataConnection.getMetadataTable();
    }
  }
 else {
    List<IMetadataTable> metadatas=nodeUseValidationRule.getMetadataList();
    if (metadatas != null && metadatas.size() > 0) {
      for (      IMetadataTable metadataTable : metadatas) {
        if ("String_Node_Str".equals(metadataTable.getAttachedConnector())) {
          joinNodeMetadataTable=metadataTable;
          break;
        }
      }
    }
  }
  if (joinNodeMetadataTable != null) {
    IMetadataTable newMetadata=joinNodeMetadataTable.clone();
    newMetadata.setTableName(uniqueName);
    joinNode.getMetadataList().remove(0);
    joinNode.getMetadataList().add(newMetadata);
  }
  joinNode.setSubProcessStart(false);
  joinNode.setProcess(node.getProcess());
  joinNode.setElementParameters(component.createElementParameters(joinNode));
  updateJoinParametersWithValidRuleConnection(joinNode,rulesConnection);
  List<IConnection> tJoin_outgoingConnections=new ArrayList<IConnection>();
  List<IConnection> tJoin_incomingConnections=new ArrayList<IConnection>();
  joinNode.setIncomingConnections(tJoin_incomingConnections);
  joinNode.setOutgoingConnections(tJoin_outgoingConnections);
  addDataNode(joinNode);
  List<? extends INodeConnector> connectors=nodeUseValidationRule.getListConnector();
  INodeConnector rejectConnector=null;
  for (  INodeConnector connector : connectors) {
    if ("String_Node_Str".equals(connector.getName())) {
      rejectConnector=connector;
      break;
    }
  }
  ((List<INodeConnector>)joinNode.getListConnector()).add(rejectConnector);
  List<IMetadataTable> metadataList=nodeUseValidationRule.getMetadataList();
  for (  IMetadataTable metadataTable : metadataList) {
    if ("String_Node_Str".equals(metadataTable.getTableName()) && !joinNode.getMetadataList().contains(metadataTable)) {
      rejectMetadataTable=metadataTable;
      joinNode.getMetadataList().add(metadataTable);
      break;
    }
  }
  if (dataConnection != null) {
    if (isOutput) {
      tJoin_incomingConnections.add(dataConnection);
      ((DataConnection)dataConnection).setTarget(joinNode);
    }
 else {
      tJoin_outgoingConnections.add(dataConnection);
      ((DataConnection)dataConnection).setSource(joinNode);
    }
  }
  DataConnection dataConnec=new DataConnection();
  dataConnec.setActivate(connection.isActivate());
  dataConnec.setLineStyle(EConnectionType.FLOW_MAIN);
  dataConnec.setTraceConnection(connection.isTraceConnection());
  dataConnec.setTracesCondition(connection.getTracesCondition());
  dataConnec.setEnabledTraceColumns(connection.getEnabledTraceColumns());
  dataConnec.setMonitorConnection(connection.isMonitorConnection());
  dataConnec.setConnectorName("String_Node_Str");
  if (!nodeUseValidationRule.getMetadataList().isEmpty()) {
    dataConnec.setMetadataTable(nodeUseValidationRule.getMetadataList().get(0));
  }
  if (isOutput) {
    dataConnec.setName("String_Node_Str" + nodeUseValidationRule.getUniqueName());
    dataConnec.setSource(joinNode);
    dataConnec.setTarget(nodeUseValidationRule);
    tJoin_outgoingConnections.add(dataConnec);
  }
 else {
    dataConnec.setName("String_Node_Str" + nodeUseValidationRule.getUniqueName());
    dataConnec.setSource(nodeUseValidationRule);
    dataConnec.setTarget(joinNode);
    tJoin_incomingConnections.add(dataConnec);
  }
  validRuleConnections.add(dataConnec);
  uniqueName=inputComponent.getName() + "String_Node_Str" + joinNode.getUniqueName();
  DataNode inputNode=new DataNode(inputComponent,uniqueName);
  inputNode.setActivate(true);
  inputNode.setStart(true);
  inputNode.setDesignSubjobStartNode(null);
  inputNode.getMetadataList().remove(0);
  inputNode.getMetadataList().add(refMetadataTable);
  inputNode.setSubProcessStart(true);
  inputNode.setProcess(node.getProcess());
  inputNode.setElementParameters(inputComponent.createElementParameters(inputNode));
  String query=TalendTextUtils.addQuotes("String_Node_Str" + tabName + "String_Node_Str");
  inputNode.getElementParameter("String_Node_Str").setValue(query);
  updateInputParametersWithDBConnection(inputNode,dbConnection);
  addDataNode(inputNode);
  List<IConnection> inputNode_outgoingConnections=new ArrayList<IConnection>();
  inputNode.setOutgoingConnections(inputNode_outgoingConnections);
  List<IConnection> inputNode_incomingConnections=new ArrayList<IConnection>();
  inputNode.setIncomingConnections(inputNode_incomingConnections);
  DataConnection ref_dataConnec=new DataConnection();
  ref_dataConnec.setActivate(connection.isActivate());
  ref_dataConnec.setLineStyle(EConnectionType.FLOW_REF);
  ref_dataConnec.setMetadataTable(refMetadataTable);
  ref_dataConnec.setName(joinNode.getUniqueName() + "String_Node_Str" + connection.getName());
  ref_dataConnec.setSource(inputNode);
  ref_dataConnec.setTarget(joinNode);
  ref_dataConnec.setConnectorName("String_Node_Str");
  tJoin_incomingConnections.add(ref_dataConnec);
  inputNode_outgoingConnections.add(ref_dataConnec);
  INode subNodeStartTarget=graphicalNode.getSubProcessStartNode(true);
  AbstractNode subDataNodeStartSource=(AbstractNode)buildCheckMap.get(subNodeStartTarget);
  AbstractNode subDataNodeStartTarget=inputNode;
  if (subDataNodeStartSource == null) {
    return;
  }
  List<IConnection> outgoingConnections=(List<IConnection>)subDataNodeStartSource.getOutgoingConnections();
  dataConnec=new DataConnection();
  dataConnec.setActivate(connection.isActivate());
  dataConnec.setLineStyle(EConnectionType.RUN_AFTER);
  dataConnec.setTraceConnection(connection.isTraceConnection());
  dataConnec.setTracesCondition(connection.getTracesCondition());
  dataConnec.setEnabledTraceColumns(connection.getEnabledTraceColumns());
  dataConnec.setMonitorConnection(connection.isMonitorConnection());
  if (!subDataNodeStartSource.getMetadataList().isEmpty()) {
    dataConnec.setMetadataTable(subDataNodeStartSource.getMetadataList().get(0));
  }
  dataConnec.setName("String_Node_Str" + subDataNodeStartSource.getUniqueName());
  dataConnec.setConnectorName(EConnectionType.RUN_AFTER.getName());
  dataConnec.setSource(subDataNodeStartSource);
  dataConnec.setTarget(subDataNodeStartTarget);
  subDataNodeStartTarget.setStart(false);
  inputNode_incomingConnections.add(dataConnec);
  outgoingConnections.add(dataConnec);
  String baseConnector=inputNode.getConnectorFromName("String_Node_Str").getBaseSchema();
  INodeConnector connector=joinNode.getConnectorFromName(baseConnector);
  String hashComponent=connector.getConnectionProperty(EConnectionType.FLOW_REF).getLinkedComponent();
  if (hashComponent == null) {
    uniqueName=HASH_COMPONENT_NAME + "String_Node_Str" + connection.getName();
    component=ComponentsFactoryProvider.getInstance().get(HASH_COMPONENT_NAME);
  }
 else {
    uniqueName=hashComponent + "String_Node_Str" + connection.getName();
    component=ComponentsFactoryProvider.getInstance().get(hashComponent);
  }
  if (component == null) {
    return;
  }
  DataNode hashNode=new DataNode(component,uniqueName);
  hashNode.setActivate(connection.isActivate());
  hashNode.setStart(false);
  hashNode.setDesignSubjobStartNode(null);
  IMetadataTable hashMetadata=inputNode.getMetadataList().get(0).clone();
  hashMetadata.setTableName(uniqueName);
  hashNode.getMetadataList().remove(0);
  hashNode.getMetadataList().add(hashMetadata);
  hashNode.setSubProcessStart(false);
  hashNode.setProcess(node.getProcess());
  List<IConnection> hash_outgoingConnections=new ArrayList<IConnection>();
  List<IConnection> hash_incomingConnections=new ArrayList<IConnection>();
  hashNode.setIncomingConnections(hash_incomingConnections);
  hashNode.setOutgoingConnections(hash_outgoingConnections);
  addDataNode(hashNode);
  dataConnec=new DataConnection();
  dataConnec.setActivate(connection.isActivate());
  dataConnec.setLineStyle(EConnectionType.FLOW_MAIN);
  dataConnec.setMetadataTable(hashMetadata);
  dataConnec.setTraceConnection(connection.isTraceConnection());
  dataConnec.setMonitorConnection(connection.isMonitorConnection());
  dataConnec.setTracesCondition(connection.getTracesCondition());
  dataConnec.setEnabledTraceColumns(connection.getEnabledTraceColumns());
  dataConnec.setName(joinNode.getUniqueName() + "String_Node_Str" + connection.getName());
  dataConnec.setSource(joinNode);
  dataConnec.setTarget(hashNode);
  dataConnec.setLinkNodeForHash((AbstractNode)buildCheckMap.get(connection.getTarget()));
  dataConnec.setConnectorName(connection.getConnectorName());
  inputNode_outgoingConnections.add(dataConnec);
  hash_incomingConnections.add(dataConnec);
  if (endNode.getOutgoingConnections("String_Node_Str") != null && endNode.getOutgoingConnections("String_Node_Str").size() == 1) {
    IConnection conn=endNode.getOutgoingConnections("String_Node_Str").get(0);
    INode targetNode=conn.getTarget();
    List<IConnection> outputconns=(List<IConnection>)endNode.getOutgoingConnections();
    List<IConnection> inputconnns=(List<IConnection>)targetNode.getIncomingConnections();
    outputconns.remove(conn);
    inputconnns.remove(conn);
    DataConnection rejectLink=new DataConnection();
    rejectLink.setActivate(connection.isActivate());
    rejectLink.setLineStyle(EConnectionType.FLOW_MAIN);
    rejectLink.setMetadataTable(rejectMetadataTable);
    rejectLink.setConnectorName("String_Node_Str");
    rejectLink.setName(conn.getName());
    rejectLink.setSource(joinNode);
    rejectLink.setTarget(targetNode);
    ((List<IConnection>)joinNode.getOutgoingConnections()).add(rejectLink);
    ((List<IConnection>)targetNode.getIncomingConnections()).add(rejectLink);
  }
}

Fixed version (ground truth):
/** 
 * DOC ycbai Comment method "replaceReferenceValidationRules".
 * @param connection
 * @param rulesConnection
 * @param isOutput
 * @param graphicalNode
 */
private void replaceReferenceValidationRules(INode graphicalNode,IConnection connection,ValidationRulesConnection rulesConnection,boolean isOutput){
  INode node=getApplicableNode(connection,isOutput);
  INode endNode=null;
  if (!checkTriggerAndDBSettings(node,rulesConnection,isOutput)) {
    return;
  }
  String baseSchema=rulesConnection.getBaseSchema();
  String refSchema=rulesConnection.getRefSchema();
  if (baseSchema == null || refSchema == null) {
    return;
  }
  String[] values=refSchema.split("String_Node_Str");
  String itemId=values[0];
  String tabName=values[1];
  if (itemId == null) {
    return;
  }
  IComponent inputComponent=ValidationRulesUtil.getComponentsFromItemId(itemId,ERepositoryObjectType.METADATA_CONNECTIONS,true,false);
  if (inputComponent == null) {
    return;
  }
  DatabaseConnection dbConnection=(DatabaseConnection)MetadataTool.getConnectionFromRepository(refSchema);
  IMetadataTable refMetadataTable=MetadataTool.getMetadataFromRepository(refSchema);
  AbstractNode nodeUseValidationRule=(AbstractNode)node;
  endNode=nodeUseValidationRule;
  List<IConnection> validRuleConnections;
  List<? extends IConnection> mainConnections;
  IMetadataTable rejectMetadataTable=null;
  IConnection dataConnection=null;
  if (isOutput) {
    validRuleConnections=(List<IConnection>)nodeUseValidationRule.getIncomingConnections();
    mainConnections=nodeUseValidationRule.getIncomingConnections("String_Node_Str");
  }
 else {
    validRuleConnections=(List<IConnection>)nodeUseValidationRule.getOutgoingConnections();
    mainConnections=nodeUseValidationRule.getOutgoingConnections("String_Node_Str");
  }
  if (validRuleConnections == null || validRuleConnections.size() == 0) {
    return;
  }
  if (mainConnections != null && mainConnections.size() > 0) {
    dataConnection=mainConnections.get(0);
  }
  if (dataConnection != null) {
    validRuleConnections.remove(dataConnection);
  }
  IComponent component=ComponentsFactoryProvider.getInstance().get("String_Node_Str");
  String typeStr;
  if (isOutput) {
    typeStr="String_Node_Str";
  }
 else {
    typeStr="String_Node_Str";
  }
  String uniqueName=component.getName() + "String_Node_Str" + typeStr;
  if (dataConnection != null) {
    uniqueName+="String_Node_Str" + dataConnection.getName();
  }
  DataNode joinNode=new DataNode(component,uniqueName);
  joinNode.setActivate(connection.isActivate());
  joinNode.setStart(false);
  joinNode.setDesignSubjobStartNode(null);
  IMetadataTable joinNodeMetadataTable=null;
  if (dataConnection != null) {
    if (dataConnection.getMetadataTable() != null) {
      joinNodeMetadataTable=dataConnection.getMetadataTable();
    }
  }
 else {
    List<IMetadataTable> metadatas=nodeUseValidationRule.getMetadataList();
    if (metadatas != null && metadatas.size() > 0) {
      for (      IMetadataTable metadataTable : metadatas) {
        if ("String_Node_Str".equals(metadataTable.getAttachedConnector())) {
          joinNodeMetadataTable=metadataTable;
          break;
        }
      }
    }
  }
  if (joinNodeMetadataTable != null) {
    IMetadataTable newMetadata=joinNodeMetadataTable.clone();
    newMetadata.setTableName(uniqueName);
    joinNode.getMetadataList().remove(0);
    joinNode.getMetadataList().add(newMetadata);
  }
  joinNode.setSubProcessStart(false);
  joinNode.setProcess(node.getProcess());
  joinNode.setElementParameters(component.createElementParameters(joinNode));
  updateJoinParametersWithValidRuleConnection(joinNode,rulesConnection);
  List<IConnection> tJoin_outgoingConnections=new ArrayList<IConnection>();
  List<IConnection> tJoin_incomingConnections=new ArrayList<IConnection>();
  joinNode.setIncomingConnections(tJoin_incomingConnections);
  joinNode.setOutgoingConnections(tJoin_outgoingConnections);
  addDataNode(joinNode);
  List<? extends INodeConnector> connectors=nodeUseValidationRule.getListConnector();
  INodeConnector rejectConnector=null;
  for (  INodeConnector connector : connectors) {
    if ("String_Node_Str".equals(connector.getName())) {
      rejectConnector=connector;
      break;
    }
  }
  ((List<INodeConnector>)joinNode.getListConnector()).add(rejectConnector);
  List<IMetadataTable> metadataList=nodeUseValidationRule.getMetadataList();
  for (  IMetadataTable metadataTable : metadataList) {
    if ("String_Node_Str".equals(metadataTable.getTableName()) && !joinNode.getMetadataList().contains(metadataTable)) {
      rejectMetadataTable=metadataTable;
      joinNode.getMetadataList().add(metadataTable);
      break;
    }
  }
  if (dataConnection != null) {
    if (isOutput) {
      tJoin_incomingConnections.add(dataConnection);
      ((DataConnection)dataConnection).setTarget(joinNode);
    }
 else {
      tJoin_outgoingConnections.add(dataConnection);
      ((DataConnection)dataConnection).setSource(joinNode);
    }
  }
  DataConnection dataConnec=new DataConnection();
  dataConnec.setActivate(connection.isActivate());
  dataConnec.setLineStyle(EConnectionType.FLOW_MAIN);
  dataConnec.setTraceConnection(connection.isTraceConnection());
  dataConnec.setTracesCondition(connection.getTracesCondition());
  dataConnec.setEnabledTraceColumns(connection.getEnabledTraceColumns());
  dataConnec.setMonitorConnection(connection.isMonitorConnection());
  dataConnec.setConnectorName("String_Node_Str");
  if (!nodeUseValidationRule.getMetadataList().isEmpty()) {
    dataConnec.setMetadataTable(nodeUseValidationRule.getMetadataList().get(0));
  }
  if (isOutput) {
    dataConnec.setName("String_Node_Str" + nodeUseValidationRule.getUniqueName());
    dataConnec.setSource(joinNode);
    dataConnec.setTarget(nodeUseValidationRule);
    tJoin_outgoingConnections.add(dataConnec);
  }
 else {
    dataConnec.setName("String_Node_Str" + nodeUseValidationRule.getUniqueName());
    dataConnec.setSource(nodeUseValidationRule);
    dataConnec.setTarget(joinNode);
    tJoin_incomingConnections.add(dataConnec);
  }
  validRuleConnections.add(dataConnec);
  uniqueName=inputComponent.getName() + "String_Node_Str" + joinNode.getUniqueName();
  DataNode inputNode=new DataNode(inputComponent,uniqueName);
  inputNode.setActivate(true);
  inputNode.setStart(true);
  inputNode.setDesignSubjobStartNode(null);
  inputNode.getMetadataList().remove(0);
  inputNode.getMetadataList().add(refMetadataTable);
  inputNode.setSubProcessStart(true);
  inputNode.setProcess(node.getProcess());
  inputNode.setElementParameters(inputComponent.createElementParameters(inputNode));
  String query=TalendTextUtils.addQuotes("String_Node_Str" + tabName + "String_Node_Str");
  inputNode.getElementParameter("String_Node_Str").setValue(query);
  updateInputParametersWithDBConnection(inputNode,dbConnection);
  addDataNode(inputNode);
  List<IConnection> inputNode_outgoingConnections=new ArrayList<IConnection>();
  inputNode.setOutgoingConnections(inputNode_outgoingConnections);
  List<IConnection> inputNode_incomingConnections=new ArrayList<IConnection>();
  inputNode.setIncomingConnections(inputNode_incomingConnections);
  DataConnection ref_dataConnec=new DataConnection();
  ref_dataConnec.setActivate(connection.isActivate());
  ref_dataConnec.setLineStyle(EConnectionType.FLOW_REF);
  ref_dataConnec.setMetadataTable(refMetadataTable);
  ref_dataConnec.setName(joinNode.getUniqueName() + "String_Node_Str" + connection.getName());
  ref_dataConnec.setSource(inputNode);
  ref_dataConnec.setTarget(joinNode);
  ref_dataConnec.setConnectorName("String_Node_Str");
  tJoin_incomingConnections.add(ref_dataConnec);
  inputNode_outgoingConnections.add(ref_dataConnec);
  INode subNodeStartTarget=graphicalNode.getSubProcessStartNode(true);
  AbstractNode subDataNodeStartSource=(AbstractNode)buildCheckMap.get(subNodeStartTarget);
  AbstractNode subDataNodeStartTarget=inputNode;
  if (subDataNodeStartSource == null) {
    return;
  }
  List<IConnection> outgoingConnections=(List<IConnection>)subDataNodeStartSource.getOutgoingConnections();
  dataConnec=new DataConnection();
  dataConnec.setActivate(connection.isActivate());
  dataConnec.setLineStyle(EConnectionType.RUN_AFTER);
  dataConnec.setTraceConnection(connection.isTraceConnection());
  dataConnec.setTracesCondition(connection.getTracesCondition());
  dataConnec.setEnabledTraceColumns(connection.getEnabledTraceColumns());
  dataConnec.setMonitorConnection(connection.isMonitorConnection());
  if (!subDataNodeStartSource.getMetadataList().isEmpty()) {
    dataConnec.setMetadataTable(subDataNodeStartSource.getMetadataList().get(0));
  }
  dataConnec.setName("String_Node_Str" + subDataNodeStartSource.getUniqueName());
  dataConnec.setConnectorName(EConnectionType.RUN_AFTER.getName());
  dataConnec.setSource(subDataNodeStartSource);
  dataConnec.setTarget(subDataNodeStartTarget);
  subDataNodeStartTarget.setStart(false);
  inputNode_incomingConnections.add(dataConnec);
  outgoingConnections.add(dataConnec);
  String baseConnector=inputNode.getConnectorFromName("String_Node_Str").getBaseSchema();
  INodeConnector connector=joinNode.getConnectorFromName(baseConnector);
  String hashComponent=connector.getConnectionProperty(EConnectionType.FLOW_REF).getLinkedComponent();
  if (hashComponent == null) {
    uniqueName=HASH_COMPONENT_NAME + "String_Node_Str" + connection.getName();
    component=ComponentsFactoryProvider.getInstance().get(HASH_COMPONENT_NAME);
  }
 else {
    uniqueName=hashComponent + "String_Node_Str" + connection.getName();
    component=ComponentsFactoryProvider.getInstance().get(hashComponent);
  }
  if (component == null) {
    return;
  }
  DataNode hashNode=new DataNode(component,uniqueName);
  hashNode.setActivate(connection.isActivate());
  hashNode.setStart(false);
  hashNode.setDesignSubjobStartNode(null);
  IMetadataTable hashMetadata=inputNode.getMetadataList().get(0).clone();
  hashMetadata.setTableName(uniqueName);
  hashNode.getMetadataList().remove(0);
  hashNode.getMetadataList().add(hashMetadata);
  hashNode.setSubProcessStart(false);
  hashNode.setProcess(node.getProcess());
  List<IConnection> hash_outgoingConnections=new ArrayList<IConnection>();
  List<IConnection> hash_incomingConnections=new ArrayList<IConnection>();
  hashNode.setIncomingConnections(hash_incomingConnections);
  hashNode.setOutgoingConnections(hash_outgoingConnections);
  addDataNode(hashNode);
  dataConnec=new DataConnection();
  dataConnec.setActivate(connection.isActivate());
  dataConnec.setLineStyle(EConnectionType.FLOW_MAIN);
  dataConnec.setMetadataTable(hashMetadata);
  dataConnec.setTraceConnection(connection.isTraceConnection());
  dataConnec.setMonitorConnection(connection.isMonitorConnection());
  dataConnec.setTracesCondition(connection.getTracesCondition());
  dataConnec.setEnabledTraceColumns(connection.getEnabledTraceColumns());
  dataConnec.setName(joinNode.getUniqueName() + "String_Node_Str" + connection.getName());
  dataConnec.setSource(joinNode);
  dataConnec.setTarget(hashNode);
  dataConnec.setLinkNodeForHash(buildCheckMap.get(connection.getTarget()));
  dataConnec.setConnectorName(connection.getConnectorName());
  inputNode_outgoingConnections.add(dataConnec);
  hash_incomingConnections.add(dataConnec);
  if (endNode.getOutgoingConnections("String_Node_Str") != null && endNode.getOutgoingConnections("String_Node_Str").size() == 1) {
    IConnection conn=endNode.getOutgoingConnections("String_Node_Str").get(0);
    INode targetNode=conn.getTarget();
    List<IConnection> outputconns=(List<IConnection>)endNode.getOutgoingConnections();
    List<IConnection> inputconnns=(List<IConnection>)targetNode.getIncomingConnections();
    outputconns.remove(conn);
    inputconnns.remove(conn);
    DataConnection rejectLink=new DataConnection();
    rejectLink.setActivate(connection.isActivate());
    rejectLink.setLineStyle(EConnectionType.FLOW_MAIN);
    rejectLink.setMetadataTable(rejectMetadataTable);
    rejectLink.setConnectorName("String_Node_Str");
    rejectLink.setName(conn.getName());
    rejectLink.setSource(joinNode);
    rejectLink.setTarget(targetNode);
    ((List<IConnection>)joinNode.getOutgoingConnections()).add(rejectLink);
    ((List<IConnection>)targetNode.getIncomingConnections()).add(rejectLink);
  }
}