Buggy code:
public class CookiePanel extends AbstractConfigGui implements ActionListener { private static transient Logger log = LoggingManager . getLoggerForClass ( ) ; private static final String ADD_COMMAND = "Add" ; private static final String DELETE_COMMAND = "Delete" ; private static final String LOAD_COMMAND = "Load" ; private static final String SAVE_COMMAND = "Save" ; private JTable cookieTable ; private PowerTableModel tableModel ; private JCheckBox clearEachIteration ; private static final String clearEachIterationLabel = "clear_cookies_per_iter" ; private static final String [ ] columnNames = new String [ ] { JMeterUtils . getResString ( "name" ) , JMeterUtils . getResString ( "value" ) , JMeterUtils . getResString ( "domain" ) , JMeterUtils . getResString ( "path" ) , JMeterUtils . getResString ( "secure" ) } ; private static final Class [ ] columnClasses = new Class [ ] { String . class , String . class , String . class , String . class , Boolean . class } ; private JButton addButton ; private JButton deleteButton ; private JButton loadButton ; private JButton saveButton ; public CookiePanel ( ) { } public String getLabelResource ( ) { } public void actionPerformed ( ActionEvent e ) { String action = e . getActionCommand ( ) ; if ( action . equals ( "Delete" ) ) { if ( ( tableModel . getRowCount ( ) ) > 0 ) { if ( cookieTable . isEditing ( ) ) { TableCellEditor cellEditor = cookieTable . getCellEditor ( cookieTable . getEditingRow ( ) , cookieTable . getEditingColumn ( ) ) ; cellEditor . cancelCellEditing ( ) ; } int rowSelected = cookieTable . getSelectedRow ( ) ; if ( rowSelected != ( - 1 ) ) { tableModel . removeRow ( rowSelected ) ; tableModel . fireTableDataChanged ( ) ; if ( ( tableModel . getRowCount ( ) ) == 0 ) { deleteButton . setEnabled ( false ) ; saveButton . setEnabled ( false ) ; } else { int rowToSelect = rowSelected ; if ( rowSelected >= ( tableModel . getRowCount ( ) ) ) { rowToSelect = rowSelected - 1 ; } cookieTable . setRowSelectionInterval ( rowToSelect , rowToSelect ) ; } } } } else if ( action . equals ( "Add" ) ) { if ( cookieTable . isEditing ( ) ) { TableCellEditor cellEditor = cookieTable . getCellEditor ( cookieTable . getEditingRow ( ) , cookieTable . getEditingColumn ( ) ) ; cellEditor . stopCellEditing ( ) ; } tableModel . addNewRow ( ) ; tableModel . fireTableDataChanged ( ) ; if ( ! ( deleteButton . isEnabled ( ) ) ) { deleteButton . setEnabled ( true ) ; } if ( ! ( saveButton . isEnabled ( ) ) ) { saveButton . setEnabled ( true ) ; } int rowToSelect = ( tableModel . getRowCount ( ) ) - 1 ; cookieTable . setRowSelectionInterval ( rowToSelect , rowToSelect ) ; } else if ( action . equals ( "Load" ) ) { try { File tmp = FileDialoger . promptToOpenFile ( ) . getSelectedFile ( ) ; if ( tmp != null ) { CookieManager manager = new CookieManager ( ) ; manager . addFile ( tmp . getAbsolutePath ( ) ) ; Cookie cookie = manager . get ( 0 ) ; addCookieToTable ( cookie ) ; tableModel . fireTableDataChanged ( ) ; if ( ( tableModel . getRowCount ( ) ) > 0 ) { deleteButton . setEnabled ( true ) ; saveButton . setEnabled ( true ) ; } } } catch ( IOException ex ) { CookiePanel . log . error ( "" , ex ) ; } catch ( NullPointerException err ) { } } else if ( action . equals ( "Save" ) ) { try { <START_BUG> File tmp = FileDialoger . promptToSaveFile ( null ) . getSelectedFile ( ) ; <END_BUG> if ( tmp != null ) { ( ( CookieManager ) ( createTestElement ( ) ) ) . save ( tmp . getAbsolutePath ( ) ) ; } } catch ( IOException ex ) { CookiePanel . log . error ( "" , ex ) ; } catch ( NullPointerException err ) { } } } private void addCookieToTable ( Cookie cookie ) { } public void modifyTestElement ( TestElement cm ) { } private Cookie createCookie ( Object [ ] rowData ) { } private void populateTable ( CookieManager manager ) { } public TestElement createTestElement ( ) { } public void configure ( TestElement el ) { } public void init ( ) { } public JPanel createCookieTablePanel ( ) { } private JButton createButton ( String resName , char mnemonic , String command , boolean enabled ) { } private JPanel createButtonPanel ( ) { } }

Fix:
File tmp = FileDialoger . promptToSaveFile ( "cookies.txt" ) . getSelectedFile ( ) ;