Ignore:
Timestamp:
2014-04-27T15:35:47+02:00 (10 years ago)
Author:
Don-vip
Message:

see #8465 - use String switch/case where applicable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java

    r7005 r7012  
    351351        // check whether automatic update at startup was disabled
    352352        //
    353         String policy = Main.pref.get(togglePreferenceKey, "ask");
    354         policy = policy.trim().toLowerCase();
    355         if ("never".equals(policy)) {
     353        String policy = Main.pref.get(togglePreferenceKey, "ask").trim().toLowerCase();
     354        switch(policy) {
     355        case "never":
    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."));
     
    360360            }
    361361            return false;
    362         }
    363 
    364         if ("always".equals(policy)) {
     362
     363        case "always":
    365364            if ("pluginmanager.version-based-update.policy".equals(togglePreferenceKey)) {
    366365                Main.info(tr("Running plugin update after JOSM upgrade. Automatic update at startup is enabled."));
     
    369368            }
    370369            return true;
    371         }
    372 
    373         if (!"ask".equals(policy)) {
     370           
     371        case "ask":
     372            break;
     373
     374        default:
    374375            Main.warn(tr("Unexpected value ''{0}'' for preference ''{1}''. Assuming value ''ask''.", policy, togglePreferenceKey));
    375376        }
     377
    376378        int ret = HelpAwareOptionPane.showOptionDialog(
    377379                parent,
Note: See TracChangeset for help on using the changeset viewer.