Index: trunk/src/org/openstreetmap/josm/data/oauth/OAuthParameters.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/oauth/OAuthParameters.java	(revision 9218)
+++ trunk/src/org/openstreetmap/josm/data/oauth/OAuthParameters.java	(revision 9220)
@@ -14,5 +14,5 @@
 
 /**
- * This class manages a set of OAuth parameters.
+ * This class manages an immutable set of OAuth parameters.
  * @since 2747
  */
@@ -40,5 +40,4 @@
     public static final String DEFAULT_AUTHORISE_URL = Main.getOSMWebsite() + "/oauth/authorize";
 
-
     /**
      * Replies a set of default parameters for a consumer accessing the standard OSM server
@@ -61,18 +60,8 @@
      */
     public static OAuthParameters createDefault(String apiUrl) {
-        OAuthParameters parameters = new OAuthParameters();
-        parameters.setConsumerKey(DEFAULT_JOSM_CONSUMER_KEY);
-        parameters.setConsumerSecret(DEFAULT_JOSM_CONSUMER_SECRET);
-        parameters.setRequestTokenUrl(DEFAULT_REQUEST_TOKEN_URL);
-        parameters.setAccessTokenUrl(DEFAULT_ACCESS_TOKEN_URL);
-        parameters.setAuthoriseUrl(DEFAULT_AUTHORISE_URL);
+        String host = "";
         if (!OsmApi.DEFAULT_API_URL.equals(apiUrl)) {
             try {
-                String host = new URL(apiUrl).getHost();
-                if (host.endsWith("dev.openstreetmap.org")) {
-                    parameters.setRequestTokenUrl(DEFAULT_REQUEST_TOKEN_URL.replace("www.openstreetmap.org", host));
-                    parameters.setAccessTokenUrl(DEFAULT_ACCESS_TOKEN_URL.replace("www.openstreetmap.org", host));
-                    parameters.setAuthoriseUrl(DEFAULT_AUTHORISE_URL.replace("www.openstreetmap.org", host));
-                }
+                host = new URL(apiUrl).getHost();
             } catch (MalformedURLException e) {
                 // Ignored
@@ -82,5 +71,11 @@
             }
         }
-        return parameters;
+        boolean osmDevServer = host.endsWith("dev.openstreetmap.org");
+        return new OAuthParameters(
+            DEFAULT_JOSM_CONSUMER_KEY,
+            DEFAULT_JOSM_CONSUMER_SECRET,
+            osmDevServer ? DEFAULT_REQUEST_TOKEN_URL.replace("www.openstreetmap.org", host) : DEFAULT_REQUEST_TOKEN_URL,
+            osmDevServer ? DEFAULT_ACCESS_TOKEN_URL.replace("www.openstreetmap.org", host) : DEFAULT_ACCESS_TOKEN_URL,
+            osmDevServer ? DEFAULT_AUTHORISE_URL.replace("www.openstreetmap.org", host) : DEFAULT_AUTHORISE_URL);
     }
 
@@ -93,26 +88,38 @@
     public static OAuthParameters createFromPreferences(Preferences pref) {
         OAuthParameters parameters = createDefault(pref.get("osm-server.url"));
-        parameters.setConsumerKey(pref.get("oauth.settings.consumer-key", parameters.getConsumerKey()));
-        parameters.setConsumerSecret(pref.get("oauth.settings.consumer-secret", parameters.getConsumerSecret()));
-        parameters.setRequestTokenUrl(pref.get("oauth.settings.request-token-url", parameters.getRequestTokenUrl()));
-        parameters.setAccessTokenUrl(pref.get("oauth.settings.access-token-url", parameters.getAccessTokenUrl()));
-        parameters.setAuthoriseUrl(pref.get("oauth.settings.authorise-url", parameters.getAuthoriseUrl()));
-        return parameters;
-    }
-
-    private String consumerKey;
-    private String consumerSecret;
-    private String requestTokenUrl;
-    private String accessTokenUrl;
-    private String authoriseUrl;
-
-    /**
-     * Constructs a new, unitialized, {@code OAuthParameters}.
+        return new OAuthParameters(
+                pref.get("oauth.settings.consumer-key", parameters.getConsumerKey()),
+                pref.get("oauth.settings.consumer-secret", parameters.getConsumerSecret()),
+                pref.get("oauth.settings.request-token-url", parameters.getRequestTokenUrl()),
+                pref.get("oauth.settings.access-token-url", parameters.getAccessTokenUrl()),
+                pref.get("oauth.settings.authorise-url", parameters.getAuthoriseUrl())
+                );
+    }
+
+    private final String consumerKey;
+    private final String consumerSecret;
+    private final String requestTokenUrl;
+    private final String accessTokenUrl;
+    private final String authoriseUrl;
+
+    /**
+     * Constructs a new {@code OAuthParameters}.
+     * @param consumerKey consumer key
+     * @param consumerSecret consumer secret
+     * @param requestTokenUrl request token URL
+     * @param accessTokenUrl access token URL
+     * @param authoriseUrl authorise URL
      *
      * @see #createDefault
      * @see #createFromPreferences
-     */
-    public OAuthParameters() {
-        // contents can be set later with setters
+     * @since 9220
+     */
+    public OAuthParameters(String consumerKey, String consumerSecret,
+            String requestTokenUrl, String accessTokenUrl, String authoriseUrl) {
+        this.consumerKey = consumerKey;
+        this.consumerSecret = consumerSecret;
+        this.requestTokenUrl = requestTokenUrl;
+        this.accessTokenUrl = accessTokenUrl;
+        this.authoriseUrl = authoriseUrl;
     }
 
@@ -141,12 +148,4 @@
 
     /**
-     * Sets the consumer key.
-     * @param consumerKey The consumer key
-     */
-    public void setConsumerKey(String consumerKey) {
-        this.consumerKey = consumerKey;
-    }
-
-    /**
      * Gets the consumer secret.
      * @return The consumer secret
@@ -157,12 +156,4 @@
 
     /**
-     * Sets the consumer secret.
-     * @param consumerSecret The consumer secret
-     */
-    public void setConsumerSecret(String consumerSecret) {
-        this.consumerSecret = consumerSecret;
-    }
-
-    /**
      * Gets the request token URL.
      * @return The request token URL
@@ -173,12 +164,4 @@
 
     /**
-     * Sets the request token URL.
-     * @param requestTokenUrl the request token URL
-     */
-    public void setRequestTokenUrl(String requestTokenUrl) {
-        this.requestTokenUrl = requestTokenUrl;
-    }
-
-    /**
      * Gets the access token URL.
      * @return The access token URL
@@ -189,12 +172,4 @@
 
     /**
-     * Sets the access token URL.
-     * @param accessTokenUrl The access token URL
-     */
-    public void setAccessTokenUrl(String accessTokenUrl) {
-        this.accessTokenUrl = accessTokenUrl;
-    }
-
-    /**
      * Gets the authorise URL.
      * @return The authorise URL
@@ -202,12 +177,4 @@
     public String getAuthoriseUrl() {
         return authoriseUrl;
-    }
-
-    /**
-     * Sets the authorise URL.
-     * @param authoriseUrl The authorise URL
-     */
-    public void setAuthoriseUrl(String authoriseUrl) {
-        this.authoriseUrl = authoriseUrl;
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/oauth/AdvancedOAuthPropertiesPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/oauth/AdvancedOAuthPropertiesPanel.java	(revision 9218)
+++ trunk/src/org/openstreetmap/josm/gui/oauth/AdvancedOAuthPropertiesPanel.java	(revision 9220)
@@ -193,11 +193,10 @@
         if (cbUseDefaults.isSelected())
             return OAuthParameters.createDefault(apiUrl);
-        OAuthParameters parameters = new OAuthParameters();
-        parameters.setConsumerKey(tfConsumerKey.getText());
-        parameters.setConsumerSecret(tfConsumerSecret.getText());
-        parameters.setRequestTokenUrl(tfRequestTokenURL.getText());
-        parameters.setAccessTokenUrl(tfAccessTokenURL.getText());
-        parameters.setAuthoriseUrl(tfAuthoriseURL.getText());
-        return parameters;
+        return new OAuthParameters(
+            tfConsumerKey.getText(),
+            tfConsumerSecret.getText(),
+            tfRequestTokenURL.getText(),
+            tfAccessTokenURL.getText(),
+            tfAuthoriseURL.getText());
     }
 
