Ignore:
Timestamp:
2014-04-19T00:36:43+02:00 (11 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/plugins/PluginHandler.java

    r6890 r6990  
    353353        String policy = Main.pref.get(togglePreferenceKey, "ask");
    354354        policy = policy.trim().toLowerCase();
    355         if (policy.equals("never")) {
     355        if ("never".equals(policy)) {
    356356            if ("pluginmanager.version-based-update.policy".equals(togglePreferenceKey)) {
    357357                Main.info(tr("Skipping plugin update after JOSM upgrade. Automatic update at startup is disabled."));
     
    362362        }
    363363
    364         if (policy.equals("always")) {
     364        if ("always".equals(policy)) {
    365365            if ("pluginmanager.version-based-update.policy".equals(togglePreferenceKey)) {
    366366                Main.info(tr("Running plugin update after JOSM upgrade. Automatic update at startup is enabled."));
     
    371371        }
    372372
    373         if (!policy.equals("ask")) {
     373        if (!"ask".equals(policy)) {
    374374            Main.warn(tr("Unexpected value ''{0}'' for preference ''{1}''. Assuming value ''ask''.", policy, togglePreferenceKey));
    375375        }
     
    13551355            String policy = Main.pref.get(preferencesKey, "ask");
    13561356            policy = policy.trim().toLowerCase();
    1357             cbDontShowAgain.setSelected(! policy.equals("ask"));
     1357            cbDontShowAgain.setSelected(!"ask".equals(policy));
    13581358        }
    13591359
Note: See TracChangeset for help on using the changeset viewer.