Changeset 6599 in josm


Ignore:
Timestamp:
2014-01-02T23:27:34+01:00 (11 years ago)
Author:
bastiK
Message:

fixed #9505 - Defaults for osm-server.url differ = !null

Loosen the conditions for default values. In general default values must be equal for the same key throughout the code. As an exception, you can always provide null as dummy default value (as it was before [6578]).

Location:
trunk/src/org/openstreetmap/josm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/Preferences.java

    r6593 r6599  
    10261026        CheckParameterUtil.ensureParameterNotNull(key);
    10271027        CheckParameterUtil.ensureParameterNotNull(def);
    1028         if (defaultsMap.containsKey(key) && !def.equals(defaultsMap.get(key))) {
     1028        Setting oldDef = defaultsMap.get(key);
     1029        if (oldDef != null && oldDef.getValue() != null && def.getValue() != null && !def.equals(oldDef)) {
    10291030            Main.info("Defaults for " + key + " differ: " + def + " != " + defaultsMap.get(key));
    10301031        }
  • trunk/src/org/openstreetmap/josm/data/oauth/OAuthParameters.java

    r6582 r6599  
    9191     */
    9292    static public OAuthParameters createFromPreferences(Preferences pref) {
    93         OAuthParameters parameters = createDefault(pref.get("osm-server.url", OsmApi.DEFAULT_API_URL));
     93        OAuthParameters parameters = createDefault(pref.get("osm-server.url"));
    9494        parameters.setConsumerKey(pref.get("oauth.settings.consumer-key", parameters.getConsumerKey()));
    9595        parameters.setConsumerSecret(pref.get("oauth.settings.consumer-secret", parameters.getConsumerSecret()));
  • trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java

    r6582 r6599  
    3535import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
    3636import org.openstreetmap.josm.gui.progress.ProgressMonitor;
    37 import org.openstreetmap.josm.io.OsmApi;
    3837import org.openstreetmap.josm.io.OsmTransferCanceledException;
    3938import org.openstreetmap.josm.tools.CheckParameterUtil;
     
    6261     */
    6362    public OsmOAuthAuthorizationClient() {
    64         oauthProviderParameters = OAuthParameters.createDefault(Main.pref.get("osm-server.url", OsmApi.DEFAULT_API_URL));
     63        oauthProviderParameters = OAuthParameters.createDefault(Main.pref.get("osm-server.url"));
    6564        consumer = oauthProviderParameters.buildConsumer();
    6665        provider = oauthProviderParameters.buildProvider(consumer);
Note: See TracChangeset for help on using the changeset viewer.