Program: 78936
Project: 78936
Buggy source:
public void run(){
  try {
    FileDialog dialog=new FileDialog(UIUtil.getDefaultShell(),SWT.OPEN);
    dialog.setFilterExtensions(new String[]{"String_Node_Str"});
    String filename;
    pref=ReportPlugin.getDefault().getPreferenceStore().getInt(PREF_KEY);
    filename=dialog.open();
    if (filename != null) {
      if (pref == PREF_PROMPT) {
        MessageDialog prefDialog=new MessageDialog(dialog.getParent(),DIALOG_TITLE,null,DIALOG_MESSAGE,MessageDialog.INFORMATION,new String[]{BUTTON_YES,BUTTON_NO,BUTTON_CANCEL},0){
          protected Control createCustomArea(          Composite parent){
            Composite container=new Composite(parent,SWT.NONE);
            GridLayout gridLayout=new GridLayout();
            gridLayout.marginWidth=20;
            gridLayout.marginTop=15;
            container.setLayout(gridLayout);
            Button chkbox=new Button(container,SWT.CHECK);
            chkbox.setText(REMEMBER_DECISION);
            chkbox.addSelectionListener(new SelectionListener(){
              public void widgetSelected(              SelectionEvent e){
                saveDecision=!saveDecision;
              }
              public void widgetDefaultSelected(              SelectionEvent e){
                saveDecision=false;
              }
            }
);
            return super.createCustomArea(parent);
          }
          protected void buttonPressed(          int buttonId){
switch (buttonId) {
case 0:
              pref=PREF_OVERWRITE;
            break;
case 1:
          pref=PREF_NOT_OVERWRITE;
        break;
default :
      break;
  }
  if (saveDecision) {
    ReportPlugin.getDefault().getPreferenceStore().setValue(PREF_KEY,pref);
  }
  super.buttonPressed(buttonId);
}
}
;
if (prefDialog.open() == 2) return;
}
ElementExportUtil.exportElement((DesignElementHandle)getSelection(),filename,pref == PREF_OVERWRITE);
}
}
 catch (Exception e) {
ExceptionHandler.handle(e);
}
}

Fixed version (ground truth):
public void run(){
  try {
    FileDialog dialog;
    if (getSelection() instanceof ReportDesignHandle)     dialog=new FileDialog(UIUtil.getDefaultShell(),SWT.SAVE);
 else     dialog=new FileDialog(UIUtil.getDefaultShell(),SWT.OPEN);
    dialog.setFilterExtensions(new String[]{"String_Node_Str"});
    String filename;
    pref=ReportPlugin.getDefault().getPreferenceStore().getInt(PREF_KEY);
    filename=dialog.open();
    if (filename != null) {
      if (getSelection() instanceof ReportDesignHandle)       ElementExportUtil.exportDesign((ReportDesignHandle)getSelection(),filename);
 else {
        if (pref == PREF_PROMPT) {
          MessageDialog prefDialog=new MessageDialog(dialog.getParent(),DIALOG_TITLE,null,DIALOG_MESSAGE,MessageDialog.INFORMATION,new String[]{BUTTON_YES,BUTTON_NO,BUTTON_CANCEL},0){
            protected Control createCustomArea(            Composite parent){
              Composite container=new Composite(parent,SWT.NONE);
              GridLayout gridLayout=new GridLayout();
              gridLayout.marginWidth=20;
              gridLayout.marginTop=15;
              container.setLayout(gridLayout);
              Button chkbox=new Button(container,SWT.CHECK);
              chkbox.setText(REMEMBER_DECISION);
              chkbox.addSelectionListener(new SelectionListener(){
                public void widgetSelected(                SelectionEvent e){
                  saveDecision=!saveDecision;
                }
                public void widgetDefaultSelected(                SelectionEvent e){
                  saveDecision=false;
                }
              }
);
              return super.createCustomArea(parent);
            }
            protected void buttonPressed(            int buttonId){
switch (buttonId) {
case 0:
                pref=PREF_OVERWRITE;
              break;
case 1:
            pref=PREF_NOT_OVERWRITE;
          break;
default :
        break;
    }
    if (saveDecision) {
      ReportPlugin.getDefault().getPreferenceStore().setValue(PREF_KEY,pref);
    }
    super.buttonPressed(buttonId);
  }
}
;
if (prefDialog.open() == 2) return;
}
ElementExportUtil.exportElement((DesignElementHandle)getSelection(),filename,pref == PREF_OVERWRITE);
}
}
}
 catch (Exception e) {
ExceptionHandler.handle(e);
}
}