Index: /trunk/src/org/openstreetmap/josm/data/Preferences.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 6623)
+++ /trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 6624)
@@ -852,4 +852,9 @@
     }
 
+    /**
+     * Returns the color for the given key.
+     * @param key The color key
+     * @return the color
+     */
     public Color getColor(ColorKey key) {
         return getColor(key.getColorName(), key.getSpecialName(), key.getDefaultValue());
@@ -870,6 +875,6 @@
         }
         String colStr = specName != null ? get("color."+specName) : "";
-        if(colStr.isEmpty()) {
-            colStr = get("color." + colKey, "");
+        if (colStr.isEmpty()) {
+            colStr = get("color." + colKey, ColorHelper.color2html(def));
         }
         return colStr.isEmpty() ? def : ColorHelper.html2color(colStr);
Index: /trunk/src/org/openstreetmap/josm/gui/conflict/ConflictColors.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/conflict/ConflictColors.java	(revision 6623)
+++ /trunk/src/org/openstreetmap/josm/gui/conflict/ConflictColors.java	(revision 6624)
@@ -49,6 +49,4 @@
     private final Color defaultColor;
 
-    private static Color backgroundColorCache = null;
-
     private ConflictColors(String name, Color defaultColor) {
         this.name = name;
@@ -71,10 +69,17 @@
     }
 
+    /**
+     * Returns the color.
+     * @return the color
+     */
     public Color get() {
         return Main.pref.getColor(this);
     }
 
+    /**
+     * Loads all colors from preferences.
+     */
     public static void getColors() {
-        for (ConflictColors c:values()) {
+        for (ConflictColors c : values()) {
             c.get();
         }
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java	(revision 6623)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java	(revision 6624)
@@ -14,5 +14,4 @@
 import java.util.List;
 import java.util.Map;
-import java.util.Map.Entry;
 import java.util.TreeMap;
 import java.util.Vector;
@@ -78,5 +77,5 @@
      */
     public void setColorModel(Map<String, String> colorMap) {
-        if(tableModel == null) {
+        if (tableModel == null) {
             tableModel = new DefaultTableModel();
             tableModel.addColumn(tr("Name"));
@@ -85,5 +84,5 @@
 
         // clear old model:
-        while(tableModel.getRowCount() > 0) {
+        while (tableModel.getRowCount() > 0) {
             tableModel.removeRow(0);
         }
@@ -92,9 +91,9 @@
         Map<String, String> colorKeyList_mappaint = new TreeMap<String, String>();
         Map<String, String> colorKeyList_layer = new TreeMap<String, String>();
-        for(String key : colorMap.keySet()) {
-            if(key.startsWith("layer ")) {
+        for (String key : colorMap.keySet()) {
+            if (key.startsWith("layer ")) {
                 colorKeyList_layer.put(getName(key), key);
-            } else if(key.startsWith("mappaint.")) {
-                /* use getName(key)+key, as getName() may be ambiguous */
+            } else if (key.startsWith("mappaint.")) {
+                // use getName(key)+key, as getName() may be ambiguous
                 colorKeyList_mappaint.put(getName(key)+key, key);
             } else {
@@ -102,24 +101,23 @@
             }
         }
-        for (Entry<String, String> k : colorKeyList.entrySet()) {
+        addColorRows(colorMap, colorKeyList);
+        addColorRows(colorMap, colorKeyList_mappaint);
+        addColorRows(colorMap, colorKeyList_layer);
+        if (this.colors != null) {
+            this.colors.repaint();
+        }
+    }
+    
+    private void addColorRows(Map<String, String> colorMap, Map<String, String> keyMap) {
+        for (String value : keyMap.values()) {
             Vector<Object> row = new Vector<Object>(2);
-            row.add(k.getValue());
-            row.add(ColorHelper.html2color(colorMap.get(k.getValue())));
+            String html = colorMap.get(value);
+            Color color = ColorHelper.html2color(html);
+            if (color == null) {
+                Main.warn("Unable to get color from '"+html+"' for color preference '"+value+"'");
+            }
+            row.add(value);
+            row.add(color);
             tableModel.addRow(row);
-        }
-        for (Entry<String, String> k : colorKeyList_mappaint.entrySet()) {
-            Vector<Object> row = new Vector<Object>(2);
-            row.add(k.getValue());
-            row.add(ColorHelper.html2color(colorMap.get(k.getValue())));
-            tableModel.addRow(row);
-        }
-        for (Entry<String, String> k : colorKeyList_layer.entrySet()) {
-            Vector<Object> row = new Vector<Object>(2);
-            row.add(k.getValue());
-            row.add(ColorHelper.html2color(colorMap.get(k.getValue())));
-            tableModel.addRow(row);
-        }
-        if(this.colors != null) {
-            this.colors.repaint();
         }
     }
