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/data/preferences/ColorProperty.java

    r7937 r8404  
    33
    44import java.awt.Color;
     5import java.util.Locale;
    56
    67import org.openstreetmap.josm.Main;
     
    1415
    1516    private final String name;
    16    
     17
    1718    /**
    1819     * Constructs a new {@code ColorProperty}.
     
    2425        this.name = colName;
    2526    }
    26    
     27
    2728    @Override
    2829    public Color get() {
     
    3435        return Main.pref.putColor(getColorKey(name), value);
    3536    }
    36    
     37
    3738    /**
    3839     * Replies the color key used in JOSM preferences for this property.
     
    4142     */
    4243    public static String getColorKey(String colName) {
    43         return colName == null ? null : colName.toLowerCase().replaceAll("[^a-z0-9]+",".");
     44        return colName == null ? null : colName.toLowerCase(Locale.ENGLISH).replaceAll("[^a-z0-9]+",".");
    4445    }
    4546
Note: See TracChangeset for help on using the changeset viewer.