Program: 122918
Project: 122918
Buggy source:
@SuppressWarnings("String_Node_Str") private void updateSchema(){
  Object updateObject=result.getUpdateObject();
  if (updateObject == null) {
    return;
  }
  if (updateObject instanceof Node) {
    Node node=(Node)updateObject;
    boolean builtIn=true;
    final IExternalNode externalNode=node.getExternalNode();
    if (result.getResultType() == EUpdateResult.UPDATE) {
      if (result.isChecked()) {
        if (result.getParameter() instanceof List) {
          if (PluginChecker.isEBCDICPluginLoaded()) {
            IEBCDICProviderService service=(IEBCDICProviderService)GlobalServiceRegister.getDefault().getService(IEBCDICProviderService.class);
            if (service != null) {
              if (service.isEbcdicNode(node)) {
                List<Object> parameter=(List<Object>)result.getParameter();
                if (parameter.size() >= 2) {
                  IMetadataTable newTable=(IMetadataTable)parameter.get(0);
                  String schemaName=(String)parameter.get(1);
                  IMetadataTable metadataTable=MetadataToolHelper.getMetadataTableFromNode(node,schemaName);
                  if (metadataTable != null) {
                    MetadataToolHelper.copyTable(newTable,metadataTable);
                  }
                  syncSchemaForEBCDIC(node,metadataTable);
                }
                return;
              }
            }
          }
          if (GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerMapperService.class)) {
            IDesignerMapperService service=(IDesignerMapperService)GlobalServiceRegister.getDefault().getService(IDesignerMapperService.class);
            if (service == null || externalNode == null || externalNode.getExternalData() == null) {
              return;
            }
            List<Object> parameter=(List<Object>)result.getParameter();
            if (parameter.size() == 2) {
              if (node.getComponent() != null && "String_Node_Str".equals(node.getComponent().getName())) {
                IMetadataTable newTable=(IMetadataTable)parameter.get(0);
                String schemaId=(String)parameter.get(1);
                service.updateMapperTableEntries(externalNode,schemaId,newTable);
                node.setMetadataList(externalNode.getMetadataList());
                syncSchemaForTMap(node);
                for (                IExternalMapTable latestTable : externalNode.getExternalData().getOutputTables()) {
                  for (                  IMetadataTable tableExsit : node.getMetadataList()) {
                    if (latestTable.getName().equals(tableExsit.getTableName())) {
                      List<IMetadataColumn> newColumns=newTable.getListColumns();
                      for (                      IMetadataColumn column : tableExsit.getListColumns()) {
                        for (                        IMetadataColumn newColumn : newColumns) {
                          if (newColumn.getLabel().equals(column.getLabel())) {
                            column.setTalendType(newColumn.getTalendType());
                            column.setNullable(newColumn.isNullable());
                            column.setComment(newColumn.getComment());
                            column.setDefault(newColumn.getDefault());
                            column.setLength(newColumn.getLength());
                            column.setType(newColumn.getType());
                            column.setKey(newColumn.isKey());
                            column.setPrecision(newColumn.getPrecision());
                            break;
                          }
                        }
                      }
                      break;
                    }
                  }
                }
              }
            }
            return;
          }
        }
 else         if (result.getParameter() instanceof IMetadataTable) {
          IMetadataTable newTable=(IMetadataTable)result.getParameter();
          if (newTable != null) {
            for (            INodeConnector nodeConnector : node.getListConnector()) {
              if (nodeConnector.getBaseSchema().equals(newTable.getAttachedConnector())) {
                List<IElementParameter> params=node.getElementParametersFromField(EParameterFieldType.SCHEMA_TYPE);
                if (params != null) {
                  for (                  IElementParameter param : params) {
                    ChangeMetadataCommand cmd=null;
                    if (param.getChildParameters() != null && param.getChildParameters().get("String_Node_Str") != null && result.getContextModeConnectionItem() != null) {
                      final Object value=param.getChildParameters().get("String_Node_Str").getValue();
                      String idAndName=result.getContextModeConnectionItem().getProperty().getId() + UpdatesConstants.SEGMENT_LINE + newTable.getLabel();
                      if (idAndName.equals(value)) {
                        cmd=new ChangeMetadataCommand(node,param,null,newTable);
                      }
                    }
 else {
                      cmd=new ChangeMetadataCommand(node,param,null,newTable);
                    }
                    if (cmd != null) {
                      String propertyValue=(String)node.getPropertyValue(EParameterName.REPOSITORY_PROPERTY_TYPE.getName());
                      IRepositoryViewObject lastVersion=UpdateRepositoryUtils.getRepositoryObjectById(propertyValue);
                      Connection repositoryConn=null;
                      if (lastVersion != null) {
                        final Item item=lastVersion.getProperty().getItem();
                        if (item != null && item instanceof ConnectionItem) {
                          repositoryConn=((ConnectionItem)item).getConnection();
                        }
                      }
                      cmd.setConnection(repositoryConn);
                      cmd.setRepositoryMode(true);
                      cmd.execute(true);
                    }
                  }
                }
 else {
                  MetadataToolHelper.copyTable(newTable,node.getMetadataFromConnector(nodeConnector.getName()));
                }
              }
            }
            builtIn=false;
          }
        }
      }
    }
 else     if (result.getResultType() == EUpdateResult.RENAME) {
      List<Object> parameter=(List<Object>)result.getParameter();
      if (parameter.size() >= 3) {
        IMetadataTable newTable=(IMetadataTable)parameter.get(0);
        String oldSourceId=(String)parameter.get(1);
        String newSourceId=(String)parameter.get(2);
        if (PluginChecker.isEBCDICPluginLoaded()) {
          IEBCDICProviderService service=(IEBCDICProviderService)GlobalServiceRegister.getDefault().getService(IEBCDICProviderService.class);
          if (service != null) {
            if (service.isEbcdicNode(node)) {
              String[] sourceIdAndChildName=UpdateManagerUtils.getSourceIdAndChildName(oldSourceId);
              final String oldSchemaName=sourceIdAndChildName[1];
              sourceIdAndChildName=UpdateManagerUtils.getSourceIdAndChildName(newSourceId);
              final String newSchemaName=sourceIdAndChildName[1];
              Map<String,Object> lineValue=(Map<String,Object>)parameter.get(3);
              if (lineValue != null) {
                IMetadataTable metadataTable=MetadataToolHelper.getMetadataTableFromNode(node,oldSchemaName);
                Object schemaName=lineValue.get(IEbcdicConstant.FIELD_SCHEMA);
                if (metadataTable != null && schemaName != null) {
                  lineValue.put(IEbcdicConstant.FIELD_SCHEMA,newSchemaName);
                  MetadataToolHelper.copyTable(newTable,metadataTable);
                  syncSchemaForEBCDIC(node,metadataTable);
                  metadataTable.setLabel(newSchemaName);
                }
              }
              return;
            }
          }
        }
        if (GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerMapperService.class)) {
          IDesignerMapperService service=(IDesignerMapperService)GlobalServiceRegister.getDefault().getService(IDesignerMapperService.class);
          if (service == null || externalNode == null || externalNode.getExternalData() == null) {
            return;
          }
          IExternalData externalData=externalNode.getExternalData();
          parameter=(List<Object>)result.getParameter();
          if (parameter.size() == 3) {
            if (node.getComponent() != null && "String_Node_Str".equals(node.getComponent().getName())) {
              newTable=(IMetadataTable)parameter.get(0);
              String schemaId=(String)parameter.get(1);
              String newSchemaId=(String)parameter.get(2);
              service.renameMapperTable(externalNode,schemaId,newSchemaId,newTable);
              node.setMetadataList(externalNode.getMetadataList());
              syncSchemaForTMap(node);
            }
          }
          return;
        }
        String schemaParamName=UpdatesConstants.SCHEMA + UpdatesConstants.COLON + EParameterName.REPOSITORY_SCHEMA_TYPE.getName();
        IElementParameter repositoryParam=node.getElementParameter(schemaParamName);
        if (repositoryParam != null && oldSourceId.equals(repositoryParam.getValue())) {
          node.setPropertyValue(schemaParamName,newSourceId);
          if (newTable != null) {
            for (            INodeConnector nodeConnector : node.getListConnector()) {
              if (nodeConnector.getBaseSchema().equals(newTable.getAttachedConnector())) {
                MetadataToolHelper.copyTable(newTable,node.getMetadataFromConnector(nodeConnector.getName()));
              }
            }
          }
          builtIn=false;
        }
        schemaParamName=UpdatesConstants.SCHEMA_TARGET + UpdatesConstants.COLON + EParameterName.REPOSITORY_SCHEMA_TYPE.getName();
        repositoryParam=node.getElementParameter(schemaParamName);
        if (repositoryParam != null && oldSourceId.equals(repositoryParam.getValue())) {
          node.setPropertyValue(schemaParamName,newSourceId);
          if (newTable != null) {
            for (            INodeConnector nodeConnector : node.getListConnector()) {
              if (nodeConnector.getBaseSchema().equals(repositoryParam.getContext())) {
                MetadataToolHelper.copyTable(newTable,node.getMetadataFromConnector(nodeConnector.getName()));
              }
            }
          }
          builtIn=false;
        }
      }
    }
 else     if (result.getResultType() == EUpdateResult.BUIL_IN) {
      if (UpdatesConstants.SCHEMA_TARGET.equals(result.getParameter())) {
        node.setPropertyValue(UpdatesConstants.SCHEMA_TARGET + "String_Node_Str" + EParameterName.SCHEMA_TYPE.getName(),EmfComponent.BUILTIN);
      }
 else {
        if (PluginChecker.isEBCDICPluginLoaded()) {
          IEBCDICProviderService service=(IEBCDICProviderService)GlobalServiceRegister.getDefault().getService(IEBCDICProviderService.class);
          if (service != null) {
            if (service.isEbcdicNode(node)) {
              Object parameter=result.getParameter();
              if (parameter instanceof Map) {
                Map<String,Object> lineValue=(Map<String,Object>)parameter;
                lineValue.remove(IEbcdicConstant.FIELD_SCHEMA + IEbcdicConstant.REF_TYPE);
              }
              return;
            }
          }
        }
        if (PluginChecker.isJobLetPluginLoaded()) {
          IJobletProviderService service=(IJobletProviderService)GlobalServiceRegister.getDefault().getService(IJobletProviderService.class);
          if (service != null && service.isJobletInOutComponent(node)) {
            node.setPropertyValue(EParameterName.SCHEMA_TYPE.getName() + "String_Node_Str" + EParameterName.SCHEMA_TYPE.getName(),EmfComponent.BUILTIN);
          }
        }
        node.setPropertyValue(EParameterName.SCHEMA_TYPE.getName(),EmfComponent.BUILTIN);
        for (        IElementParameter param : node.getElementParameters()) {
          SAPParametersUtils.setNoRepositoryParams(param);
        }
      }
    }
 else     if (result.getResultType() == EUpdateResult.DELETE) {
      node.setPropertyValue(EParameterName.SCHEMA_TYPE.getName(),EmfComponent.BUILTIN);
    }
 else     if (result.getResultType() == EUpdateResult.RELOAD) {
      List<Object> parameter=(List<Object>)result.getParameter();
      String connectionId=null;
      String tableLabel=null;
      IRepositoryViewObject toReload=null;
      IMetadataTable tableToReload=null;
      if (parameter instanceof List) {
        List listParameter=parameter;
        connectionId=(String)node.getPropertyValue(EParameterName.REPOSITORY_PROPERTY_TYPE.getName());
        tableLabel=((String)listParameter.get(0)).split(UpdatesConstants.SEGMENT_LINE)[0];
      }
      if (connectionId != null) {
        try {
          toReload=ProxyRepositoryFactory.getInstance().getLastVersion(connectionId);
        }
 catch (        PersistenceException e) {
          ExceptionHandler.process(e);
        }
      }
      if (toReload != null) {
        Item item=toReload.getProperty().getItem();
        if (item != null && item instanceof DatabaseConnectionItem) {
          DatabaseConnectionItem dbItem=(DatabaseConnectionItem)item;
          Connection connection=dbItem.getConnection();
          if (connection instanceof DatabaseConnection) {
            DatabaseConnection dbConn=(DatabaseConnection)connection;
            Set<MetadataTable> tables=ProjectNodeHelper.getTablesFromSpecifiedDataPackage(dbConn);
            if (tables != null && !tables.isEmpty()) {
              Iterator it=tables.iterator();
              while (it.hasNext() && tableToReload == null) {
                MetadataTable table=(MetadataTable)it.next();
                String label=table.getLabel();
                if (tableLabel != null) {
                  if (label != null && label.equals(tableLabel)) {
                    tableToReload=ConvertionHelper.convert(table);
                    break;
                  }
                }
              }
            }
            Set<org.talend.core.model.metadata.builder.connection.MetadataTable> newTables=ConnectionHelper.getTables(connection);
            if (newTables != null && !newTables.isEmpty() && tableToReload == null) {
              Iterator it=newTables.iterator();
              while (it.hasNext() && tableToReload == null) {
                MetadataTable table=(MetadataTable)it.next();
                String label=table.getLabel();
                if (tableLabel != null) {
                  if (label != null && label.equals(tableLabel)) {
                    tableToReload=ConvertionHelper.convert(table);
                    break;
                  }
                }
              }
            }
          }
        }
        if (tableToReload != null) {
          int index=-1;
          List<IMetadataTable> tablesInNode=node.getMetadataList();
          for (          IMetadataTable table : tablesInNode) {
            if (table.getLabel().equals(tableToReload.getLabel())) {
              index=tablesInNode.indexOf(table);
              break;
            }
          }
          if (index >= 0) {
            IMetadataTable oldTable=tablesInNode.get(index);
            tableToReload.setAttachedConnector(oldTable.getAttachedConnector());
            tableToReload.setDbms(oldTable.getDbms());
            tablesInNode.remove(index);
            tablesInNode.add(index,tableToReload);
            builtIn=false;
          }
        }
      }
    }
    if (builtIn) {
      node.setPropertyValue(EParameterName.SCHEMA_TYPE.getName(),EmfComponent.BUILTIN);
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void updateSchema(){
  Object updateObject=result.getUpdateObject();
  if (updateObject == null) {
    return;
  }
  if (updateObject instanceof Node) {
    Node node=(Node)updateObject;
    boolean builtIn=true;
    final IExternalNode externalNode=node.getExternalNode();
    if (result.getResultType() == EUpdateResult.UPDATE) {
      if (result.isChecked()) {
        if (result.getParameter() instanceof List) {
          if (PluginChecker.isEBCDICPluginLoaded()) {
            IEBCDICProviderService service=(IEBCDICProviderService)GlobalServiceRegister.getDefault().getService(IEBCDICProviderService.class);
            if (service != null) {
              if (service.isEbcdicNode(node)) {
                List<Object> parameter=(List<Object>)result.getParameter();
                if (parameter.size() >= 2) {
                  IMetadataTable newTable=(IMetadataTable)parameter.get(0);
                  String schemaName=(String)parameter.get(1);
                  IMetadataTable metadataTable=MetadataToolHelper.getMetadataTableFromNode(node,schemaName);
                  if (metadataTable != null) {
                    MetadataToolHelper.copyTable(newTable,metadataTable);
                  }
                  syncSchemaForEBCDIC(node,metadataTable);
                }
                return;
              }
            }
          }
          if (GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerMapperService.class)) {
            IDesignerMapperService service=(IDesignerMapperService)GlobalServiceRegister.getDefault().getService(IDesignerMapperService.class);
            if (service == null || externalNode == null || externalNode.getExternalData() == null) {
              return;
            }
            List<Object> parameter=(List<Object>)result.getParameter();
            if (parameter.size() == 2) {
              if (node.getComponent() != null && "String_Node_Str".equals(node.getComponent().getName())) {
                IMetadataTable newTable=(IMetadataTable)parameter.get(0);
                String schemaId=(String)parameter.get(1);
                service.updateMapperTableEntries(externalNode,schemaId,newTable);
                node.setMetadataList(externalNode.getMetadataList());
                syncSchemaForTMap(node);
                for (                IExternalMapTable latestTable : externalNode.getExternalData().getOutputTables()) {
                  for (                  IMetadataTable tableExsit : node.getMetadataList()) {
                    if (latestTable.getName().equals(tableExsit.getTableName())) {
                      List<IMetadataColumn> newColumns=newTable.getListColumns();
                      for (                      IMetadataColumn column : tableExsit.getListColumns()) {
                        for (                        IMetadataColumn newColumn : newColumns) {
                          if (newColumn.getLabel().equals(column.getLabel())) {
                            column.setTalendType(newColumn.getTalendType());
                            column.setNullable(newColumn.isNullable());
                            column.setComment(newColumn.getComment());
                            column.setDefault(newColumn.getDefault());
                            column.setLength(newColumn.getLength());
                            column.setType(newColumn.getType());
                            column.setKey(newColumn.isKey());
                            column.setPrecision(newColumn.getPrecision());
                            break;
                          }
                        }
                      }
                      break;
                    }
                  }
                }
              }
            }
            return;
          }
        }
 else         if (result.getParameter() instanceof IMetadataTable) {
          IMetadataTable newTable=(IMetadataTable)result.getParameter();
          if (newTable != null) {
            for (            INodeConnector nodeConnector : node.getListConnector()) {
              if (nodeConnector.getBaseSchema().equals(newTable.getAttachedConnector())) {
                List<IElementParameter> params=node.getElementParametersFromField(EParameterFieldType.SCHEMA_TYPE);
                if (params != null) {
                  for (                  IElementParameter param : params) {
                    ChangeMetadataCommand cmd=null;
                    if (param.getChildParameters() != null && param.getChildParameters().get("String_Node_Str") != null && result.getContextModeConnectionItem() != null) {
                      final Object value=param.getChildParameters().get("String_Node_Str").getValue();
                      String idAndName=result.getContextModeConnectionItem().getProperty().getId() + UpdatesConstants.SEGMENT_LINE + newTable.getLabel();
                      if (idAndName.equals(value)) {
                        cmd=new ChangeMetadataCommand(node,param,null,newTable);
                      }
                    }
 else {
                      cmd=new ChangeMetadataCommand(node,param,null,newTable);
                    }
                    if (cmd != null) {
                      String propertyValue=(String)node.getPropertyValue(EParameterName.REPOSITORY_PROPERTY_TYPE.getName());
                      IRepositoryViewObject lastVersion=UpdateRepositoryUtils.getRepositoryObjectById(propertyValue);
                      Connection repositoryConn=null;
                      if (lastVersion != null) {
                        final Item item=lastVersion.getProperty().getItem();
                        if (item != null && item instanceof ConnectionItem) {
                          repositoryConn=((ConnectionItem)item).getConnection();
                        }
                      }
                      cmd.setConnection(repositoryConn);
                      cmd.setRepositoryMode(true);
                      cmd.execute(true);
                    }
                  }
                }
 else {
                  MetadataToolHelper.copyTable(newTable,node.getMetadataFromConnector(nodeConnector.getName()));
                }
              }
            }
            builtIn=false;
          }
        }
      }
    }
 else     if (result.getResultType() == EUpdateResult.RENAME) {
      List<Object> parameter=(List<Object>)result.getParameter();
      if (parameter.size() >= 3) {
        IMetadataTable newTable=(IMetadataTable)parameter.get(0);
        String oldSourceId=(String)parameter.get(1);
        String newSourceId=(String)parameter.get(2);
        if (PluginChecker.isEBCDICPluginLoaded()) {
          IEBCDICProviderService service=(IEBCDICProviderService)GlobalServiceRegister.getDefault().getService(IEBCDICProviderService.class);
          if (service != null) {
            if (service.isEbcdicNode(node)) {
              String[] sourceIdAndChildName=UpdateManagerUtils.getSourceIdAndChildName(oldSourceId);
              final String oldSchemaName=sourceIdAndChildName[1];
              sourceIdAndChildName=UpdateManagerUtils.getSourceIdAndChildName(newSourceId);
              final String newSchemaName=sourceIdAndChildName[1];
              Map<String,Object> lineValue=(Map<String,Object>)parameter.get(3);
              if (lineValue != null) {
                IMetadataTable metadataTable=MetadataToolHelper.getMetadataTableFromNode(node,oldSchemaName);
                Object schemaName=lineValue.get(IEbcdicConstant.FIELD_SCHEMA);
                if (metadataTable != null && schemaName != null) {
                  lineValue.put(IEbcdicConstant.FIELD_SCHEMA,newSchemaName);
                  MetadataToolHelper.copyTable(newTable,metadataTable);
                  syncSchemaForEBCDIC(node,metadataTable);
                  metadataTable.setLabel(newSchemaName);
                }
              }
              return;
            }
          }
        }
        if (GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerMapperService.class)) {
          IDesignerMapperService service=(IDesignerMapperService)GlobalServiceRegister.getDefault().getService(IDesignerMapperService.class);
          if (service == null || externalNode == null || externalNode.getExternalData() == null) {
            return;
          }
          IExternalData externalData=externalNode.getExternalData();
          parameter=(List<Object>)result.getParameter();
          if (parameter.size() == 3) {
            if (node.getComponent() != null && "String_Node_Str".equals(node.getComponent().getName())) {
              newTable=(IMetadataTable)parameter.get(0);
              String schemaId=(String)parameter.get(1);
              String newSchemaId=(String)parameter.get(2);
              service.renameMapperTable(externalNode,schemaId,newSchemaId,newTable);
              node.setMetadataList(externalNode.getMetadataList());
              syncSchemaForTMap(node);
            }
          }
          return;
        }
        String schemaParamName=UpdatesConstants.SCHEMA + UpdatesConstants.COLON + EParameterName.REPOSITORY_SCHEMA_TYPE.getName();
        IElementParameter repositoryParam=node.getElementParameter(schemaParamName);
        if (repositoryParam != null && oldSourceId.equals(repositoryParam.getValue())) {
          node.setPropertyValue(schemaParamName,newSourceId);
          if (newTable != null) {
            for (            INodeConnector nodeConnector : node.getListConnector()) {
              if (nodeConnector.getBaseSchema().equals(newTable.getAttachedConnector())) {
                MetadataToolHelper.copyTable(newTable,node.getMetadataFromConnector(nodeConnector.getName()));
              }
            }
          }
          builtIn=false;
        }
        schemaParamName=UpdatesConstants.SCHEMA_TARGET + UpdatesConstants.COLON + EParameterName.REPOSITORY_SCHEMA_TYPE.getName();
        repositoryParam=node.getElementParameter(schemaParamName);
        if (repositoryParam != null && oldSourceId.equals(repositoryParam.getValue())) {
          node.setPropertyValue(schemaParamName,newSourceId);
          if (newTable != null) {
            for (            INodeConnector nodeConnector : node.getListConnector()) {
              if (nodeConnector.getBaseSchema().equals(repositoryParam.getContext())) {
                MetadataToolHelper.copyTable(newTable,node.getMetadataFromConnector(nodeConnector.getName()));
              }
            }
          }
          builtIn=false;
        }
      }
    }
 else     if (result.getResultType() == EUpdateResult.BUIL_IN) {
      if (UpdatesConstants.SCHEMA_TARGET.equals(result.getParameter())) {
        node.setPropertyValue(UpdatesConstants.SCHEMA_TARGET + "String_Node_Str" + EParameterName.SCHEMA_TYPE.getName(),EmfComponent.BUILTIN);
      }
 else {
        if (PluginChecker.isEBCDICPluginLoaded()) {
          IEBCDICProviderService service=(IEBCDICProviderService)GlobalServiceRegister.getDefault().getService(IEBCDICProviderService.class);
          if (service != null) {
            if (service.isEbcdicNode(node)) {
              Object parameter=result.getParameter();
              if (parameter instanceof Map) {
                Map<String,Object> lineValue=(Map<String,Object>)parameter;
                lineValue.remove(IEbcdicConstant.FIELD_SCHEMA + IEbcdicConstant.REF_TYPE);
              }
              node.setPropertyValue(EParameterName.SCHEMA_TYPE.getName(),EmfComponent.BUILTIN);
              return;
            }
          }
        }
        if (PluginChecker.isJobLetPluginLoaded()) {
          IJobletProviderService service=(IJobletProviderService)GlobalServiceRegister.getDefault().getService(IJobletProviderService.class);
          if (service != null && service.isJobletInOutComponent(node)) {
            node.setPropertyValue(EParameterName.SCHEMA_TYPE.getName() + "String_Node_Str" + EParameterName.SCHEMA_TYPE.getName(),EmfComponent.BUILTIN);
          }
        }
        node.setPropertyValue(EParameterName.SCHEMA_TYPE.getName(),EmfComponent.BUILTIN);
        for (        IElementParameter param : node.getElementParameters()) {
          SAPParametersUtils.setNoRepositoryParams(param);
        }
      }
    }
 else     if (result.getResultType() == EUpdateResult.DELETE) {
      node.setPropertyValue(EParameterName.SCHEMA_TYPE.getName(),EmfComponent.BUILTIN);
    }
 else     if (result.getResultType() == EUpdateResult.RELOAD) {
      List<Object> parameter=(List<Object>)result.getParameter();
      String connectionId=null;
      String tableLabel=null;
      IRepositoryViewObject toReload=null;
      IMetadataTable tableToReload=null;
      if (parameter instanceof List) {
        List listParameter=parameter;
        connectionId=(String)node.getPropertyValue(EParameterName.REPOSITORY_PROPERTY_TYPE.getName());
        tableLabel=((String)listParameter.get(0)).split(UpdatesConstants.SEGMENT_LINE)[0];
      }
      if (connectionId != null) {
        try {
          toReload=ProxyRepositoryFactory.getInstance().getLastVersion(connectionId);
        }
 catch (        PersistenceException e) {
          ExceptionHandler.process(e);
        }
      }
      if (toReload != null) {
        Item item=toReload.getProperty().getItem();
        if (item != null && item instanceof DatabaseConnectionItem) {
          DatabaseConnectionItem dbItem=(DatabaseConnectionItem)item;
          Connection connection=dbItem.getConnection();
          if (connection instanceof DatabaseConnection) {
            DatabaseConnection dbConn=(DatabaseConnection)connection;
            Set<MetadataTable> tables=ProjectNodeHelper.getTablesFromSpecifiedDataPackage(dbConn);
            if (tables != null && !tables.isEmpty()) {
              Iterator it=tables.iterator();
              while (it.hasNext() && tableToReload == null) {
                MetadataTable table=(MetadataTable)it.next();
                String label=table.getLabel();
                if (tableLabel != null) {
                  if (label != null && label.equals(tableLabel)) {
                    tableToReload=ConvertionHelper.convert(table);
                    break;
                  }
                }
              }
            }
            Set<org.talend.core.model.metadata.builder.connection.MetadataTable> newTables=ConnectionHelper.getTables(connection);
            if (newTables != null && !newTables.isEmpty() && tableToReload == null) {
              Iterator it=newTables.iterator();
              while (it.hasNext() && tableToReload == null) {
                MetadataTable table=(MetadataTable)it.next();
                String label=table.getLabel();
                if (tableLabel != null) {
                  if (label != null && label.equals(tableLabel)) {
                    tableToReload=ConvertionHelper.convert(table);
                    break;
                  }
                }
              }
            }
          }
        }
        if (tableToReload != null) {
          int index=-1;
          List<IMetadataTable> tablesInNode=node.getMetadataList();
          for (          IMetadataTable table : tablesInNode) {
            if (table.getLabel().equals(tableToReload.getLabel())) {
              index=tablesInNode.indexOf(table);
              break;
            }
          }
          if (index >= 0) {
            IMetadataTable oldTable=tablesInNode.get(index);
            tableToReload.setAttachedConnector(oldTable.getAttachedConnector());
            tableToReload.setDbms(oldTable.getDbms());
            tablesInNode.remove(index);
            tablesInNode.add(index,tableToReload);
            builtIn=false;
          }
        }
      }
    }
    if (builtIn) {
      node.setPropertyValue(EParameterName.SCHEMA_TYPE.getName(),EmfComponent.BUILTIN);
    }
  }
}