Ignore:
Timestamp:
2015-05-21T01:18:35+02:00 (6 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/template_engine/Variable.java

    r8390 r8404  
    33
    44import java.util.Collection;
     5import java.util.Locale;
    56
    67public class Variable implements TemplateEntry {
     
    1415
    1516    public Variable(String variableName) {
    16         if (variableName.toLowerCase().startsWith(SPECIAL_VARIABLE_PREFIX)) {
     17        if (variableName.toLowerCase(Locale.ENGLISH).startsWith(SPECIAL_VARIABLE_PREFIX)) {
    1718            this.variableName = variableName.substring(SPECIAL_VARIABLE_PREFIX.length());
    1819            // special:special:key means that real key named special:key is needed, not special variable
    19             this.special = !this.variableName.toLowerCase().startsWith(SPECIAL_VARIABLE_PREFIX);
     20            this.special = !this.variableName.toLowerCase(Locale.ENGLISH).startsWith(SPECIAL_VARIABLE_PREFIX);
    2021        } else {
    2122            this.variableName = variableName;
Note: See TracChangeset for help on using the changeset viewer.