Program: 78852
Project: 78852
Buggy source:
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=dialog.open();
    if (filename == null) {
      return;
    }
    pref=ReportPlugin.getDefault().getPreferenceStore().getInt(PREF_KEY);
    if (!filename.endsWith("String_Node_Str")) {
      filename+="String_Node_Str";
    }
    if (filename != null) {
      if (pref == PREF_PROMPT && new File(filename).exists()) {
        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;
            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;
}
if (getSelection() instanceof ReportDesignHandle) {
ElementExportUtil.exportDesign((ReportDesignHandle)getSelection(),filename);
}
 else {
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=dialog.open();
    if (filename == null) {
      return;
    }
    pref=ReportPlugin.getDefault().getPreferenceStore().getInt(PREF_KEY);
    if (!filename.endsWith("String_Node_Str")) {
      filename+="String_Node_Str";
    }
    if (filename != null) {
      if (pref == PREF_PROMPT && new File(filename).exists()) {
        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;
            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;
}
if (getSelection() instanceof ReportDesignHandle) {
ElementExportUtil.exportDesign((ReportDesignHandle)getSelection(),filename,false);
}
 else {
ElementExportUtil.exportElement((DesignElementHandle)getSelection(),filename,pref == PREF_OVERWRITE);
}
}
}
 catch (Exception e) {
ExceptionHandler.handle(e);
}
}