Program: 118372
Project: 118372
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void execute(){
  elem.setPropertyValue(updataComponentParamName,new Boolean(true));
  boolean allowAutoSwitch=true;
  IElementParameter elemParam=elem.getElementParameter(EParameterName.REPOSITORY_ALLOW_AUTO_SWITCH.getName());
  if (elemParam != null) {
    elemParam.setValue(Boolean.FALSE);
    allowAutoSwitch=(Boolean)elemParam.getValue();
  }
  if (!allowAutoSwitch && (elem instanceof Node)) {
    Node node=(Node)elem;
    boolean isSchemaEmpty=false;
    if (node.getMetadataList().size() > 0) {
      isSchemaEmpty=node.getMetadataList().get(0).getListColumns().size() == 0;
    }
 else {
      isSchemaEmpty=true;
    }
    for (    IElementParameter curParam : node.getElementParameters()) {
      if (curParam.getFieldType().equals(EParameterFieldType.MEMO_SQL)) {
        if (curParam.getDefaultValues().size() > 0) {
        }
      }
    }
    if (isSchemaEmpty) {
      allowAutoSwitch=true;
    }
    if (((INode)elem).getComponent().getName().equals("String_Node_Str")) {
      allowAutoSwitch=true;
    }
  }
  if (propertyName.split("String_Node_Str")[1].equals(propertyTypeName)) {
    elem.setPropertyValue(propertyName,value);
    if (allowAutoSwitch) {
      if (elem instanceof IProcess) {
        if (ComponentCategory.CATEGORY_4_SPARK.getName().equals(((IProcess)elem).getComponentsType()) || ComponentCategory.CATEGORY_4_SPARKSTREAMING.getName().equals(((IProcess)elem).getComponentsType())) {
          if (EmfComponent.REPOSITORY.equals(value)) {
            IElementParameter sparkLocalParam=((IProcess)elem).getElementParameter(HadoopConstants.SPARK_LOCAL_MODE);
            IElementParameter sparkParam=((IProcess)elem).getElementParameter(HadoopConstants.SPARK_MODE);
            if (sparkLocalParam != null && (Boolean)(sparkLocalParam.getValue())) {
              sparkLocalParam.setValue(false);
            }
            if (sparkParam != null && !HadoopConstants.SPARK_MODE_YARN_CLIENT.equals(sparkParam.getValue())) {
              sparkParam.setValue(HadoopConstants.SPARK_MODE_YARN_CLIENT);
            }
          }
        }
      }
      setOtherProperties();
    }
  }
 else {
    oldMetadata=(String)elem.getPropertyValue(propertyName);
    elem.setPropertyValue(propertyName,value);
    if (allowAutoSwitch) {
      setOtherProperties();
    }
  }
  String propertyParamName=null;
  if (elem.getElementParameter(propertyName).getParentParameter() != null) {
    IElementParameter param=elem.getElementParameter(propertyName).getParentParameter();
    if (param.getFieldType() == EParameterFieldType.PROPERTY_TYPE) {
      propertyParamName=param.getName();
    }
  }
  if (propertyName.split("String_Node_Str")[1].equals(propertyTypeName) && (EmfComponent.BUILTIN.equals(value))) {
    for (    IElementParameter param : elem.getElementParameters()) {
      if (param.getRepositoryProperty() != null && !param.getRepositoryProperty().equals(propertyParamName)) {
        continue;
      }
      boolean paramFlag=JobSettingsConstants.isExtraParameter(param.getName());
      boolean extraFlag=JobSettingsConstants.isExtraParameter(propertyName.split("String_Node_Str")[0]);
      if (paramFlag == extraFlag) {
        if (param.getFieldType() == EParameterFieldType.MEMO_SQL) {
          IElementParameter querystoreParam=elem.getElementParameterFromField(EParameterFieldType.QUERYSTORE_TYPE,param.getCategory());
          if (querystoreParam != null) {
            Map<String,IElementParameter> childParam=querystoreParam.getChildParameters();
            if (childParam != null) {
              IElementParameter queryTypeParam=childParam.get(EParameterName.QUERYSTORE_TYPE.getName());
              if (queryTypeParam != null && EmfComponent.REPOSITORY.equals(queryTypeParam.getValue())) {
                continue;
              }
            }
          }
        }
        if (param.getRepositoryValue() != null) {
          param.setReadOnly(false);
          param.setRepositoryValueUsed(false);
        }
      }
    }
  }
 else {
    oldValues.clear();
    List<ComponentProperties> componentProperties=null;
    IGenericWizardService wizardService=null;
    if (GlobalServiceRegister.getDefault().isServiceRegistered(IGenericWizardService.class)) {
      wizardService=(IGenericWizardService)GlobalServiceRegister.getDefault().getService(IGenericWizardService.class);
    }
    if (wizardService != null && wizardService.isGenericConnection(connection)) {
      componentProperties=wizardService.getAllComponentProperties(connection);
    }
    IElementParameter propertyParam=elem.getElementParameter(propertyName);
    List<IElementParameter> elementParameters=new ArrayList<>(elem.getElementParameters());
    for (    IElementParameter param : elementParameters) {
      String repositoryValue=param.getRepositoryValue();
      if (param.getFieldType() == EParameterFieldType.PROPERTY_TYPE) {
        continue;
      }
      boolean isGenericRepositoryValue=RepositoryToComponentProperty.isGenericRepositoryValue(connection,componentProperties,param.getName());
      if (repositoryValue == null && isGenericRepositoryValue) {
        repositoryValue=param.getName();
        param.setRepositoryValue(repositoryValue);
        param.setRepositoryValueUsed(true);
      }
      if (repositoryValue == null || param.getRepositoryProperty() != null && !param.getRepositoryProperty().equals(propertyParamName)) {
        continue;
      }
      String componentName=elem instanceof INode ? (((INode)elem).getComponent().getName()) : null;
      boolean b=elem instanceof INode && (((INode)elem).getComponent().getName().equals("String_Node_Str") || ((INode)elem).getComponent().getName().equals("String_Node_Str") || ((INode)elem).getComponent().getName().equals("String_Node_Str")|| ((INode)elem).getComponent().getName().equals("String_Node_Str")|| ((INode)elem).getComponent().getName().equals("String_Node_Str")|| ((INode)elem).getComponent().getName().equals("String_Node_Str"));
      if (("String_Node_Str".equals(repositoryValue) || (param.isShow(elem.getElementParameters())) || b) && (!param.getName().equals(propertyTypeName))) {
        if (param.getRepositoryProperty() != null && !param.getRepositoryProperty().equals(propertyParamName)) {
          continue;
        }
        Object objectValue=null;
        if (connection instanceof XmlFileConnection && this.dragAndDropAction == true && repositoryValue.equals("String_Node_Str") && reOpenXSDBool == true) {
          objectValue=RepositoryToComponentProperty.getXmlAndXSDFileValue((XmlFileConnection)connection,repositoryValue);
        }
 else         if (connection instanceof SalesforceSchemaConnection && "String_Node_Str".equals(repositoryValue)) {
          if (this.moduleUnit != null) {
            objectValue=moduleUnit.getModuleName();
          }
 else {
            objectValue=null;
          }
        }
 else         if (connection instanceof SalesforceSchemaConnection && "String_Node_Str".equals(repositoryValue)) {
          if (this.moduleUnit != null) {
            objectValue=moduleUnit.getModuleName();
          }
 else {
            objectValue=null;
          }
        }
 else         if (connection instanceof MDMConnection) {
          if (table == null) {
            IMetadataTable metaTable=null;
            if (((Node)elem).getMetadataList().size() > 0) {
              metaTable=((Node)elem).getMetadataList().get(0);
            }
            objectValue=RepositoryToComponentProperty.getValue(connection,repositoryValue,metaTable);
          }
 else {
            objectValue=RepositoryToComponentProperty.getValue(connection,repositoryValue,table);
          }
        }
 else         if (connection instanceof WSDLSchemaConnection && "String_Node_Str".equals(repositoryValue)) {
          objectValue=((WSDLSchemaConnection)connection).isUseProxy();
        }
 else {
          IMetadataTable metaTable=table;
          if (metaTable == null && elem instanceof Node) {
            INodeConnector conn=((Node)elem).getConnectorFromType(EConnectionType.FLOW_MAIN);
            if (conn != null && conn.getMaxLinkOutput() == 1) {
              metaTable=((Node)elem).getMetadataFromConnector(conn.getName());
            }
          }
          objectValue=RepositoryToComponentProperty.getValue(connection,repositoryValue,metaTable,componentName);
        }
        if (GlobalServiceRegister.getDefault().isServiceRegistered(IJsonFileService.class)) {
          IJsonFileService jsonService=(IJsonFileService)GlobalServiceRegister.getDefault().getService(IJsonFileService.class);
          boolean paramChanged=jsonService.changeFilePathFromRepository(connection,param,elem,objectValue);
          if (paramChanged) {
            continue;
          }
        }
        if (objectValue != null) {
          oldValues.put(param.getName(),param.getValue());
          if (param.getFieldType().equals(EParameterFieldType.CLOSED_LIST) && param.getRepositoryValue().equals("String_Node_Str")) {
            String dbVersion="String_Node_Str";
            if (connection instanceof DatabaseConnection) {
              dbVersion=((DatabaseConnection)connection).getDbVersionString();
            }
            boolean found=false;
            String[] list=param.getListRepositoryItems();
            for (int i=0; (i < list.length) && (!found); i++) {
              if (objectValue.equals(list[i])) {
                found=true;
                elem.setPropertyValue(param.getName(),param.getListItemsValue()[i]);
              }
            }
            IElementParameter elementParameter=null;
            IElementParameter elementParameter2=null;
            if (EParameterName.DB_TYPE.getName().equals(param.getName())) {
              elementParameter=elem.getElementParameter(EParameterName.DB_VERSION.getName());
              elementParameter2=elem.getElementParameter(EParameterName.SCHEMA_DB.getName());
            }
 else {
              elementParameter=elem.getElementParameter(JobSettingsConstants.getExtraParameterName(EParameterName.DB_VERSION.getName()));
              elementParameter2=elem.getElementParameter(JobSettingsConstants.getExtraParameterName(EParameterName.SCHEMA_DB.getName()));
            }
            String dbType="String_Node_Str";
            if (param.getValue() != null) {
              int indexOfItemFromList=param.getIndexOfItemFromList(param.getValue().toString());
              if (indexOfItemFromList != -1) {
                dbType=param.getListItemsDisplayCodeName()[indexOfItemFromList];
              }
            }
            if (elementParameter2 != null && !elementParameter2.isShow(elem.getElementParameters()) && !elementParameter2.getValue().equals("String_Node_Str")) {
              elementParameter2.setValue("String_Node_Str");
            }
            if (StatsAndLogsConstants.JDBC.equals(dbType)) {
              IElementParameter dbNameParm=elem.getElementParameter(EParameterName.DBNAME.getName());
              if (dbNameParm != null) {
                dbNameParm.setValue("String_Node_Str");
              }
            }
 else {
              IElementParameter rulParam=elem.getElementParameter(EParameterName.URL.getName());
              if (rulParam != null) {
                rulParam.setValue("String_Node_Str");
              }
              IElementParameter classParam=elem.getElementParameter(EParameterName.DRIVER_CLASS.getName());
              if (classParam != null) {
                classParam.setValue("String_Node_Str");
              }
              IElementParameter jarParam=elem.getElementParameter(EParameterName.DRIVER_JAR.getName());
              if (jarParam != null) {
                jarParam.setValue(new ArrayList<Map<String,Object>>());
              }
            }
            JobSettingVersionUtil.setDbVersion(elementParameter,dbVersion,false);
            DesignerUtilities.setSchemaDB(elementParameter2,param.getValue());
          }
 else           if (param.getFieldType().equals(EParameterFieldType.CLOSED_LIST) && param.getRepositoryValue().equals("String_Node_Str")) {
            String[] list=param.getListItemsDisplayName();
            for (int i=0; i < list.length; i++) {
              if (objectValue.equals(list[i])) {
                elem.setPropertyValue(param.getName(),param.getListItemsValue()[i]);
              }
            }
          }
 else           if (param.getFieldType().equals(EParameterFieldType.CLOSED_LIST) && param.getRepositoryValue().equals("String_Node_Str")) {
            String[] list=param.getListItemsDisplayName();
            for (            String element : list) {
              if (objectValue.toString().toUpperCase().equals(element)) {
                elem.setPropertyValue(param.getName(),objectValue);
              }
            }
          }
 else           if (param.getFieldType().equals(EParameterFieldType.CLOSED_LIST) && param.getRepositoryValue().equals("String_Node_Str")) {
            if (!objectValue.equals(param.getValue())) {
              PropertyChangeCommand cmd=new PropertyChangeCommand(elem,"String_Node_Str",objectValue);
              cmd.execute();
            }
          }
 else {
            if (repositoryValue.equals("String_Node_Str")) {
              IElementParameter paramEncoding=param.getChildParameters().get(EParameterName.ENCODING_TYPE.getName());
              if (connection instanceof FTPConnection) {
                if (((FTPConnection)connection).getEcoding() != null) {
                  paramEncoding.setValue(((FTPConnection)connection).getEcoding());
                }
 else {
                  paramEncoding.setValue(EmfComponent.ENCODING_TYPE_CUSTOM);
                }
              }
 else {
                if (objectValue instanceof String) {
                  String str=TalendTextUtils.removeQuotes((String)objectValue);
                  if (str.equals(EmfComponent.ENCODING_TYPE_UTF_8)) {
                    paramEncoding.setValue(EmfComponent.ENCODING_TYPE_UTF_8);
                  }
 else                   if (str.equals(EmfComponent.ENCODING_TYPE_ISO_8859_15)) {
                    paramEncoding.setValue(EmfComponent.ENCODING_TYPE_ISO_8859_15);
                  }
 else {
                    paramEncoding.setValue(EmfComponent.ENCODING_TYPE_CUSTOM);
                  }
                }
              }
            }
 else             if (repositoryValue.equals("String_Node_Str")) {
              setOtherProperties();
            }
            if (repositoryValue.equals("String_Node_Str")) {
              List list=new ArrayList();
              Object[] listItemsValue=elem.getElementParameter("String_Node_Str").getListItemsValue();
              for (              Object element : listItemsValue) {
                list.add(element);
              }
              if (list != null && !list.contains(objectValue)) {
                objectValue="String_Node_Str";
              }
            }
            if (repositoryValue.equals(EParameterName.FILE_PATH.getName())) {
              String filePath="String_Node_Str";
              if (connection.isContextMode()) {
                ContextItem contextItem=ContextUtils.getContextItemById2(connection.getContextId());
                if (contextItem != null) {
                  String selectedContext=contextItem.getDefaultContext();
                  final ContextType contextTypeByName=ContextUtils.getContextTypeByName(contextItem,selectedContext,true);
                  filePath=ConnectionContextHelper.getOriginalValue(contextTypeByName,objectValue.toString());
                }
              }
 else {
                filePath=TalendTextUtils.removeQuotes(objectValue.toString());
              }
              boolean versionCheckFor2007=false;
              if (filePath != null && filePath.endsWith("String_Node_Str")) {
                versionCheckFor2007=true;
              }
              if (elem.getElementParameter("String_Node_Str") != null) {
                elem.setPropertyValue("String_Node_Str",versionCheckFor2007);
              }
            }
            if (param.getFieldType().equals(EParameterFieldType.FILE)) {
              if (objectValue != null) {
                objectValue=objectValue.toString().replace("String_Node_Str","String_Node_Str");
              }
            }
            elem.setPropertyValue(param.getName(),objectValue);
          }
          param.setRepositoryValueUsed(true);
        }
 else         if (param.getFieldType().equals(EParameterFieldType.TABLE) && param.getRepositoryValue().equals("String_Node_Str")) {
          List<Map<String,Object>> table=(List<Map<String,Object>>)elem.getPropertyValue(param.getName());
          if (((Node)elem).getMetadataList().size() > 0) {
            IMetadataTable metaTable=((Node)elem).getMetadataList().get(0);
            RepositoryToComponentProperty.getTableXmlFileValue(connection,"String_Node_Str",param,table,metaTable);
            param.setRepositoryValueUsed(true);
          }
        }
 else         if (param.getFieldType().equals(EParameterFieldType.TABLE) && param.getRepositoryValue().equals("String_Node_Str") && connection != null) {
          List<Map<String,Object>> table=(List<Map<String,Object>>)elem.getPropertyValue(param.getName());
          table.clear();
          ArrayList parameters=((WSDLSchemaConnection)connection).getParameters();
          if (parameters != null) {
            for (            Object object : parameters) {
              Map<String,Object> map2=new HashMap<String,Object>();
              map2.put("String_Node_Str",TalendTextUtils.addQuotes(object.toString()));
              table.add(map2);
            }
          }
          param.setRepositoryValueUsed(true);
        }
 else         if (param.getFieldType().equals(EParameterFieldType.TEXT) && "String_Node_Str".equals(param.getRepositoryValue())) {
          param.setRepositoryValueUsed(true);
        }
 else {
          String paramName=param.getName();
          if ("String_Node_Str".equals(paramName) || "String_Node_Str".equals(paramName) || "String_Node_Str".equals(paramName)|| "String_Node_Str".equals(paramName)|| "String_Node_Str".equals(paramName)|| "String_Node_Str".equals(paramName)) {
            SAPParametersUtils.retrieveSAPParams(elem,connection,param,getSapFunctionLabel());
          }
          if ("String_Node_Str".equals(paramName) || "String_Node_Str".equals(paramName) || "String_Node_Str".equals(paramName)|| "String_Node_Str".equals(paramName)|| "String_Node_Str".equals(paramName)|| "String_Node_Str".equals(paramName)) {
            SAPParametersUtils.getSAPIDocParams(elem,connection,param,getSapIDocLabel());
          }
        }
        if (param.isRepositoryValueUsed()) {
          if (("String_Node_Str").equals(param.getName())) {
            param.setReadOnly(true);
          }
 else {
            param.setReadOnly(false);
          }
        }
      }
    }
    IElementParameter parentParameter=propertyParam.getParentParameter();
    if (parentParameter != null) {
      IElementParameter param=parentParameter.getChildParameters().get(EParameterName.REPOSITORY_PROPERTY_TYPE.getName());
      if (param != null && propertyParam == param) {
        ConnectionItem connItem=UpdateRepositoryUtils.getConnectionItemByItemId((String)param.getValue());
        if (connItem != null) {
          if (elem instanceof Node) {
            ConnectionContextHelper.addContextForNodeParameter((Node)elem,connItem,ignoreContextMode);
          }
 else           if (elem instanceof Process) {
            ConnectionContextHelper.addContextForProcessParameter((Process)elem,connItem,param.getCategory(),ignoreContextMode);
          }
        }
      }
    }
  }
  for (  IElementParameter curParam : elem.getElementParameters()) {
    if (curParam.getFieldType().equals(EParameterFieldType.AS400_CHECK)) {
      setOtherProperties();
    }
    if (connection instanceof HL7Connection) {
      if (curParam.getName().equals("String_Node_Str")) {
        String hl7VersionString=connection.getVersion();
        if (hl7VersionString != null) {
          hl7VersionString=hl7VersionString.replace("String_Node_Str","String_Node_Str");
          curParam.setValue(hl7VersionString);
        }
      }
    }
  }
  if (elem instanceof Node) {
    boolean isXstreamCdcTypeMode=false;
    if (connection != null && connection instanceof DatabaseConnection) {
      String cdcTypeMode=((DatabaseConnection)connection).getCdcTypeMode();
      if (CDCTypeMode.XSTREAM_MODE == CDCTypeMode.indexOf(cdcTypeMode)) {
        isXstreamCdcTypeMode=true;
      }
    }
    if (isXstreamCdcTypeMode && ((Node)elem).getComponent().getName().equals("String_Node_Str")) {
      IMetadataTable table=((Node)elem).getMetadataList().get(0);
      IElementParameter schemaParam=elem.getElementParameterFromField(EParameterFieldType.SCHEMA_TYPE);
      schemaParam.setValueToDefault(elem.getElementParameters());
      table.setListColumns((((IMetadataTable)schemaParam.getValue()).clone(true)).getListColumns());
    }
    ((Process)((Node)elem).getProcess()).checkProcess();
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void execute(){
  elem.setPropertyValue(updataComponentParamName,new Boolean(true));
  boolean allowAutoSwitch=true;
  IElementParameter elemParam=elem.getElementParameter(EParameterName.REPOSITORY_ALLOW_AUTO_SWITCH.getName());
  if (elemParam != null) {
    elemParam.setValue(Boolean.FALSE);
    allowAutoSwitch=(Boolean)elemParam.getValue();
  }
  if (!allowAutoSwitch && (elem instanceof Node)) {
    Node node=(Node)elem;
    boolean isSchemaEmpty=false;
    if (node.getMetadataList().size() > 0) {
      isSchemaEmpty=node.getMetadataList().get(0).getListColumns().size() == 0;
    }
 else {
      isSchemaEmpty=true;
    }
    for (    IElementParameter curParam : node.getElementParameters()) {
      if (curParam.getFieldType().equals(EParameterFieldType.MEMO_SQL)) {
        if (curParam.getDefaultValues().size() > 0) {
        }
      }
    }
    if (isSchemaEmpty) {
      allowAutoSwitch=true;
    }
    if (((INode)elem).getComponent().getName().equals("String_Node_Str")) {
      allowAutoSwitch=true;
    }
  }
  if (propertyName.split("String_Node_Str")[1].equals(propertyTypeName)) {
    elem.setPropertyValue(propertyName,value);
    if (allowAutoSwitch) {
      if (elem instanceof IProcess) {
        if (ComponentCategory.CATEGORY_4_SPARK.getName().equals(((IProcess)elem).getComponentsType()) || ComponentCategory.CATEGORY_4_SPARKSTREAMING.getName().equals(((IProcess)elem).getComponentsType())) {
          if (EmfComponent.REPOSITORY.equals(value)) {
            IElementParameter sparkLocalParam=((IProcess)elem).getElementParameter(HadoopConstants.SPARK_LOCAL_MODE);
            IElementParameter sparkParam=((IProcess)elem).getElementParameter(HadoopConstants.SPARK_MODE);
            if (sparkLocalParam != null && (Boolean)(sparkLocalParam.getValue())) {
              sparkLocalParam.setValue(false);
            }
            if (sparkParam != null && !HadoopConstants.SPARK_MODE_YARN_CLIENT.equals(sparkParam.getValue())) {
              sparkParam.setValue(HadoopConstants.SPARK_MODE_YARN_CLIENT);
            }
          }
        }
      }
      setOtherProperties();
    }
  }
 else {
    oldMetadata=(String)elem.getPropertyValue(propertyName);
    elem.setPropertyValue(propertyName,value);
    if (allowAutoSwitch) {
      setOtherProperties();
    }
  }
  String propertyParamName=null;
  if (elem.getElementParameter(propertyName).getParentParameter() != null) {
    IElementParameter param=elem.getElementParameter(propertyName).getParentParameter();
    if (param.getFieldType() == EParameterFieldType.PROPERTY_TYPE) {
      propertyParamName=param.getName();
    }
  }
  if (propertyName.split("String_Node_Str")[1].equals(propertyTypeName) && (EmfComponent.BUILTIN.equals(value))) {
    for (    IElementParameter param : elem.getElementParameters()) {
      if (param.getRepositoryProperty() != null && !param.getRepositoryProperty().equals(propertyParamName)) {
        continue;
      }
      boolean paramFlag=JobSettingsConstants.isExtraParameter(param.getName());
      boolean extraFlag=JobSettingsConstants.isExtraParameter(propertyName.split("String_Node_Str")[0]);
      if (paramFlag == extraFlag) {
        if (param.getFieldType() == EParameterFieldType.MEMO_SQL) {
          IElementParameter querystoreParam=elem.getElementParameterFromField(EParameterFieldType.QUERYSTORE_TYPE,param.getCategory());
          if (querystoreParam != null) {
            Map<String,IElementParameter> childParam=querystoreParam.getChildParameters();
            if (childParam != null) {
              IElementParameter queryTypeParam=childParam.get(EParameterName.QUERYSTORE_TYPE.getName());
              if (queryTypeParam != null && EmfComponent.REPOSITORY.equals(queryTypeParam.getValue())) {
                continue;
              }
            }
          }
        }
        if (param.getRepositoryValue() != null) {
          param.setReadOnly(false);
          param.setRepositoryValueUsed(false);
        }
      }
    }
  }
 else {
    oldValues.clear();
    List<ComponentProperties> componentProperties=null;
    IGenericWizardService wizardService=null;
    if (GlobalServiceRegister.getDefault().isServiceRegistered(IGenericWizardService.class)) {
      wizardService=(IGenericWizardService)GlobalServiceRegister.getDefault().getService(IGenericWizardService.class);
    }
    if (wizardService != null && wizardService.isGenericConnection(connection)) {
      componentProperties=wizardService.getAllComponentProperties(connection,null);
    }
    IElementParameter propertyParam=elem.getElementParameter(propertyName);
    List<IElementParameter> elementParameters=new ArrayList<>(elem.getElementParameters());
    for (    IElementParameter param : elementParameters) {
      String repositoryValue=param.getRepositoryValue();
      if (param.getFieldType() == EParameterFieldType.PROPERTY_TYPE) {
        continue;
      }
      boolean isGenericRepositoryValue=RepositoryToComponentProperty.isGenericRepositoryValue(connection,componentProperties,param.getName());
      if (repositoryValue == null && isGenericRepositoryValue) {
        repositoryValue=param.getName();
        param.setRepositoryValue(repositoryValue);
        param.setRepositoryValueUsed(true);
      }
      if (repositoryValue == null || param.getRepositoryProperty() != null && !param.getRepositoryProperty().equals(propertyParamName)) {
        continue;
      }
      String componentName=elem instanceof INode ? (((INode)elem).getComponent().getName()) : null;
      boolean b=elem instanceof INode && (((INode)elem).getComponent().getName().equals("String_Node_Str") || ((INode)elem).getComponent().getName().equals("String_Node_Str") || ((INode)elem).getComponent().getName().equals("String_Node_Str")|| ((INode)elem).getComponent().getName().equals("String_Node_Str")|| ((INode)elem).getComponent().getName().equals("String_Node_Str")|| ((INode)elem).getComponent().getName().equals("String_Node_Str"));
      if (("String_Node_Str".equals(repositoryValue) || (param.isShow(elem.getElementParameters())) || b) && (!param.getName().equals(propertyTypeName))) {
        if (param.getRepositoryProperty() != null && !param.getRepositoryProperty().equals(propertyParamName)) {
          continue;
        }
        Object objectValue=null;
        if (connection instanceof XmlFileConnection && this.dragAndDropAction == true && repositoryValue.equals("String_Node_Str") && reOpenXSDBool == true) {
          objectValue=RepositoryToComponentProperty.getXmlAndXSDFileValue((XmlFileConnection)connection,repositoryValue);
        }
 else         if (connection instanceof SalesforceSchemaConnection && "String_Node_Str".equals(repositoryValue)) {
          if (this.moduleUnit != null) {
            objectValue=moduleUnit.getModuleName();
          }
 else {
            objectValue=null;
          }
        }
 else         if (connection instanceof SalesforceSchemaConnection && "String_Node_Str".equals(repositoryValue)) {
          if (this.moduleUnit != null) {
            objectValue=moduleUnit.getModuleName();
          }
 else {
            objectValue=null;
          }
        }
 else         if (connection instanceof MDMConnection) {
          if (table == null) {
            IMetadataTable metaTable=null;
            if (((Node)elem).getMetadataList().size() > 0) {
              metaTable=((Node)elem).getMetadataList().get(0);
            }
            objectValue=RepositoryToComponentProperty.getValue(connection,repositoryValue,metaTable);
          }
 else {
            objectValue=RepositoryToComponentProperty.getValue(connection,repositoryValue,table);
          }
        }
 else         if (connection instanceof WSDLSchemaConnection && "String_Node_Str".equals(repositoryValue)) {
          objectValue=((WSDLSchemaConnection)connection).isUseProxy();
        }
 else {
          IMetadataTable metaTable=table;
          if (metaTable == null && elem instanceof Node) {
            INodeConnector conn=((Node)elem).getConnectorFromType(EConnectionType.FLOW_MAIN);
            if (conn != null && conn.getMaxLinkOutput() == 1) {
              metaTable=((Node)elem).getMetadataFromConnector(conn.getName());
            }
          }
          objectValue=RepositoryToComponentProperty.getValue(connection,repositoryValue,metaTable,componentName);
        }
        if (GlobalServiceRegister.getDefault().isServiceRegistered(IJsonFileService.class)) {
          IJsonFileService jsonService=(IJsonFileService)GlobalServiceRegister.getDefault().getService(IJsonFileService.class);
          boolean paramChanged=jsonService.changeFilePathFromRepository(connection,param,elem,objectValue);
          if (paramChanged) {
            continue;
          }
        }
        if (objectValue != null) {
          oldValues.put(param.getName(),param.getValue());
          if (param.getFieldType().equals(EParameterFieldType.CLOSED_LIST) && param.getRepositoryValue().equals("String_Node_Str")) {
            String dbVersion="String_Node_Str";
            if (connection instanceof DatabaseConnection) {
              dbVersion=((DatabaseConnection)connection).getDbVersionString();
            }
            boolean found=false;
            String[] list=param.getListRepositoryItems();
            for (int i=0; (i < list.length) && (!found); i++) {
              if (objectValue.equals(list[i])) {
                found=true;
                elem.setPropertyValue(param.getName(),param.getListItemsValue()[i]);
              }
            }
            IElementParameter elementParameter=null;
            IElementParameter elementParameter2=null;
            if (EParameterName.DB_TYPE.getName().equals(param.getName())) {
              elementParameter=elem.getElementParameter(EParameterName.DB_VERSION.getName());
              elementParameter2=elem.getElementParameter(EParameterName.SCHEMA_DB.getName());
            }
 else {
              elementParameter=elem.getElementParameter(JobSettingsConstants.getExtraParameterName(EParameterName.DB_VERSION.getName()));
              elementParameter2=elem.getElementParameter(JobSettingsConstants.getExtraParameterName(EParameterName.SCHEMA_DB.getName()));
            }
            String dbType="String_Node_Str";
            if (param.getValue() != null) {
              int indexOfItemFromList=param.getIndexOfItemFromList(param.getValue().toString());
              if (indexOfItemFromList != -1) {
                dbType=param.getListItemsDisplayCodeName()[indexOfItemFromList];
              }
            }
            if (elementParameter2 != null && !elementParameter2.isShow(elem.getElementParameters()) && !elementParameter2.getValue().equals("String_Node_Str")) {
              elementParameter2.setValue("String_Node_Str");
            }
            if (StatsAndLogsConstants.JDBC.equals(dbType)) {
              IElementParameter dbNameParm=elem.getElementParameter(EParameterName.DBNAME.getName());
              if (dbNameParm != null) {
                dbNameParm.setValue("String_Node_Str");
              }
            }
 else {
              IElementParameter rulParam=elem.getElementParameter(EParameterName.URL.getName());
              if (rulParam != null) {
                rulParam.setValue("String_Node_Str");
              }
              IElementParameter classParam=elem.getElementParameter(EParameterName.DRIVER_CLASS.getName());
              if (classParam != null) {
                classParam.setValue("String_Node_Str");
              }
              IElementParameter jarParam=elem.getElementParameter(EParameterName.DRIVER_JAR.getName());
              if (jarParam != null) {
                jarParam.setValue(new ArrayList<Map<String,Object>>());
              }
            }
            JobSettingVersionUtil.setDbVersion(elementParameter,dbVersion,false);
            DesignerUtilities.setSchemaDB(elementParameter2,param.getValue());
          }
 else           if (param.getFieldType().equals(EParameterFieldType.CLOSED_LIST) && param.getRepositoryValue().equals("String_Node_Str")) {
            String[] list=param.getListItemsDisplayName();
            for (int i=0; i < list.length; i++) {
              if (objectValue.equals(list[i])) {
                elem.setPropertyValue(param.getName(),param.getListItemsValue()[i]);
              }
            }
          }
 else           if (param.getFieldType().equals(EParameterFieldType.CLOSED_LIST) && param.getRepositoryValue().equals("String_Node_Str")) {
            String[] list=param.getListItemsDisplayName();
            for (            String element : list) {
              if (objectValue.toString().toUpperCase().equals(element)) {
                elem.setPropertyValue(param.getName(),objectValue);
              }
            }
          }
 else           if (param.getFieldType().equals(EParameterFieldType.CLOSED_LIST) && param.getRepositoryValue().equals("String_Node_Str")) {
            if (!objectValue.equals(param.getValue())) {
              PropertyChangeCommand cmd=new PropertyChangeCommand(elem,"String_Node_Str",objectValue);
              cmd.execute();
            }
          }
 else {
            if (repositoryValue.equals("String_Node_Str")) {
              IElementParameter paramEncoding=param.getChildParameters().get(EParameterName.ENCODING_TYPE.getName());
              if (connection instanceof FTPConnection) {
                if (((FTPConnection)connection).getEcoding() != null) {
                  paramEncoding.setValue(((FTPConnection)connection).getEcoding());
                }
 else {
                  paramEncoding.setValue(EmfComponent.ENCODING_TYPE_CUSTOM);
                }
              }
 else {
                if (objectValue instanceof String) {
                  String str=TalendTextUtils.removeQuotes((String)objectValue);
                  if (str.equals(EmfComponent.ENCODING_TYPE_UTF_8)) {
                    paramEncoding.setValue(EmfComponent.ENCODING_TYPE_UTF_8);
                  }
 else                   if (str.equals(EmfComponent.ENCODING_TYPE_ISO_8859_15)) {
                    paramEncoding.setValue(EmfComponent.ENCODING_TYPE_ISO_8859_15);
                  }
 else {
                    paramEncoding.setValue(EmfComponent.ENCODING_TYPE_CUSTOM);
                  }
                }
              }
            }
 else             if (repositoryValue.equals("String_Node_Str")) {
              setOtherProperties();
            }
            if (repositoryValue.equals("String_Node_Str")) {
              List list=new ArrayList();
              Object[] listItemsValue=elem.getElementParameter("String_Node_Str").getListItemsValue();
              for (              Object element : listItemsValue) {
                list.add(element);
              }
              if (list != null && !list.contains(objectValue)) {
                objectValue="String_Node_Str";
              }
            }
            if (repositoryValue.equals(EParameterName.FILE_PATH.getName())) {
              String filePath="String_Node_Str";
              if (connection.isContextMode()) {
                ContextItem contextItem=ContextUtils.getContextItemById2(connection.getContextId());
                if (contextItem != null) {
                  String selectedContext=contextItem.getDefaultContext();
                  final ContextType contextTypeByName=ContextUtils.getContextTypeByName(contextItem,selectedContext,true);
                  filePath=ConnectionContextHelper.getOriginalValue(contextTypeByName,objectValue.toString());
                }
              }
 else {
                filePath=TalendTextUtils.removeQuotes(objectValue.toString());
              }
              boolean versionCheckFor2007=false;
              if (filePath != null && filePath.endsWith("String_Node_Str")) {
                versionCheckFor2007=true;
              }
              if (elem.getElementParameter("String_Node_Str") != null) {
                elem.setPropertyValue("String_Node_Str",versionCheckFor2007);
              }
            }
            if (param.getFieldType().equals(EParameterFieldType.FILE)) {
              if (objectValue != null) {
                objectValue=objectValue.toString().replace("String_Node_Str","String_Node_Str");
              }
            }
            elem.setPropertyValue(param.getName(),objectValue);
          }
          param.setRepositoryValueUsed(true);
        }
 else         if (param.getFieldType().equals(EParameterFieldType.TABLE) && param.getRepositoryValue().equals("String_Node_Str")) {
          List<Map<String,Object>> table=(List<Map<String,Object>>)elem.getPropertyValue(param.getName());
          if (((Node)elem).getMetadataList().size() > 0) {
            IMetadataTable metaTable=((Node)elem).getMetadataList().get(0);
            RepositoryToComponentProperty.getTableXmlFileValue(connection,"String_Node_Str",param,table,metaTable);
            param.setRepositoryValueUsed(true);
          }
        }
 else         if (param.getFieldType().equals(EParameterFieldType.TABLE) && param.getRepositoryValue().equals("String_Node_Str") && connection != null) {
          List<Map<String,Object>> table=(List<Map<String,Object>>)elem.getPropertyValue(param.getName());
          table.clear();
          ArrayList parameters=((WSDLSchemaConnection)connection).getParameters();
          if (parameters != null) {
            for (            Object object : parameters) {
              Map<String,Object> map2=new HashMap<String,Object>();
              map2.put("String_Node_Str",TalendTextUtils.addQuotes(object.toString()));
              table.add(map2);
            }
          }
          param.setRepositoryValueUsed(true);
        }
 else         if (param.getFieldType().equals(EParameterFieldType.TEXT) && "String_Node_Str".equals(param.getRepositoryValue())) {
          param.setRepositoryValueUsed(true);
        }
 else {
          String paramName=param.getName();
          if ("String_Node_Str".equals(paramName) || "String_Node_Str".equals(paramName) || "String_Node_Str".equals(paramName)|| "String_Node_Str".equals(paramName)|| "String_Node_Str".equals(paramName)|| "String_Node_Str".equals(paramName)) {
            SAPParametersUtils.retrieveSAPParams(elem,connection,param,getSapFunctionLabel());
          }
          if ("String_Node_Str".equals(paramName) || "String_Node_Str".equals(paramName) || "String_Node_Str".equals(paramName)|| "String_Node_Str".equals(paramName)|| "String_Node_Str".equals(paramName)|| "String_Node_Str".equals(paramName)) {
            SAPParametersUtils.getSAPIDocParams(elem,connection,param,getSapIDocLabel());
          }
        }
        if (param.isRepositoryValueUsed()) {
          if (("String_Node_Str").equals(param.getName())) {
            param.setReadOnly(true);
          }
 else {
            param.setReadOnly(false);
          }
        }
      }
    }
    IElementParameter parentParameter=propertyParam.getParentParameter();
    if (parentParameter != null) {
      IElementParameter param=parentParameter.getChildParameters().get(EParameterName.REPOSITORY_PROPERTY_TYPE.getName());
      if (param != null && propertyParam == param) {
        ConnectionItem connItem=UpdateRepositoryUtils.getConnectionItemByItemId((String)param.getValue());
        if (connItem != null) {
          if (elem instanceof Node) {
            ConnectionContextHelper.addContextForNodeParameter((Node)elem,connItem,ignoreContextMode);
          }
 else           if (elem instanceof Process) {
            ConnectionContextHelper.addContextForProcessParameter((Process)elem,connItem,param.getCategory(),ignoreContextMode);
          }
        }
      }
    }
  }
  for (  IElementParameter curParam : elem.getElementParameters()) {
    if (curParam.getFieldType().equals(EParameterFieldType.AS400_CHECK)) {
      setOtherProperties();
    }
    if (connection instanceof HL7Connection) {
      if (curParam.getName().equals("String_Node_Str")) {
        String hl7VersionString=connection.getVersion();
        if (hl7VersionString != null) {
          hl7VersionString=hl7VersionString.replace("String_Node_Str","String_Node_Str");
          curParam.setValue(hl7VersionString);
        }
      }
    }
  }
  if (elem instanceof Node) {
    boolean isXstreamCdcTypeMode=false;
    if (connection != null && connection instanceof DatabaseConnection) {
      String cdcTypeMode=((DatabaseConnection)connection).getCdcTypeMode();
      if (CDCTypeMode.XSTREAM_MODE == CDCTypeMode.indexOf(cdcTypeMode)) {
        isXstreamCdcTypeMode=true;
      }
    }
    if (isXstreamCdcTypeMode && ((Node)elem).getComponent().getName().equals("String_Node_Str")) {
      IMetadataTable table=((Node)elem).getMetadataList().get(0);
      IElementParameter schemaParam=elem.getElementParameterFromField(EParameterFieldType.SCHEMA_TYPE);
      schemaParam.setValueToDefault(elem.getElementParameters());
      table.setListColumns((((IMetadataTable)schemaParam.getValue()).clone(true)).getListColumns());
    }
    ((Process)((Node)elem).getProcess()).checkProcess();
  }
}