Index: trunk/src/org/openstreetmap/josm/data/Preferences.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 3343)
+++ trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 3344)
@@ -719,5 +719,5 @@
     }
     synchronized public void removeFromCollection(String key, String value) {
-        List<String> a = new ArrayList<String>(getCollection(key, null));
+        List<String> a = new ArrayList<String>(getCollection(key, Collections.<String>emptyList()));
         a.remove(value);
         putCollection(key, a);
Index: trunk/src/org/openstreetmap/josm/gui/io/UploadStrategy.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/UploadStrategy.java	(revision 3343)
+++ trunk/src/org/openstreetmap/josm/gui/io/UploadStrategy.java	(revision 3344)
@@ -64,5 +64,5 @@
      */
     public static UploadStrategy getFromPreferences() {
-        String v = Main.pref.get("osm-server.upload-strategy");
+        String v = Main.pref.get("osm-server.upload-strategy", null);
         if (v == null) {
             // legacy support. Until 12/2009 we had osm-server.atomic-upload only.
@@ -70,7 +70,9 @@
             // When the preferences are saved the next time, "osm-server.upload-strategy"
             // will be inserted.
-            v = Main.pref.get("osm-server.atomic-upload");
+            v = Main.pref.get("osm-server.atomic-upload", null);
             if (v != null) {
                 Main.pref.removeFromCollection("osm-server.atomic-upload", v);
+            } else {
+                v = "";
             }
             v = v.trim().toLowerCase();
Index: trunk/src/org/openstreetmap/josm/io/OsmConnection.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmConnection.java	(revision 3343)
+++ trunk/src/org/openstreetmap/josm/io/OsmConnection.java	(revision 3344)
@@ -73,5 +73,5 @@
      *
      * @param con the connection
-     * @throws OsmTransferException thrown is something went wrong. Check for nested exceptions
+     * @throws OsmTransferException thrown if something went wrong. Check for nested exceptions
      */
     protected void addBasicAuthorizationHeader(HttpURLConnection con) throws OsmTransferException {
Index: trunk/src/org/openstreetmap/josm/io/auth/CredentialsManagerFactory.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/auth/CredentialsManagerFactory.java	(revision 3343)
+++ trunk/src/org/openstreetmap/josm/io/auth/CredentialsManagerFactory.java	(revision 3344)
@@ -17,6 +17,7 @@
      */
     static public CredentialsManager getCredentialManager() {
-        if (instance == null)
-            return new JosmPreferencesCredentialManager();
+        if (instance == null) {
+            instance =  new JosmPreferencesCredentialManager();
+        }
         return instance;
     }
Index: trunk/src/org/openstreetmap/josm/io/auth/JosmPreferencesCredentialManager.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/auth/JosmPreferencesCredentialManager.java	(revision 3343)
+++ trunk/src/org/openstreetmap/josm/io/auth/JosmPreferencesCredentialManager.java	(revision 3344)
@@ -4,4 +4,6 @@
 import java.net.PasswordAuthentication;
 import java.net.Authenticator.RequestorType;
+import java.util.HashMap;
+import java.util.Map;
 
 import org.openstreetmap.josm.Main;
@@ -17,4 +19,5 @@
 public class JosmPreferencesCredentialManager implements CredentialsManager {
 
+    Map<RequestorType, PasswordAuthentication> memoryCredentialsCache = new HashMap<RequestorType, PasswordAuthentication>();
     /**
      * @see CredentialsManager#lookup(RequestorType)
@@ -80,5 +83,21 @@
         CredentialsManagerResponse response = new CredentialsManagerResponse();
 
-        if (noSuccessWithLastResponse|| username.equals("") || password.equals("")) {
+        /*
+         * Last request was successful and there was no credentials stored
+         * in file. -> Try to recall credentials that have been entered
+         * manually in this session.
+         */
+        if (!noSuccessWithLastResponse && credentials == null && memoryCredentialsCache.containsKey(requestorType)) {
+            PasswordAuthentication pa = memoryCredentialsCache.get(requestorType);
+            response.setUsername(pa.getUserName());
+            response.setPassword(pa.getPassword());
+            response.setCanceled(false);
+        /*
+         * Prompt the user for credentials. This happens the first time each
+         * josm start if the user does not save the credentials to preference
+         * file (username=="") and each time after authentication failed
+         * (noSuccessWithLastResponse == true).
+         */
+        } else if (noSuccessWithLastResponse || username.equals("") || password.equals("")) {
             CredentialDialog dialog = null;
             switch(requestorType) {
@@ -97,5 +116,15 @@
                         response.getPassword()
                 ));
+            /*
+             * User decides not to save credentials to file. Keep it
+             * in memory so we don't have to ask over and over again.
+             */
+            } else {
+                PasswordAuthentication pa = new PasswordAuthentication(dialog.getUsername(), dialog.getPassword());
+                memoryCredentialsCache.put(requestorType, pa);
             }
+        /*
+         * We got it from file.
+         */
         } else {
             response.setUsername(username);
