Ignore:
Timestamp:
2014-05-09T04:49:54+02:00 (10 years ago)
Author:
Don-vip
Message:

fixes for unit tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/JosmUserIdentityManager.java

    r7048 r7081  
    242242        switch (evt.getKey()) {
    243243        case "osm-server.username":
    244             if (!(evt.getNewValue() instanceof StringSetting)) return;
    245             String newUserName = ((StringSetting) evt.getNewValue()).getValue();
     244            String newUserName = null;
     245            if (evt.getNewValue() instanceof StringSetting) {
     246                newUserName = ((StringSetting) evt.getNewValue()).getValue();
     247            }
    246248            if (newUserName == null || newUserName.trim().isEmpty()) {
    247249                setAnonymous();
    248250            } else {
    249                 if (! newUserName.equals(userName)) {
     251                if (!newUserName.equals(userName)) {
    250252                    setPartiallyIdentified(newUserName);
    251253                }
     
    254256
    255257        case "osm-server.url":
    256             if (!(evt.getNewValue() instanceof StringSetting)) return;
    257             String newUrl = ((StringSetting) evt.getNewValue()).getValue();
     258            String newUrl = null;
     259            if (evt.getNewValue() instanceof StringSetting) {
     260                newUrl = ((StringSetting) evt.getNewValue()).getValue();
     261            }
    258262            if (newUrl == null || newUrl.trim().isEmpty()) {
    259263                setAnonymous();
Note: See TracChangeset for help on using the changeset viewer.