### Eclipse Workspace Patch 1.0
#P JOSM
Index: src/org/openstreetmap/josm/data/preferences/ColorProperty.java
===================================================================
--- src/org/openstreetmap/josm/data/preferences/ColorProperty.java	(revision 8575)
+++ src/org/openstreetmap/josm/data/preferences/ColorProperty.java	(working copy)
@@ -2,7 +2,10 @@
 package org.openstreetmap.josm.data.preferences;
 
 import java.awt.Color;
+import java.util.HashMap;
 import java.util.Locale;
+import java.util.Map;
+import java.util.regex.Pattern;
 
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Preferences.ColorKey;
@@ -35,6 +38,9 @@
         return Main.pref.putColor(getColorKey(name), value);
     }
 
+    private static final Map<String, String> XLATED_COLOR_KEYS = new HashMap<String, String>();
+    private static final Pattern XLATED_COLOR_PATTERN = Pattern.compile("[^a-z0-9]+");
+
     /**
      * Replies the color key used in JOSM preferences for this property.
      * @param colName The color name
@@ -41,7 +47,19 @@
      * @return The color key for this property
      */
     public static String getColorKey(String colName) {
-        return colName == null ? null : colName.toLowerCase(Locale.ENGLISH).replaceAll("[^a-z0-9]+", ".");
+
+        if (colName == null) {
+            return null;
+        }
+
+        synchronized (XLATED_COLOR_KEYS) {
+            String xlated = XLATED_COLOR_KEYS.get(colName);
+            if (xlated == null) {
+                xlated = XLATED_COLOR_PATTERN.matcher(colName.toLowerCase(Locale.ENGLISH)).replaceAll(".");
+                XLATED_COLOR_KEYS.put(colName, xlated);
+            }
+            return xlated;
+        }
     }
 
     @Override
