Program: 124176
Project: 124176
Buggy source:
@Override public void execute(){
  IElementParameter currentParam=elem.getElementParameter(propName);
  oldElementValues.clear();
  if (currentParam == null) {
    return;
  }
  if (currentParam.isRepositoryValueUsed()) {
    if (currentParam.getFieldType() == EParameterFieldType.MEMO_SQL) {
      Object queryStoreValue=elem.getPropertyValue(EParameterName.QUERYSTORE_TYPE.getName());
      if (!EmfComponent.BUILTIN.equals(queryStoreValue) || !EmfComponent.TNS_FILE.equals(queryStoreValue)) {
        elem.setPropertyValue(EParameterName.QUERYSTORE_TYPE.getName(),EmfComponent.BUILTIN);
      }
      currentParam.setRepositoryValueUsed(false);
    }
 else {
      toUpdate=true;
      String oldValueString=elem.getPropertyValue(propName).toString();
      if (!oldValueString.endsWith("String_Node_Str") && !oldValueString.endsWith("String_Node_Str")) {
        elem.setPropertyValue(propertyTypeName,EmfComponent.BUILTIN);
      }
      for (      IElementParameter param : elem.getElementParameters()) {
        if (param.getCategory().equals(currentParam.getCategory())) {
          param.setRepositoryValueUsed(false);
        }
      }
    }
    repositoryValueWasUsed=true;
  }
 else {
    repositoryValueWasUsed=false;
  }
  oldValue=elem.getPropertyValue(propName);
  elem.setPropertyValue(propName,newValue);
  if ((propName.equals(EParameterName.DBNAME.getName()) || propName.equals(EParameterName.SCHEMA_DB.getName()) || propName.equals(EParameterName.SCHEMA_DB.getName())) && elem instanceof Node) {
    Node node=(Node)elem;
    IElementParameter dqRulerParam=node.getElementParameter("String_Node_Str");
    if (dqRulerParam != null) {
      ITDQRuleService rulerService=null;
      try {
        rulerService=(ITDQRuleService)GlobalServiceRegister.getDefault().getService(ITDQRuleService.class);
      }
 catch (      RuntimeException e) {
      }
      if (rulerService != null) {
        IElementParameter typeParam=node.getElementParameter("String_Node_Str");
        IElementParameter dbParam=node.getElementParameter(EParameterName.DBNAME.getName());
        IElementParameter schemaParam=node.getElementParameter(EParameterName.SCHEMA_DB.getName());
        IElementParameter tableParam=node.getElementParameterFromField(EParameterFieldType.DBTABLE);
        Object value=dqRulerParam.getValue();
        String previousDisplayName=null;
        if (value != null && !"String_Node_Str".equals(value) && dqRulerParam.getListItemsValue().length > 0) {
          int ruleIndex=dqRulerParam.getIndexOfItemFromList((String)value);
          previousDisplayName=dqRulerParam.getListItemsDisplayName()[ruleIndex];
        }
        rulerService.overrideRuleList(typeParam,dbParam,schemaParam,tableParam,dqRulerParam);
        if (previousDisplayName != null) {
          String[] names=dqRulerParam.getListItemsDisplayName();
          Integer valueIndex=null;
          for (int i=0; i < names.length; i++) {
            if (previousDisplayName.equals(names[i])) {
              valueIndex=i;
            }
          }
          if (valueIndex != null) {
            dqRulerParam.setValue(dqRulerParam.getListItemsValue()[valueIndex]);
          }
 else {
            dqRulerParam.setValue("String_Node_Str");
          }
        }
      }
    }
  }
  if (propName.contains(EParameterName.USE_DYNAMIC_JOB.getName()) && newValue.equals(false)) {
    IElementParameter processParam=elem.getElementParameter(EParameterName.PROCESS.getName());
    IElementParameter processTypeParameter=elem.getElementParameter(EParameterName.PROCESS_TYPE_PROCESS.getName());
    final String parentName=processParam.getName() + "String_Node_Str";
    elem.setPropertyValue(parentName + processTypeParameter.getName(),"String_Node_Str");
    elem.setPropertyValue(processParam.getName(),"String_Node_Str");
  }
  if (propName.contains(EParameterName.PROCESS_TYPE_PROCESS.getName())) {
    boolean isSelectUseDynamic=false;
    IElementParameter useDynamicJobParameter=elem.getElementParameter(EParameterName.USE_DYNAMIC_JOB.getName());
    if (useDynamicJobParameter != null && useDynamicJobParameter instanceof IElementParameter) {
      Object useDynamicJobValue=(Object)useDynamicJobParameter.getValue();
      if (useDynamicJobValue != null && useDynamicJobValue instanceof Boolean) {
        isSelectUseDynamic=(Boolean)useDynamicJobValue;
      }
    }
    if (isSelectUseDynamic) {
      StringBuffer labels=new StringBuffer("String_Node_Str");
      if (newValue != null) {
        String[] strValues=newValue.toString().split("String_Node_Str");
        for (int i=0; i < strValues.length; i++) {
          String strValue=strValues[i];
          ProcessItem processItem=ItemCacheManager.getProcessItem((String)strValue);
          if (processItem != null) {
            String label=processItem.getProperty().getLabel();
            if (i > 0) {
              labels.append("String_Node_Str");
            }
            labels.append(label);
          }
        }
      }
      currentParam.getParentParameter().setValue(labels.toString());
    }
 else {
      ProcessItem processItem=ItemCacheManager.getProcessItem((String)newValue);
      if (processItem != null) {
        currentParam.getParentParameter().setValue(processItem.getProperty().getLabel());
      }
    }
  }
  if (propName.contains(EParameterName.PROCESS_TYPE_VERSION.getName())) {
    boolean isJobletComponent=false;
    IJobletProviderService service=null;
    if (PluginChecker.isJobLetPluginLoaded()) {
      service=(IJobletProviderService)GlobalServiceRegister.getDefault().getService(IJobletProviderService.class);
    }
    if (elem instanceof Node) {
      if (service != null) {
        isJobletComponent=service.isJobletComponent((Node)elem);
      }
    }
    if (isJobletComponent) {
      String id=service.getJobletComponentItem((Node)elem).getId();
      String version=(String)newValue;
      IComponent newComponent=service.setPropertyForJobletComponent(id,version);
      reloadNode((Node)elem,newComponent);
    }
 else {
      IElementParameter processIdParam=currentParam.getParentParameter().getChildParameters().get(EParameterName.PROCESS_TYPE_PROCESS.getName());
      ProcessItem processItem=ItemCacheManager.getProcessItem((String)processIdParam.getValue(),(String)newValue);
      if (processItem != null) {
        currentParam.getParentParameter().setValue(processItem.getProperty().getLabel());
      }
    }
  }
  if (propName.contains(EParameterName.PROCESS_TYPE_CONTEXT.getName())) {
    if (elem instanceof Node) {
      Node node=(Node)elem;
      List<IContext> listContext=node.getProcess().getContextManager().getListContext();
      List<String> values=new ArrayList<String>();
      for (      IContext context : listContext) {
        values.add(context.getName());
      }
      currentParam.setListItemsDisplayName(values.toArray(new String[0]));
      currentParam.setListItemsValue(values.toArray(new String[0]));
      currentParam.setValue(newValue);
    }
  }
  if (propName.equals(EParameterName.VALIDATION_RULES.getName())) {
    if (elem instanceof INode) {
      ValidationRulesUtil.createRejectConnector((INode)elem);
      ValidationRulesUtil.updateRejectMetatable((INode)elem,null);
      if (newValue != null && (!(Boolean)newValue)) {
        ValidationRulesUtil.removeRejectConnector((INode)elem);
        ValidationRulesUtil.removeRejectConnection((INode)elem);
      }
    }
  }
  String dbType="String_Node_Str";
  if (newValue instanceof String) {
    dbType=(String)newValue;
  }
  if (propName.equals(EParameterName.DB_TYPE.getName())) {
    IElementParameter elementParameter=elem.getElementParameter(EParameterName.DB_VERSION.getName());
    IElementParameter elementParameter2=elem.getElementParameter(EParameterName.SCHEMA_DB.getName());
    setDbVersion(elementParameter,dbType);
    DesignerUtilities.setSchemaDB(elementParameter2,newValue);
  }
 else   if (propName.equals(JobSettingsConstants.getExtraParameterName(EParameterName.DB_TYPE.getName()))) {
    IElementParameter elementParameter=elem.getElementParameter(JobSettingsConstants.getExtraParameterName(EParameterName.DB_VERSION.getName()));
    IElementParameter elementParameter2=elem.getElementParameter(JobSettingsConstants.getExtraParameterName(EParameterName.SCHEMA_DB.getName()));
    setDbVersion(elementParameter,dbType);
    DesignerUtilities.setSchemaDB(elementParameter2,newValue);
  }
  if (!toUpdate && (currentParam.getFieldType().equals(EParameterFieldType.RADIO) || currentParam.getFieldType().equals(EParameterFieldType.CLOSED_LIST) || currentParam.getFieldType().equals(EParameterFieldType.CHECK)|| currentParam.getFieldType().equals(EParameterFieldType.AS400_CHECK))) {
    toUpdate=false;
    for (int i=0; i < elem.getElementParameters().size(); i++) {
      IElementParameter testedParam=elem.getElementParameters().get(i);
      String showIf=testedParam.getShowIf();
      String notShowIf=testedParam.getNotShowIf();
      if (showIf != null) {
        if (showIf.contains(currentParam.getName())) {
          toUpdate=true;
        }
      }
 else {
        if (notShowIf != null) {
          if (notShowIf.contains(currentParam.getName())) {
            toUpdate=true;
          }
        }
      }
      if (testedParam.getFieldType() == EParameterFieldType.TABLE) {
        String[] tmpShowIfs=testedParam.getListItemsShowIf();
        if (tmpShowIfs != null) {
          for (          String show : tmpShowIfs) {
            if (show != null && show.contains(currentParam.getName())) {
              toUpdate=true;
            }
          }
        }
        tmpShowIfs=testedParam.getListItemsNotShowIf();
        if (tmpShowIfs != null) {
          for (          String show : tmpShowIfs) {
            if (show != null && show.contains(currentParam.getName())) {
              toUpdate=true;
            }
          }
        }
      }
      if (currentParam.getFieldType().equals(EParameterFieldType.CLOSED_LIST)) {
        if (testedParam.getListItemsShowIf() != null) {
          for (int j=0; j < testedParam.getListItemsShowIf().length && !toUpdate; j++) {
            showIf=testedParam.getListItemsShowIf()[j];
            notShowIf=testedParam.getListItemsNotShowIf()[j];
            if (showIf != null) {
              if (showIf.contains(currentParam.getName())) {
                toUpdate=true;
              }
            }
 else {
              if (notShowIf != null) {
                if (notShowIf.contains(currentParam.getName())) {
                  toUpdate=true;
                }
              }
            }
          }
        }
      }
      setDefaultValues(currentParam,testedParam);
    }
  }
  if (currentParam.getName().equals(EParameterName.PROCESS_TYPE_PROCESS.getName())) {
    toUpdate=true;
  }
  if (toUpdate) {
    elem.setPropertyValue(updataComponentParamName,new Boolean(true));
  }
  boolean updateCode=false;
  if (getNewValue() instanceof String && elem instanceof INode) {
    INode curNode=(INode)elem;
    String uniqueName=curNode.getUniqueName();
    IProcess process=curNode.getProcess();
    if (process != null && process instanceof IProcess2) {
      IProcess2 process2=(IProcess2)process;
      List<? extends INode> generatingNodes=null;
      if (process2.isProcessModified()) {
        process2.setProcessModified(false);
        generatingNodes=process2.getGeneratingNodes();
        if (generatingNodes != null) {
          for (          INode genNode : generatingNodes) {
            if (genNode.getUniqueName().equals(uniqueName)) {
              IElementParameter genParam=genNode.getElementParameter(propName);
              if (genParam != null) {
                genParam.setValue(newValue);
                break;
              }
            }
          }
        }
        CodeView.refreshCodeView(elem);
        process2.setProcessModified(true);
        updateCode=true;
      }
    }
  }
  if (elem instanceof IGraphicalNode) {
    ((IGraphicalNode)elem).checkAndRefreshNode();
  }
  if (needUpdateMonitorConnection()) {
    ((Connection)elem).setMonitorConnection((Boolean)currentParam.getValue());
  }
}

Fixed version (ground truth):
@Override public void execute(){
  IElementParameter currentParam=elem.getElementParameter(propName);
  oldElementValues.clear();
  if (currentParam == null) {
    return;
  }
  if (currentParam.isRepositoryValueUsed()) {
    if (currentParam.getFieldType() == EParameterFieldType.MEMO_SQL) {
      Object queryStoreValue=elem.getPropertyValue(EParameterName.QUERYSTORE_TYPE.getName());
      if (!EmfComponent.BUILTIN.equals(queryStoreValue) || !EmfComponent.TNS_FILE.equals(queryStoreValue)) {
        elem.setPropertyValue(EParameterName.QUERYSTORE_TYPE.getName(),EmfComponent.BUILTIN);
      }
      currentParam.setRepositoryValueUsed(false);
    }
 else {
      toUpdate=true;
      String oldValueString=elem.getPropertyValue(propName).toString();
      if (!oldValueString.endsWith("String_Node_Str") && !oldValueString.endsWith("String_Node_Str")) {
        elem.setPropertyValue(propertyTypeName,EmfComponent.BUILTIN);
      }
      for (      IElementParameter param : elem.getElementParameters()) {
        if (param.getCategory().equals(currentParam.getCategory())) {
          param.setRepositoryValueUsed(false);
        }
      }
    }
    repositoryValueWasUsed=true;
  }
 else {
    repositoryValueWasUsed=false;
  }
  oldValue=elem.getPropertyValue(propName);
  elem.setPropertyValue(propName,newValue);
  if (propName.contains(EParameterName.USE_DYNAMIC_JOB.getName()) && newValue.equals(false)) {
    IElementParameter processParam=elem.getElementParameter(EParameterName.PROCESS.getName());
    IElementParameter processTypeParameter=elem.getElementParameter(EParameterName.PROCESS_TYPE_PROCESS.getName());
    final String parentName=processParam.getName() + "String_Node_Str";
    elem.setPropertyValue(parentName + processTypeParameter.getName(),"String_Node_Str");
    elem.setPropertyValue(processParam.getName(),"String_Node_Str");
  }
  if (propName.contains(EParameterName.PROCESS_TYPE_PROCESS.getName())) {
    boolean isSelectUseDynamic=false;
    IElementParameter useDynamicJobParameter=elem.getElementParameter(EParameterName.USE_DYNAMIC_JOB.getName());
    if (useDynamicJobParameter != null && useDynamicJobParameter instanceof IElementParameter) {
      Object useDynamicJobValue=(Object)useDynamicJobParameter.getValue();
      if (useDynamicJobValue != null && useDynamicJobValue instanceof Boolean) {
        isSelectUseDynamic=(Boolean)useDynamicJobValue;
      }
    }
    if (isSelectUseDynamic) {
      StringBuffer labels=new StringBuffer("String_Node_Str");
      if (newValue != null) {
        String[] strValues=newValue.toString().split("String_Node_Str");
        for (int i=0; i < strValues.length; i++) {
          String strValue=strValues[i];
          ProcessItem processItem=ItemCacheManager.getProcessItem((String)strValue);
          if (processItem != null) {
            String label=processItem.getProperty().getLabel();
            if (i > 0) {
              labels.append("String_Node_Str");
            }
            labels.append(label);
          }
        }
      }
      currentParam.getParentParameter().setValue(labels.toString());
    }
 else {
      ProcessItem processItem=ItemCacheManager.getProcessItem((String)newValue);
      if (processItem != null) {
        currentParam.getParentParameter().setValue(processItem.getProperty().getLabel());
      }
    }
  }
  if (propName.contains(EParameterName.PROCESS_TYPE_VERSION.getName())) {
    boolean isJobletComponent=false;
    IJobletProviderService service=null;
    if (PluginChecker.isJobLetPluginLoaded()) {
      service=(IJobletProviderService)GlobalServiceRegister.getDefault().getService(IJobletProviderService.class);
    }
    if (elem instanceof Node) {
      if (service != null) {
        isJobletComponent=service.isJobletComponent((Node)elem);
      }
    }
    if (isJobletComponent) {
      String id=service.getJobletComponentItem((Node)elem).getId();
      String version=(String)newValue;
      IComponent newComponent=service.setPropertyForJobletComponent(id,version);
      reloadNode((Node)elem,newComponent);
    }
 else {
      IElementParameter processIdParam=currentParam.getParentParameter().getChildParameters().get(EParameterName.PROCESS_TYPE_PROCESS.getName());
      ProcessItem processItem=ItemCacheManager.getProcessItem((String)processIdParam.getValue(),(String)newValue);
      if (processItem != null) {
        currentParam.getParentParameter().setValue(processItem.getProperty().getLabel());
      }
    }
  }
  if (propName.contains(EParameterName.PROCESS_TYPE_CONTEXT.getName())) {
    if (elem instanceof Node) {
      Node node=(Node)elem;
      List<IContext> listContext=node.getProcess().getContextManager().getListContext();
      List<String> values=new ArrayList<String>();
      for (      IContext context : listContext) {
        values.add(context.getName());
      }
      currentParam.setListItemsDisplayName(values.toArray(new String[0]));
      currentParam.setListItemsValue(values.toArray(new String[0]));
      currentParam.setValue(newValue);
    }
  }
  if (propName.equals(EParameterName.VALIDATION_RULES.getName())) {
    if (elem instanceof INode) {
      ValidationRulesUtil.createRejectConnector((INode)elem);
      ValidationRulesUtil.updateRejectMetatable((INode)elem,null);
      if (newValue != null && (!(Boolean)newValue)) {
        ValidationRulesUtil.removeRejectConnector((INode)elem);
        ValidationRulesUtil.removeRejectConnection((INode)elem);
      }
    }
  }
  String dbType="String_Node_Str";
  if (newValue instanceof String) {
    dbType=(String)newValue;
  }
  if (propName.equals(EParameterName.DB_TYPE.getName())) {
    IElementParameter elementParameter=elem.getElementParameter(EParameterName.DB_VERSION.getName());
    IElementParameter elementParameter2=elem.getElementParameter(EParameterName.SCHEMA_DB.getName());
    setDbVersion(elementParameter,dbType);
    DesignerUtilities.setSchemaDB(elementParameter2,newValue);
  }
 else   if (propName.equals(JobSettingsConstants.getExtraParameterName(EParameterName.DB_TYPE.getName()))) {
    IElementParameter elementParameter=elem.getElementParameter(JobSettingsConstants.getExtraParameterName(EParameterName.DB_VERSION.getName()));
    IElementParameter elementParameter2=elem.getElementParameter(JobSettingsConstants.getExtraParameterName(EParameterName.SCHEMA_DB.getName()));
    setDbVersion(elementParameter,dbType);
    DesignerUtilities.setSchemaDB(elementParameter2,newValue);
  }
  if (!toUpdate && (currentParam.getFieldType().equals(EParameterFieldType.RADIO) || currentParam.getFieldType().equals(EParameterFieldType.CLOSED_LIST) || currentParam.getFieldType().equals(EParameterFieldType.CHECK)|| currentParam.getFieldType().equals(EParameterFieldType.AS400_CHECK))) {
    toUpdate=false;
    for (int i=0; i < elem.getElementParameters().size(); i++) {
      IElementParameter testedParam=elem.getElementParameters().get(i);
      String showIf=testedParam.getShowIf();
      String notShowIf=testedParam.getNotShowIf();
      if (showIf != null) {
        if (showIf.contains(currentParam.getName())) {
          toUpdate=true;
        }
      }
 else {
        if (notShowIf != null) {
          if (notShowIf.contains(currentParam.getName())) {
            toUpdate=true;
          }
        }
      }
      if (testedParam.getFieldType() == EParameterFieldType.TABLE) {
        String[] tmpShowIfs=testedParam.getListItemsShowIf();
        if (tmpShowIfs != null) {
          for (          String show : tmpShowIfs) {
            if (show != null && show.contains(currentParam.getName())) {
              toUpdate=true;
            }
          }
        }
        tmpShowIfs=testedParam.getListItemsNotShowIf();
        if (tmpShowIfs != null) {
          for (          String show : tmpShowIfs) {
            if (show != null && show.contains(currentParam.getName())) {
              toUpdate=true;
            }
          }
        }
      }
      if (currentParam.getFieldType().equals(EParameterFieldType.CLOSED_LIST)) {
        if (testedParam.getListItemsShowIf() != null) {
          for (int j=0; j < testedParam.getListItemsShowIf().length && !toUpdate; j++) {
            showIf=testedParam.getListItemsShowIf()[j];
            notShowIf=testedParam.getListItemsNotShowIf()[j];
            if (showIf != null) {
              if (showIf.contains(currentParam.getName())) {
                toUpdate=true;
              }
            }
 else {
              if (notShowIf != null) {
                if (notShowIf.contains(currentParam.getName())) {
                  toUpdate=true;
                }
              }
            }
          }
        }
      }
      setDefaultValues(currentParam,testedParam);
    }
  }
  if (currentParam.getName().equals(EParameterName.PROCESS_TYPE_PROCESS.getName())) {
    toUpdate=true;
  }
  if (toUpdate) {
    elem.setPropertyValue(updataComponentParamName,new Boolean(true));
  }
  boolean updateCode=false;
  if (getNewValue() instanceof String && elem instanceof INode) {
    INode curNode=(INode)elem;
    String uniqueName=curNode.getUniqueName();
    IProcess process=curNode.getProcess();
    if (process != null && process instanceof IProcess2) {
      IProcess2 process2=(IProcess2)process;
      List<? extends INode> generatingNodes=null;
      if (process2.isProcessModified()) {
        process2.setProcessModified(false);
        generatingNodes=process2.getGeneratingNodes();
        if (generatingNodes != null) {
          for (          INode genNode : generatingNodes) {
            if (genNode.getUniqueName().equals(uniqueName)) {
              IElementParameter genParam=genNode.getElementParameter(propName);
              if (genParam != null) {
                genParam.setValue(newValue);
                break;
              }
            }
          }
        }
        CodeView.refreshCodeView(elem);
        process2.setProcessModified(true);
        updateCode=true;
      }
    }
  }
  if (elem instanceof IGraphicalNode) {
    ((IGraphicalNode)elem).checkAndRefreshNode();
  }
  if (needUpdateMonitorConnection()) {
    ((Connection)elem).setMonitorConnection((Boolean)currentParam.getValue());
  }
}