Ignore:
Timestamp:
2014-04-19T00:36:43+02:00 (12 years ago)
Author:
Don-vip
Message:

sonar - place Strings literals on the left side when checking for equality (can avoid NPEs)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferencesPanel.java

    r6890 r6990  
    115115    public final void initFromPreferences() {
    116116        String authMethod = Main.pref.get("osm-server.auth-method", "basic");
    117         if (authMethod.equals("basic")) {
     117        if ("basic".equals(authMethod)) {
    118118            rbBasicAuthentication.setSelected(true);
    119         } else if (authMethod.equals("oauth")) {
     119        } else if ("oauth".equals(authMethod)) {
    120120            rbOAuth.setSelected(true);
    121121        } else {
     
    140140        }
    141141        Main.pref.put("osm-server.auth-method", authMethod);
    142         if (authMethod.equals("basic")) {
     142        if ("basic".equals(authMethod)) {
    143143            // save username and password and clear the OAuth token
    144144            pnlBasicAuthPreferences.saveToPreferences();
    145145            OAuthAccessTokenHolder.getInstance().clear();
    146146            OAuthAccessTokenHolder.getInstance().save(Main.pref, CredentialsManager.getInstance());
    147         } else if (authMethod.equals("oauth")) {
     147        } else if ("oauth".equals(authMethod)) {
    148148            // clear the password in the preferences
    149149            pnlBasicAuthPreferences.clearPassword();
Note: See TracChangeset for help on using the changeset viewer.