Buggy code:
public final class KeysPreferencePage extends PreferencePage implements IWorkbenchPreferencePage { private class SortOrderSelectionListener extends SelectionAdapter { private final int columnSelected ; private SortOrderSelectionListener ( final int columnSelected ) { } public void widgetSelected ( SelectionEvent e ) { } } private static final Image IMAGE_BLANK = ImageFactory . getImage ( "blank" ) ; private static final Image IMAGE_CHANGE = ImageFactory . getImage ( "change" ) ; private static final String ITEM_DATA_KEY = "org.eclipse.jface.bindings" ; private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle . getBundle ( KeysPreferencePage . class . getName ( ) ) ; private static final int VIEW_TOTAL_COLUMNS = 4 ; private static final String [ ] SORTED_COLUMN_NAMES = new String [ KeysPreferencePage . VIEW_TOTAL_COLUMNS ] ; private static final int TAB_INDEX_MODIFY = 1 ; private static final String [ ] UNSORTED_COLUMN_NAMES = new String [ KeysPreferencePage . VIEW_TOTAL_COLUMNS ] ; private static final int VIEW_CATEGORY_COLUMN_INDEX = 0 ; private static final int VIEW_COMMAND_COLUMN_INDEX = 1 ; private static final int VIEW_CONTEXT_COLUMN_INDEX = 3 ; private static final int VIEW_KEY_SEQUENCE_COLUMN_INDEX = 2 ; private IActivityManager activityManager ; private IBindingService bindingService ; private Button buttonAdd ; private Button buttonRemove ; private Button buttonRestore ; private Map categoryIdsByUniqueName ; private Map categoryUniqueNamesById ; private Combo comboCategory ; private Combo comboCommand ; private Combo comboContext ; private Combo comboScheme ; private Map commandIdsByCategoryId ; private Map commandIdsByUniqueName ; private ICommandService commandService ; private Map commandUniqueNamesById ; private Map contextIdsByUniqueName ; private IContextService contextService ; private Map contextUniqueNamesById ; private Label labelBindingsForCommand ; private Label labelBindingsForTriggerSequence ; private Label labelContextExtends ; private Label labelSchemeExtends ; private final BindingManager localChangeManager = new BindingManager ( new ContextManager ( ) ) ; private Map schemeIdsByUniqueName ; private Map schemeUniqueNamesById ; private int [ ] sortOrder = new int [ ] { KeysPreferencePage . VIEW_CATEGORY_COLUMN_INDEX , KeysPreferencePage . VIEW_COMMAND_COLUMN_INDEX , KeysPreferencePage . VIEW_KEY_SEQUENCE_COLUMN_INDEX , KeysPreferencePage . VIEW_CONTEXT_COLUMN_INDEX } ; private TabFolder tabFolder ; private Table tableBindings ; private Table tableBindingsForCommand ; private Table tableBindingsForTriggerSequence ; private Text textTriggerSequence ; private KeySequenceText textTriggerSequenceManager ; protected final Control createContents ( final Composite parent ) { } private final Composite createModifyTab ( final TabFolder parent ) { } private final Composite createViewTab ( final TabFolder parent ) { } protected IPreferenceStore doGetPreferenceStore ( ) { } public final void editCommand ( final String commandName , final String keySequence ) { } public final void editCommand ( final String categoryName , final String commandName , final String keySequence ) { } private final String getCategoryId ( ) { } private final String getCommandId ( ) { } private final String getContextId ( ) { } private final KeySequence getKeySequence ( ) { } private final String getSchemeId ( ) { } public final void init ( final IWorkbench workbench ) { } private final boolean isActive ( final Command command ) { } private final void logPreferenceStoreException ( final Throwable exception ) { } public final boolean performCancel ( ) { } protected final void performDefaults ( ) { } public final boolean performOk ( ) { } private final void persistSelectedTab ( ) { } private final void selectedButtonAdd ( ) { } private final void selectedButtonExport ( ) { <START_BUG> final FileDialog fileDialog = new FileDialog ( getShell ( ) ) ; <END_BUG> fileDialog . setFilterExtensions ( new String [ ] { "*.csv" } ) ; fileDialog . setFilterNames ( new String [ ] { Util . translateString ( KeysPreferencePage . RESOURCE_BUNDLE , "csvFilterName" ) } ) ; final String filePath = fileDialog . open ( ) ; if ( filePath == null ) { return ; } final SafeRunnable runnable = new SafeRunnable ( ) { public final void run ( ) throws IOException { Writer fileWriter = null ; try { fileWriter = new BufferedWriter ( new FileWriter ( filePath ) ) ; final TableItem [ ] items = tableBindings . getItems ( ) ; final int numColumns = tableBindings . getColumnCount ( ) ; for ( int i = 0 ; i < ( items . length ) ; i ++ ) { final TableItem item = items [ i ] ; for ( int j = 0 ; j < numColumns ; j ++ ) { fileWriter . write ( item . getText ( j ) ) ; if ( j < ( numColumns - 1 ) ) { fileWriter . write ( ',' ) ; } } fileWriter . write ( System . getProperty ( "line.separator" ) ) ; } } finally { if ( fileWriter != null ) { try { fileWriter . close ( ) ; } catch ( final IOException e ) { } } } } } ; Platform . run ( runnable ) ; } private final void selectedButtonRemove ( ) { } private final void selectedButtonRestore ( ) { } private final void selectedComboScheme ( ) { } private final void selectedTableBindingsForCommand ( ) { } private final void selectedTableBindingsForTriggerSequence ( ) { } private final void selectedTableKeyBindings ( ) { } private final void setCommandId ( final String commandId ) { } private final void setContextId ( final String contextId ) { } private final void setKeySequence ( final KeySequence keySequence ) { } private final void setScheme ( final Scheme scheme ) { } public final void setVisible ( final boolean visible ) { } private final void update ( ) { } private final void updateComboCommand ( ) { } private final void updateComboContext ( ) { } private final void updateEnabled ( final TriggerSequence triggerSequence , final String commandId ) { } private final void updateLabelContextExtends ( ) { } private final void updateLabelSchemeExtends ( ) { } private final void updateSelection ( final Table table , final String contextId , final TriggerSequence triggerSequence ) { } private final void updateTableBindingsForCommand ( final String commandId ) { } private final void updateTableBindingsForTriggerSequence ( final TriggerSequence triggerSequence ) { } private final void updateViewTab ( ) { } }

Fix:
final FileDialog fileDialog = new FileDialog ( getShell ( ) , SWT . SAVE ) ;