Ignore:
Timestamp:
2015-05-21T01:18:35+02:00 (4 years ago)
Author:
Don-vip
Message:

When doing a String.toLowerCase()/toUpperCase() call, use a Locale. This avoids problems with certain locales, i.e. Lithuanian or Turkish. See PMD UseLocaleWithCaseConversions rule and String.toLowerCase() javadoc.

Location:
trunk/src/org/openstreetmap/josm/plugins
Files:
2 edited

Legend:

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

    r8390 r8404  
    2828import java.util.LinkedList;
    2929import java.util.List;
     30import java.util.Locale;
    3031import java.util.Map;
    3132import java.util.Map.Entry;
     
    380381        // check whether automatic update at startup was disabled
    381382        //
    382         String policy = Main.pref.get(togglePreferenceKey, "ask").trim().toLowerCase();
     383        String policy = Main.pref.get(togglePreferenceKey, "ask").trim().toLowerCase(Locale.ENGLISH);
    383384        switch(policy) {
    384385        case "never":
     
    14081409        public void initDontShowAgain(String preferencesKey) {
    14091410            String policy = Main.pref.get(preferencesKey, "ask");
    1410             policy = policy.trim().toLowerCase();
     1411            policy = policy.trim().toLowerCase(Locale.ENGLISH);
    14111412            cbDontShowAgain.setSelected(!"ask".equals(policy));
    14121413        }
  • trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java

    r8395 r8404  
    1919import java.util.LinkedList;
    2020import java.util.List;
     21import java.util.Locale;
    2122import java.util.Map;
    2223import java.util.TreeMap;
     
    458459        if (filter == null) return true;
    459460        if (value == null) return false;
    460         return value.toLowerCase().contains(filter.toLowerCase());
     461        return value.toLowerCase(Locale.ENGLISH).contains(filter.toLowerCase(Locale.ENGLISH));
    461462    }
    462463
Note: See TracChangeset for help on using the changeset viewer.