Changeset 510 in josm for trunk/src


Ignore:
Timestamp:
2008-01-03T23:21:51+01:00 (16 years ago)
Author:
framm
Message:
  • fix bug that would not properly overwrite existing files, as identified by Petr Nejedly <Petr.Nejedly@…>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java

    r444 r510  
    161161                        e.printStackTrace();
    162162                        JOptionPane.showMessageDialog(Main.parent, tr("An error occurred while saving.")+"\n"+e.getMessage());
    163                 }
    164                 try {
    165                         // if the file save failed, then the tempfile will not
    166                         // be deleted.  So, restore the backup if we made one.
    167                         if (tmpFile != null && tmpFile.exists()) {
    168                                 copy(tmpFile, file);
    169                         }
    170                 } catch (IOException e) {
    171                         e.printStackTrace();
    172                         JOptionPane.showMessageDialog(Main.parent, tr("An error occurred while restoring backup file.")+"\n"+e.getMessage());
     163
     164                        try {
     165                                // if the file save failed, then the tempfile will not
     166                                // be deleted.  So, restore the backup if we made one.
     167                                if (tmpFile != null && tmpFile.exists()) {
     168                                        copy(tmpFile, file);
     169                                }
     170                        } catch (IOException e2) {
     171                                e2.printStackTrace();
     172                                JOptionPane.showMessageDialog(Main.parent, tr("An error occurred while restoring backup file.")+"\n"+e2.getMessage());
     173                        }
    173174                }
    174175        }
Note: See TracChangeset for help on using the changeset viewer.