Program: 65312
Project: 65312
Buggy source:
public void widgetSelected(SelectionEvent event){
  updateStructureHandle();
  OdaDataSetParameterHandle dataSetParameterHandle=(OdaDataSetParameterHandle)structureHandle;
  String originalParamName=dataSetParameterHandle.getParamName();
  ParameterDialog dialog=null;
  ParameterHandle handle=ParameterPageUtil.getScalarParameter(linkToSalarParameter.getText(),false);
  boolean isCreateMode=true;
  if (handle == null) {
    handle=(ScalarParameterHandle)ElementProcessorFactory.createProcessor("String_Node_Str").createElement(null);
    dialog=new ParameterDialog(ParameterInputDialog.this.getParentShell(),Messages.getString("String_Node_Str"),false);
    if (dataSetParameterHandle != null) {
      executeLinkedReportParameterUpdate(handle,dataSetParameterHandle);
    }
    isCreateMode=true;
  }
 else {
    dialog=new ParameterDialog(ParameterInputDialog.this.getParentShell(),Messages.getString("String_Node_Str"),false);
    isCreateMode=false;
  }
  handle.addListener(new ScalarParameterListener());
  dialog.setInput(handle);
  if (dialog.open() == OK) {
    if (dialog.getResult() instanceof ParameterHandle) {
      ParameterHandle paramerHandle=(ParameterHandle)dialog.getResult();
      if (isCreateMode) {
        SlotHandle parameterSlotHandle=Utility.getReportModuleHandle().getParameters();
        try {
          parameterSlotHandle.add(paramerHandle);
          linkToSalarParameter.add(paramerHandle.getQualifiedName());
        }
 catch (        ContentException e) {
          ExceptionHandler.handle(e);
        }
catch (        NameException e) {
          ExceptionHandler.handle(e);
        }
      }
      linkToSalarParameter.setItems(ParameterPageUtil.getLinkedReportParameterNames((OdaDataSetParameterHandle)structureHandle));
      originalLinkToParamName=paramerHandle.getQualifiedName();
      linkToSalarParameter.select(Utility.findIndex(linkToSalarParameter.getItems(),paramerHandle.getQualifiedName()));
    }
  }
 else {
    dataSetParameterHandle.setParamName(originalParamName);
  }
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent event){
  updateStructureHandle();
  OdaDataSetParameterHandle dataSetParameterHandle=(OdaDataSetParameterHandle)structureHandle;
  String originalParamName=dataSetParameterHandle.getParamName();
  ParameterDialog dialog=null;
  ParameterHandle handle=ParameterPageUtil.getScalarParameter(linkToSalarParameter.getText(),false);
  boolean isCreateMode=true;
  if (handle == null) {
    handle=(ScalarParameterHandle)ElementProcessorFactory.createProcessor("String_Node_Str").createElement(null);
    dialog=new ParameterDialog(ParameterInputDialog.this.getParentShell(),Messages.getString("String_Node_Str"),false);
    if (dataSetParameterHandle != null) {
      executeLinkedReportParameterUpdate(handle,dataSetParameterHandle);
    }
    isCreateMode=true;
  }
 else {
    dialog=new ParameterDialog(ParameterInputDialog.this.getParentShell(),Messages.getString("String_Node_Str"),false);
    isCreateMode=false;
  }
  ScalarParameterListener scalarParameterListener=new ScalarParameterListener();
  handle.addListener(scalarParameterListener);
  dialog.setInput(handle);
  if (dialog.open() == OK) {
    if (dialog.getResult() instanceof ParameterHandle) {
      ParameterHandle paramerHandle=(ParameterHandle)dialog.getResult();
      if (isCreateMode) {
        SlotHandle parameterSlotHandle=Utility.getReportModuleHandle().getParameters();
        try {
          parameterSlotHandle.add(paramerHandle);
          linkToSalarParameter.add(paramerHandle.getQualifiedName());
        }
 catch (        ContentException e) {
          ExceptionHandler.handle(e);
        }
catch (        NameException e) {
          ExceptionHandler.handle(e);
        }
      }
      linkToSalarParameter.setItems(ParameterPageUtil.getLinkedReportParameterNames((OdaDataSetParameterHandle)structureHandle));
      originalLinkToParamName=paramerHandle.getQualifiedName();
      linkToSalarParameter.select(Utility.findIndex(linkToSalarParameter.getItems(),paramerHandle.getQualifiedName()));
    }
  }
 else {
    dataSetParameterHandle.setParamName(originalParamName);
  }
  handle.removeListener(scalarParameterListener);
}