Index: trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesCellRenderer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesCellRenderer.java	(revision 10877)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesCellRenderer.java	(revision 10878)
@@ -17,9 +17,12 @@
 import javax.swing.JTable;
 import javax.swing.UIDefaults;
+import javax.swing.UIManager;
 import javax.swing.table.DefaultTableCellRenderer;
 import javax.swing.table.TableCellRenderer;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.data.preferences.BooleanProperty;
+import org.openstreetmap.josm.data.preferences.CachingProperty;
+import org.openstreetmap.josm.data.preferences.ColorProperty;
 
 /**
@@ -29,18 +32,30 @@
 public class PropertiesCellRenderer extends DefaultTableCellRenderer {
 
+    private static final CachingProperty<Color> SELECTED_FG
+            = new ColorProperty(marktr("Discardable key: selection Foreground"), Color.GRAY).cached();
+    private static final CachingProperty<Color> SELECTED_BG;
+    private static final CachingProperty<Color> NORMAL_FG
+            = new ColorProperty(marktr("Discardable key: foreground"), Color.GRAY).cached();
+    private static final CachingProperty<Color> NORMAL_BG;
+    private static final CachingProperty<Boolean> DISCARDABLE
+            = new BooleanProperty("display.discardable-keys", false).cached();
+
+    static {
+        UIDefaults defaults = UIManager.getDefaults();
+        SELECTED_BG = new ColorProperty(marktr("Discardable key: selection Background"),
+                defaults.getColor("Table.selectionBackground")).cached();
+        NORMAL_BG = new ColorProperty(marktr("Discardable key: background"),
+                defaults.getColor("Table.background")).cached();
+    }
+
     private final Collection<TableCellRenderer> customRenderer = new CopyOnWriteArrayList<>();
 
     private static void setColors(Component c, String key, boolean isSelected) {
-        UIDefaults defaults = javax.swing.UIManager.getDefaults();
+
         if (OsmPrimitive.getDiscardableKeys().contains(key)) {
-            if (isSelected) {
-                c.setForeground(Main.pref.getColor(marktr("Discardable key: selection Foreground"), Color.GRAY));
-                c.setBackground(Main.pref.getColor(marktr("Discardable key: selection Background"),
-                        defaults.getColor("Table.selectionBackground")));
-            } else {
-                c.setForeground(Main.pref.getColor(marktr("Discardable key: foreground"), Color.GRAY));
-                c.setBackground(Main.pref.getColor(marktr("Discardable key: background"), defaults.getColor("Table.background")));
-            }
+            c.setForeground((isSelected ? SELECTED_FG : NORMAL_FG).get());
+            c.setBackground((isSelected ? SELECTED_BG : NORMAL_BG).get());
         } else {
+            UIDefaults defaults = UIManager.getDefaults();
             c.setForeground(defaults.getColor("Table."+(isSelected ? "selectionF" : "f")+"oreground"));
             c.setBackground(defaults.getColor("Table."+(isSelected ? "selectionB" : "b")+"ackground"));
@@ -56,7 +71,7 @@
             }
         }
-        Component c = super.getTableCellRendererComponent(table, value, isSelected, false, row, column);
         if (value == null)
             return this;
+        Component c = super.getTableCellRendererComponent(table, value, isSelected, false, row, column);
         if (c instanceof JLabel) {
             String str = null;
@@ -77,10 +92,8 @@
                     StringBuilder sb = new StringBuilder("<");
                     if (otherCount == 1) {
-                        for (Map.Entry<?, ?> entry : v.entrySet()) { // Find the non-blank value in the map
-                            if (!Objects.equals(entry.getKey(), "")) {
-                                /* I18n: properties display partial string joined with comma, frst is count, second is value */
-                                sb.append(tr("{0} ''{1}''", entry.getValue().toString(), entry.getKey()));
-                            }
-                        }
+                        // Find the non-blank value in the map
+                        v.entrySet().stream().filter(entry -> !Objects.equals(entry.getKey(), ""))
+                                /* I18n: properties display partial string joined with comma, first is count, second is value */
+                            .findAny().ifPresent(entry -> sb.append(tr("{0} ''{1}''", entry.getValue().toString(), entry.getKey())));
                     } else {
                         /* I18n: properties display partial string joined with comma */
@@ -102,5 +115,5 @@
             ((JLabel) c).putClientProperty("html.disable", Boolean.TRUE); // Fix #8730
             ((JLabel) c).setText(str);
-            if (Main.pref.getBoolean("display.discardable-keys", false)) {
+            if (DISCARDABLE.get()) {
                 String key = null;
                 if (column == 0) {
