Program: 121543
Project: 121543
Buggy source:
public void addMainParameters(final List<ElementParameter> listParam,INode node){
  if (compType == null) {
    isLoaded=false;
    try {
      load();
    }
 catch (    BusinessException e) {
      ExceptionHandler.process(e);
    }
  }
  ElementParameter param;
  param=new ElementParameter(node);
  param.setName(EParameterName.UNIQUE_NAME.getName());
  param.setValue("String_Node_Str");
  param.setDisplayName(EParameterName.UNIQUE_NAME.getDisplayName());
  param.setFieldType(EParameterFieldType.TEXT);
  param.setCategory(EComponentCategory.ADVANCED);
  param.setNumRow(1);
  param.setReadOnly(true);
  param.setShow(false);
  listParam.add(param);
  param=new ElementParameter(node);
  param.setName(EParameterName.COMPONENT_NAME.getName());
  param.setValue(getName());
  param.setDisplayName(EParameterName.COMPONENT_NAME.getDisplayName());
  param.setFieldType(EParameterFieldType.TEXT);
  param.setCategory(EComponentCategory.ADVANCED);
  param.setNumRow(1);
  param.setReadOnly(true);
  param.setShow(false);
  listParam.add(param);
  param=new ElementParameter(node);
  param.setName(EParameterName.VERSION.getName());
  param.setValue(compType.getHEADER().getVERSION() + "String_Node_Str" + compType.getHEADER().getSTATUS()+ "String_Node_Str");
  param.setDisplayName(EParameterName.VERSION.getDisplayName());
  param.setFieldType(EParameterFieldType.TEXT);
  param.setCategory(EComponentCategory.ADVANCED);
  param.setNumRow(2);
  param.setReadOnly(true);
  param.setRequired(false);
  param.setShow(false);
  listParam.add(param);
  param=new ElementParameter(node);
  param.setName(EParameterName.FAMILY.getName());
  param.setValue(getOriginalFamilyName());
  param.setDisplayName(EParameterName.FAMILY.getDisplayName());
  param.setFieldType(EParameterFieldType.TEXT);
  param.setCategory(EComponentCategory.ADVANCED);
  param.setNumRow(3);
  param.setReadOnly(true);
  param.setRequired(false);
  param.setShow(false);
  listParam.add(param);
  if (canStart()) {
    param=new ElementParameter(node);
    param.setName(EParameterName.START.getName());
    param.setValue(new Boolean(false));
    param.setDisplayName(EParameterName.START.getDisplayName());
    param.setFieldType(EParameterFieldType.CHECK);
    param.setCategory(EComponentCategory.ADVANCED);
    param.setNumRow(5);
    param.setReadOnly(true);
    param.setRequired(false);
    param.setShow(false);
    listParam.add(param);
  }
  param=new ElementParameter(node);
  param.setName(EParameterName.STARTABLE.getName());
  param.setValue(new Boolean(canStart()));
  param.setDisplayName(EParameterName.STARTABLE.getDisplayName());
  param.setFieldType(EParameterFieldType.CHECK);
  param.setCategory(EComponentCategory.ADVANCED);
  param.setNumRow(5);
  param.setReadOnly(true);
  param.setRequired(false);
  param.setShow(false);
  listParam.add(param);
  param=new ElementParameter(node);
  param.setName(EParameterName.SUBTREE_START.getName());
  param.setValue(new Boolean(canStart()));
  param.setDisplayName(EParameterName.SUBTREE_START.getDisplayName());
  param.setFieldType(EParameterFieldType.CHECK);
  param.setCategory(EComponentCategory.TECHNICAL);
  param.setNumRow(5);
  param.setReadOnly(true);
  param.setRequired(false);
  param.setShow(false);
  listParam.add(param);
  param=new ElementParameter(node);
  param.setName(EParameterName.ACTIVATE.getName());
  param.setValue(new Boolean(true));
  param.setDisplayName(EParameterName.ACTIVATE.getDisplayName());
  param.setFieldType(EParameterFieldType.CHECK);
  param.setCategory(EComponentCategory.TECHNICAL);
  param.setNumRow(5);
  param.setReadOnly(false);
  param.setRequired(false);
  param.setShow(true);
  listParam.add(param);
  param=new ElementParameter(node);
  param.setName(EParameterName.DUMMY.getName());
  param.setValue(Boolean.FALSE);
  param.setDisplayName(EParameterName.DUMMY.getDisplayName());
  param.setFieldType(EParameterFieldType.CHECK);
  param.setCategory(EComponentCategory.ADVANCED);
  param.setNumRow(5);
  param.setReadOnly(false);
  param.setRequired(false);
  param.setShow(false);
  listParam.add(param);
  boolean isCamel=false;
  if (GlobalServiceRegister.getDefault().isServiceRegistered(ICamelDesignerCoreService.class)) {
    ICamelDesignerCoreService service=(ICamelDesignerCoreService)GlobalServiceRegister.getDefault().getService(ICamelDesignerCoreService.class);
    if (node.getProcess() != null && node.getProcess() instanceof IProcess2) {
      isCamel=service.isInstanceofCamel(((IProcess2)node.getProcess()).getProperty().getItem());
    }
  }
  if (!isCamel) {
    boolean isStatCatcherComponent=false;
    if (this.name != null && this.name.equals(TSTATCATCHER_NAME)) {
      isStatCatcherComponent=true;
    }
    if (!isStatCatcherComponent) {
      boolean tStatCatcherAvailable=ComponentsFactoryProvider.getInstance().get(TSTATCATCHER_NAME,ComponentCategory.CATEGORY_4_DI.getName()) != null;
      param=new ElementParameter(node);
      param.setName(EParameterName.TSTATCATCHER_STATS.getName());
      param.setValue(new Boolean(compType.getHEADER().isTSTATCATCHERSTATS()));
      param.setDisplayName(EParameterName.TSTATCATCHER_STATS.getDisplayName());
      param.setFieldType(EParameterFieldType.CHECK);
      param.setCategory(EComponentCategory.ADVANCED);
      param.setNumRow(99);
      param.setReadOnly(false);
      param.setRequired(false);
      param.setShow(tStatCatcherAvailable);
      listParam.add(param);
    }
  }
  param=new ElementParameter(node);
  param.setName(EParameterName.HELP.getName());
  param.setValue(getTranslatedValue(PROP_HELP));
  param.setDisplayName(EParameterName.HELP.getDisplayName());
  param.setFieldType(EParameterFieldType.TEXT);
  param.setCategory(EComponentCategory.ADVANCED);
  param.setNumRow(6);
  param.setReadOnly(true);
  param.setRequired(false);
  param.setShow(false);
  listParam.add(param);
  param=new ElementParameter(node);
  param.setName(EParameterName.UPDATE_COMPONENTS.getName());
  param.setValue(new Boolean(false));
  param.setDisplayName(EParameterName.UPDATE_COMPONENTS.getDisplayName());
  param.setFieldType(EParameterFieldType.CHECK);
  param.setCategory(EComponentCategory.ADVANCED);
  param.setNumRow(5);
  param.setReadOnly(true);
  param.setRequired(false);
  param.setShow(false);
  listParam.add(param);
  param=new ElementParameter(node);
  param.setName(EParameterName.CURRENT_OS.getName());
  param.setValue(EnvironmentUtils.getEnvOs());
  param.setDisplayName(EParameterName.CURRENT_OS.getDisplayName());
  param.setFieldType(EParameterFieldType.TEXT);
  param.setCategory(EComponentCategory.ADVANCED);
  param.setNumRow(1);
  param.setReadOnly(true);
  param.setShow(false);
  listParam.add(param);
  param=new ElementParameter(node);
  param.setName(EParameterName.IREPORT_PATH.getName());
  param.setCategory(EComponentCategory.ADVANCED);
  param.setFieldType(EParameterFieldType.DIRECTORY);
  param.setDisplayName(EParameterName.IREPORT_PATH.getDisplayName());
  param.setNumRow(99);
  param.setShow(false);
  param.setValue(CorePlugin.getDefault().getPluginPreferences().getString(ITalendCorePrefConstants.IREPORT_PATH));
  param.setReadOnly(true);
  listParam.add(param);
  param=new ElementParameter(node);
  param.setName(EParameterName.JAVA_LIBRARY_PATH.getName());
  param.setCategory(EComponentCategory.ADVANCED);
  param.setFieldType(EParameterFieldType.DIRECTORY);
  param.setDisplayName(EParameterName.JAVA_LIBRARY_PATH.getDisplayName());
  param.setNumRow(99);
  param.setShow(false);
  param.setValue(LibrariesManagerUtils.getLibrariesPath(ECodeLanguage.JAVA));
  param.setReadOnly(true);
  listParam.add(param);
  param=new ElementParameter(node);
  param.setName(EParameterName.SUBJOB_COLOR.getName());
  param.setValue(compType.getHEADER().getSUBJOBCOLOR());
  param.setDisplayName(EParameterName.SUBJOB_COLOR.getDisplayName());
  param.setFieldType(EParameterFieldType.TEXT);
  param.setCategory(EComponentCategory.ADVANCED);
  param.setNumRow(99);
  param.setReadOnly(true);
  param.setShow(false);
  listParam.add(param);
  param=new ElementParameter(node);
  param.setName(EParameterName.SUBJOB_TITLE_COLOR.getName());
  param.setValue(compType.getHEADER().getSUBJOBTITLECOLOR());
  param.setDisplayName(EParameterName.SUBJOB_TITLE_COLOR.getDisplayName());
  param.setFieldType(EParameterFieldType.TEXT);
  param.setCategory(EComponentCategory.ADVANCED);
  param.setNumRow(99);
  param.setReadOnly(true);
  param.setShow(false);
  listParam.add(param);
  if (PluginChecker.isTeamEdition() && !"String_Node_Str".equals(getPaletteType())) {
    boolean defaultParalelize=new Boolean(compType.getHEADER().isPARALLELIZE());
    param=new ElementParameter(node);
    param.setReadOnly(!defaultParalelize);
    param.setName(EParameterName.PARALLELIZE.getName());
    param.setValue(Boolean.FALSE);
    param.setDisplayName(EParameterName.PARALLELIZE.getDisplayName());
    param.setFieldType(EParameterFieldType.CHECK);
    param.setCategory(EComponentCategory.ADVANCED);
    param.setNumRow(100);
    param.setShow(true);
    listParam.add(param);
    param=new ElementParameter(node);
    param.setReadOnly(!defaultParalelize);
    param.setName(EParameterName.PARALLELIZE_NUMBER.getName());
    param.setValue(compType.getHEADER().getNUMBERPARALLELIZE());
    param.setDisplayName(EParameterName.PARALLELIZE_NUMBER.getDisplayName());
    param.setFieldType(EParameterFieldType.TEXT);
    param.setCategory(EComponentCategory.ADVANCED);
    param.setNumRow(100);
    param.setShowIf(EParameterName.PARALLELIZE.getName() + "String_Node_Str");
    listParam.add(param);
    param=new ElementParameter(node);
    param.setReadOnly(!defaultParalelize);
    param.setName(EParameterName.PARALLELIZE_KEEP_EMPTY.getName());
    param.setValue(Boolean.FALSE);
    param.setDisplayName(EParameterName.PARALLELIZE_KEEP_EMPTY.getDisplayName());
    param.setFieldType(EParameterFieldType.CHECK);
    param.setCategory(EComponentCategory.ADVANCED);
    param.setNumRow(100);
    param.setShow(false);
    listParam.add(param);
  }
}

Fixed version (ground truth):
public void addMainParameters(final List<ElementParameter> listParam,INode node){
  if (compType == null) {
    isLoaded=false;
    try {
      load();
    }
 catch (    BusinessException e) {
      ExceptionHandler.process(e);
    }
  }
  ElementParameter param;
  param=new ElementParameter(node);
  param.setName(EParameterName.UNIQUE_NAME.getName());
  param.setValue("String_Node_Str");
  param.setDisplayName(EParameterName.UNIQUE_NAME.getDisplayName());
  param.setFieldType(EParameterFieldType.TEXT);
  param.setCategory(EComponentCategory.ADVANCED);
  param.setNumRow(1);
  param.setReadOnly(true);
  param.setShow(false);
  listParam.add(param);
  param=new ElementParameter(node);
  param.setName(EParameterName.COMPONENT_NAME.getName());
  param.setValue(getName());
  param.setDisplayName(EParameterName.COMPONENT_NAME.getDisplayName());
  param.setFieldType(EParameterFieldType.TEXT);
  param.setCategory(EComponentCategory.ADVANCED);
  param.setNumRow(1);
  param.setReadOnly(true);
  param.setShow(false);
  listParam.add(param);
  param=new ElementParameter(node);
  param.setName(EParameterName.VERSION.getName());
  param.setValue(compType.getHEADER().getVERSION() + "String_Node_Str" + compType.getHEADER().getSTATUS()+ "String_Node_Str");
  param.setDisplayName(EParameterName.VERSION.getDisplayName());
  param.setFieldType(EParameterFieldType.TEXT);
  param.setCategory(EComponentCategory.ADVANCED);
  param.setNumRow(2);
  param.setReadOnly(true);
  param.setRequired(false);
  param.setShow(false);
  listParam.add(param);
  param=new ElementParameter(node);
  param.setName(EParameterName.FAMILY.getName());
  param.setValue(getOriginalFamilyName());
  param.setDisplayName(EParameterName.FAMILY.getDisplayName());
  param.setFieldType(EParameterFieldType.TEXT);
  param.setCategory(EComponentCategory.ADVANCED);
  param.setNumRow(3);
  param.setReadOnly(true);
  param.setRequired(false);
  param.setShow(false);
  listParam.add(param);
  if (canStart()) {
    param=new ElementParameter(node);
    param.setName(EParameterName.START.getName());
    param.setValue(new Boolean(false));
    param.setDisplayName(EParameterName.START.getDisplayName());
    param.setFieldType(EParameterFieldType.CHECK);
    param.setCategory(EComponentCategory.ADVANCED);
    param.setNumRow(5);
    param.setReadOnly(true);
    param.setRequired(false);
    param.setShow(false);
    listParam.add(param);
  }
  param=new ElementParameter(node);
  param.setName(EParameterName.STARTABLE.getName());
  param.setValue(new Boolean(canStart()));
  param.setDisplayName(EParameterName.STARTABLE.getDisplayName());
  param.setFieldType(EParameterFieldType.CHECK);
  param.setCategory(EComponentCategory.ADVANCED);
  param.setNumRow(5);
  param.setReadOnly(true);
  param.setRequired(false);
  param.setShow(false);
  listParam.add(param);
  param=new ElementParameter(node);
  param.setName(EParameterName.SUBTREE_START.getName());
  param.setValue(new Boolean(canStart()));
  param.setDisplayName(EParameterName.SUBTREE_START.getDisplayName());
  param.setFieldType(EParameterFieldType.CHECK);
  param.setCategory(EComponentCategory.TECHNICAL);
  param.setNumRow(5);
  param.setReadOnly(true);
  param.setRequired(false);
  param.setShow(false);
  listParam.add(param);
  param=new ElementParameter(node);
  param.setName(EParameterName.END_OF_FLOW.getName());
  param.setValue(new Boolean(canStart()));
  param.setDisplayName(EParameterName.END_OF_FLOW.getDisplayName());
  param.setFieldType(EParameterFieldType.CHECK);
  param.setCategory(EComponentCategory.TECHNICAL);
  param.setNumRow(5);
  param.setReadOnly(true);
  param.setRequired(false);
  param.setShow(false);
  listParam.add(param);
  param=new ElementParameter(node);
  param.setName(EParameterName.ACTIVATE.getName());
  param.setValue(new Boolean(true));
  param.setDisplayName(EParameterName.ACTIVATE.getDisplayName());
  param.setFieldType(EParameterFieldType.CHECK);
  param.setCategory(EComponentCategory.TECHNICAL);
  param.setNumRow(5);
  param.setReadOnly(false);
  param.setRequired(false);
  param.setShow(true);
  listParam.add(param);
  param=new ElementParameter(node);
  param.setName(EParameterName.DUMMY.getName());
  param.setValue(Boolean.FALSE);
  param.setDisplayName(EParameterName.DUMMY.getDisplayName());
  param.setFieldType(EParameterFieldType.CHECK);
  param.setCategory(EComponentCategory.ADVANCED);
  param.setNumRow(5);
  param.setReadOnly(false);
  param.setRequired(false);
  param.setShow(false);
  listParam.add(param);
  boolean isCamel=false;
  if (GlobalServiceRegister.getDefault().isServiceRegistered(ICamelDesignerCoreService.class)) {
    ICamelDesignerCoreService service=(ICamelDesignerCoreService)GlobalServiceRegister.getDefault().getService(ICamelDesignerCoreService.class);
    if (node.getProcess() != null && node.getProcess() instanceof IProcess2) {
      isCamel=service.isInstanceofCamel(((IProcess2)node.getProcess()).getProperty().getItem());
    }
  }
  if (!isCamel) {
    boolean isStatCatcherComponent=false;
    if (this.name != null && this.name.equals(TSTATCATCHER_NAME)) {
      isStatCatcherComponent=true;
    }
    if (!isStatCatcherComponent) {
      boolean tStatCatcherAvailable=ComponentsFactoryProvider.getInstance().get(TSTATCATCHER_NAME,ComponentCategory.CATEGORY_4_DI.getName()) != null;
      param=new ElementParameter(node);
      param.setName(EParameterName.TSTATCATCHER_STATS.getName());
      param.setValue(new Boolean(compType.getHEADER().isTSTATCATCHERSTATS()));
      param.setDisplayName(EParameterName.TSTATCATCHER_STATS.getDisplayName());
      param.setFieldType(EParameterFieldType.CHECK);
      param.setCategory(EComponentCategory.ADVANCED);
      param.setNumRow(99);
      param.setReadOnly(false);
      param.setRequired(false);
      param.setShow(tStatCatcherAvailable);
      listParam.add(param);
    }
  }
  param=new ElementParameter(node);
  param.setName(EParameterName.HELP.getName());
  param.setValue(getTranslatedValue(PROP_HELP));
  param.setDisplayName(EParameterName.HELP.getDisplayName());
  param.setFieldType(EParameterFieldType.TEXT);
  param.setCategory(EComponentCategory.ADVANCED);
  param.setNumRow(6);
  param.setReadOnly(true);
  param.setRequired(false);
  param.setShow(false);
  listParam.add(param);
  param=new ElementParameter(node);
  param.setName(EParameterName.UPDATE_COMPONENTS.getName());
  param.setValue(new Boolean(false));
  param.setDisplayName(EParameterName.UPDATE_COMPONENTS.getDisplayName());
  param.setFieldType(EParameterFieldType.CHECK);
  param.setCategory(EComponentCategory.ADVANCED);
  param.setNumRow(5);
  param.setReadOnly(true);
  param.setRequired(false);
  param.setShow(false);
  listParam.add(param);
  param=new ElementParameter(node);
  param.setName(EParameterName.CURRENT_OS.getName());
  param.setValue(EnvironmentUtils.getEnvOs());
  param.setDisplayName(EParameterName.CURRENT_OS.getDisplayName());
  param.setFieldType(EParameterFieldType.TEXT);
  param.setCategory(EComponentCategory.ADVANCED);
  param.setNumRow(1);
  param.setReadOnly(true);
  param.setShow(false);
  listParam.add(param);
  param=new ElementParameter(node);
  param.setName(EParameterName.IREPORT_PATH.getName());
  param.setCategory(EComponentCategory.ADVANCED);
  param.setFieldType(EParameterFieldType.DIRECTORY);
  param.setDisplayName(EParameterName.IREPORT_PATH.getDisplayName());
  param.setNumRow(99);
  param.setShow(false);
  param.setValue(CorePlugin.getDefault().getPluginPreferences().getString(ITalendCorePrefConstants.IREPORT_PATH));
  param.setReadOnly(true);
  listParam.add(param);
  param=new ElementParameter(node);
  param.setName(EParameterName.JAVA_LIBRARY_PATH.getName());
  param.setCategory(EComponentCategory.ADVANCED);
  param.setFieldType(EParameterFieldType.DIRECTORY);
  param.setDisplayName(EParameterName.JAVA_LIBRARY_PATH.getDisplayName());
  param.setNumRow(99);
  param.setShow(false);
  param.setValue(LibrariesManagerUtils.getLibrariesPath(ECodeLanguage.JAVA));
  param.setReadOnly(true);
  listParam.add(param);
  param=new ElementParameter(node);
  param.setName(EParameterName.SUBJOB_COLOR.getName());
  param.setValue(compType.getHEADER().getSUBJOBCOLOR());
  param.setDisplayName(EParameterName.SUBJOB_COLOR.getDisplayName());
  param.setFieldType(EParameterFieldType.TEXT);
  param.setCategory(EComponentCategory.ADVANCED);
  param.setNumRow(99);
  param.setReadOnly(true);
  param.setShow(false);
  listParam.add(param);
  param=new ElementParameter(node);
  param.setName(EParameterName.SUBJOB_TITLE_COLOR.getName());
  param.setValue(compType.getHEADER().getSUBJOBTITLECOLOR());
  param.setDisplayName(EParameterName.SUBJOB_TITLE_COLOR.getDisplayName());
  param.setFieldType(EParameterFieldType.TEXT);
  param.setCategory(EComponentCategory.ADVANCED);
  param.setNumRow(99);
  param.setReadOnly(true);
  param.setShow(false);
  listParam.add(param);
  if (PluginChecker.isTeamEdition() && !"String_Node_Str".equals(getPaletteType())) {
    boolean defaultParalelize=new Boolean(compType.getHEADER().isPARALLELIZE());
    param=new ElementParameter(node);
    param.setReadOnly(!defaultParalelize);
    param.setName(EParameterName.PARALLELIZE.getName());
    param.setValue(Boolean.FALSE);
    param.setDisplayName(EParameterName.PARALLELIZE.getDisplayName());
    param.setFieldType(EParameterFieldType.CHECK);
    param.setCategory(EComponentCategory.ADVANCED);
    param.setNumRow(100);
    param.setShow(true);
    listParam.add(param);
    param=new ElementParameter(node);
    param.setReadOnly(!defaultParalelize);
    param.setName(EParameterName.PARALLELIZE_NUMBER.getName());
    param.setValue(compType.getHEADER().getNUMBERPARALLELIZE());
    param.setDisplayName(EParameterName.PARALLELIZE_NUMBER.getDisplayName());
    param.setFieldType(EParameterFieldType.TEXT);
    param.setCategory(EComponentCategory.ADVANCED);
    param.setNumRow(100);
    param.setShowIf(EParameterName.PARALLELIZE.getName() + "String_Node_Str");
    listParam.add(param);
    param=new ElementParameter(node);
    param.setReadOnly(!defaultParalelize);
    param.setName(EParameterName.PARALLELIZE_KEEP_EMPTY.getName());
    param.setValue(Boolean.FALSE);
    param.setDisplayName(EParameterName.PARALLELIZE_KEEP_EMPTY.getDisplayName());
    param.setFieldType(EParameterFieldType.CHECK);
    param.setCategory(EComponentCategory.ADVANCED);
    param.setNumRow(100);
    param.setShow(false);
    listParam.add(param);
  }
}