Index: trunk/src/org/openstreetmap/josm/actions/SessionSaveAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/SessionSaveAction.java	(revision 18471)
+++ trunk/src/org/openstreetmap/josm/actions/SessionSaveAction.java	(revision 18472)
@@ -14,4 +14,5 @@
 import java.io.IOException;
 import java.lang.ref.WeakReference;
+import java.nio.file.Files;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -53,4 +54,5 @@
 import org.openstreetmap.josm.gui.layer.LayerManager.LayerOrderChangeEvent;
 import org.openstreetmap.josm.gui.layer.LayerManager.LayerRemoveEvent;
+import org.openstreetmap.josm.gui.util.GuiHelper;
 import org.openstreetmap.josm.gui.util.WindowGeometry;
 import org.openstreetmap.josm.gui.widgets.AbstractFileChooser;
@@ -252,8 +254,21 @@
             if (removeFileOnSuccess != null) {
                 PreferencesUtils.removeFromList(Config.getPref(), "file-open.history", removeFileOnSuccess.getCanonicalPath());
-                removeFileOnSuccess.delete();
+                Files.deleteIfExists(removeFileOnSuccess.toPath());
                 removeFileOnSuccess = null;
             }
             showSavedNotification(savingNotification, sessionFile.getName());
+        } catch (SecurityException ex) {
+            Logging.error(ex);
+            if (removeFileOnSuccess != null) {
+                final String path = removeFileOnSuccess.getPath();
+                GuiHelper.runInEDT(() -> {
+                    Notification notification = new Notification(tr("Could not delete file: {0}\r{1}", path, ex.getMessage()));
+                    notification.setIcon(JOptionPane.WARNING_MESSAGE);
+                    notification.show();
+                });
+            } else {
+                // We should never hit this, unless something changes in the try block.
+                throw new JosmRuntimeException(ex);
+            }
         } catch (IOException ex) {
             Logging.error(ex);
@@ -273,5 +288,5 @@
     /**
      * Sets the current session file. Asks the user if necessary
-     * @param saveAs alwas ask the user
+     * @param saveAs always ask the user
      * @param zipRequired zip
      * @return if the user was asked
Index: trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java	(revision 18471)
+++ trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java	(revision 18472)
@@ -97,5 +97,5 @@
 
     private transient DataSet dataSet;
-    private ChangeListener changesetTagListener;
+    private transient ChangeListener changesetTagListener;
 
     /**
@@ -372,5 +372,5 @@
      * the changeset tags.
      */
-    public void setChangesetTagsModifiedProgramatically() {
+    public synchronized void setChangesetTagsModifiedProgramatically() {
         final Color originalColor = this.tpConfigPanels.getBackgroundAt(1);
         this.tpConfigPanels.setBackgroundAt(1, WARNING_BACKGROUND);
@@ -383,6 +383,8 @@
                 tpConfigPanels.setBackgroundAt(1, originalColor);
                 tpConfigPanels.setIconAt(1, ImageProvider.get("apply"));
-                this.tpConfigPanels.removeChangeListener(this.changesetTagListener);
-                changesetTagListener = null;
+                synchronized (this) {
+                    this.tpConfigPanels.removeChangeListener(this.changesetTagListener);
+                    changesetTagListener = null;
+                }
             }
         };
@@ -575,12 +577,7 @@
         if (e.getKey() != null
                 && e.getSource() != getClass()
-                && e.getSource() != BasicUploadSettingsPanel.class) {
-            switch (e.getKey()) {
-                case "osm-server.url":
-                    osmServerUrlChanged(e.getNewValue());
-                    break;
-                default:
-                    return;
-            }
+                && e.getSource() != BasicUploadSettingsPanel.class
+                && "osm-server.url".equals(e.getKey())) {
+            osmServerUrlChanged(e.getNewValue());
         }
     }
@@ -643,8 +640,10 @@
         setUploadedPrimitives(null);
         dataSet = null;
-        if (this.changesetTagListener != null) {
-            this.changesetTagListener.stateChanged(null);
-            this.tpConfigPanels.removeChangeListener(this.changesetTagListener);
-            this.changesetTagListener = null;
+        synchronized (this) {
+            if (this.changesetTagListener != null) {
+                this.changesetTagListener.stateChanged(null);
+                this.tpConfigPanels.removeChangeListener(this.changesetTagListener);
+                this.changesetTagListener = null;
+            }
         }
     }
