Program: 67004
Project: 67004
Buggy source:
private void createComboCellParameter(Composite parent,String label){
  ControlProvider.createLabel(parent,label);
  reportParamComposite=ControlProvider.getDefaultComposite(parent);
  linkToSalarParameter=new Combo(reportParamComposite,SWT.READ_ONLY);
  linkToSalarParameter.setLayoutData(ControlProvider.getGridDataWithHSpan(1));
  linkToSalarParameter.setItems(ParameterPageUtil.getLinkedReportParameterNames((OdaDataSetParameterHandle)structureHandle));
  linkToSalarParameter.setVisibleItemCount(30);
  linkToSalarParameter.select(Utility.findIndex(linkToSalarParameter.getItems(),((OdaDataSetParameterHandle)structureHandle).getParamName()));
  linkToSalarParameter.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      linkToSalarParameterChanged();
      if (linkToSalarParameter.isEnabled()) {
        validateSyntax();
      }
    }
  }
);
  SelectionAdapter listener=new SelectionAdapter(){
    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) {
          ReportParameterAdapter adapter=new ReportParameterAdapter();
          try {
            adapter.updateLinkedReportParameter((ScalarParameterHandle)handle,dataSetParameterHandle,((DataSetEditor)getContainer()).getCurrentDataSetDesign());
          }
 catch (          SemanticException e) {
          }
catch (          OdaException e) {
          }
        }
        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));
          linkToSalarParameter.select(Utility.findIndex(linkToSalarParameter.getItems(),paramerHandle.getQualifiedName()));
        }
      }
 else {
        dataSetParameterHandle.setParamName(originalParamName);
      }
    }
  }
;
  parameterButton=new Button(reportParamComposite,SWT.PUSH);
  parameterButton.setImage(ReportPlatformUIImages.getImage(IReportGraphicConstants.ICON_ELEMENT_PARAMETER));
  parameterButton.addSelectionListener(listener);
  checkParameterButtonTooltip();
}

Fixed version (ground truth):
private void createComboCellParameter(Composite parent,String label){
  ControlProvider.createLabel(parent,label);
  reportParamComposite=ControlProvider.getDefaultComposite(parent);
  linkToSalarParameter=new Combo(reportParamComposite,SWT.READ_ONLY);
  linkToSalarParameter.setLayoutData(ControlProvider.getGridDataWithHSpan(1));
  linkToSalarParameter.setItems(ParameterPageUtil.getLinkedReportParameterNames((OdaDataSetParameterHandle)structureHandle));
  linkToSalarParameter.setVisibleItemCount(30);
  linkToSalarParameter.select(Utility.findIndex(linkToSalarParameter.getItems(),((OdaDataSetParameterHandle)structureHandle).getParamName()));
  linkToSalarParameter.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      linkToSalarParameterChanged();
      if (linkToSalarParameter.isEnabled()) {
        validateSyntax();
      }
    }
  }
);
  SelectionAdapter listener=new SelectionAdapter(){
    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) {
          ReportParameterAdapter adapter=new ReportParameterAdapter();
          try {
            adapter.updateLinkedReportParameter((ScalarParameterHandle)handle,dataSetParameterHandle,((DataSetEditor)getContainer()).getCurrentDataSetDesign());
          }
 catch (          SemanticException e) {
          }
catch (          OdaException e) {
          }
        }
        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));
          linkToSalarParameter.select(Utility.findIndex(linkToSalarParameter.getItems(),paramerHandle.getQualifiedName()));
        }
      }
 else {
        dataSetParameterHandle.setParamName(originalParamName);
      }
    }
  }
;
  parameterButton=new Button(reportParamComposite,SWT.PUSH);
  parameterButton.setImage(ReportPlatformUIImages.getImage(IReportGraphicConstants.ICON_ELEMENT_PARAMETER));
  parameterButton.addSelectionListener(listener);
  checkParameterButtonTooltip();
  bindedReportParameterName=linkToSalarParameter.getText();
}