Index: trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java	(revision 6675)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java	(revision 6677)
@@ -74,5 +74,5 @@
         protected final Map<String, String> keyChange = new LinkedHashMap<String, String>();
         protected final List<String> alternatives = new ArrayList<String>();
-        protected final Map<String, Severity> errors = new HashMap<String, Severity>();
+        protected final Map<Instruction.AssignmentInstruction, Severity> errors = new HashMap<Instruction.AssignmentInstruction, Severity>();
         protected final Map<String, Boolean> assertions = new HashMap<String, Boolean>();
 
@@ -131,5 +131,5 @@
                     if (ai.key.startsWith("throw")) {
                         final Severity severity = Severity.valueOf(ai.key.substring("throw".length()).toUpperCase());
-                        check.errors.put(val, severity);
+                        check.errors.put(ai, severity);
                     } else if ("fixAdd".equals(ai.key)) {
                         final PrimitiveToTag toTag = PrimitiveToTag.ofMapCSSObject(ai.val, false);
@@ -296,5 +296,5 @@
                 cmds.add(new ChangePropertyKeyCommand(p, oldKey, newKey));
             }
-            return new SequenceCommand(tr("Fix of {0}", getDescriptionForMatchingSelector(matchingSelector)), cmds);
+            return new SequenceCommand(tr("Fix of {0}", getDescriptionForMatchingSelector(p, matchingSelector)), cmds);
         }
 
@@ -304,6 +304,15 @@
          * @return a message
          */
-        String getMessage() {
-            return errors.isEmpty() ? null : errors.keySet().iterator().next();
+        String getMessage(OsmPrimitive p) {
+            if (errors.isEmpty()) {
+                return null;
+            } else {
+                final Object val = errors.keySet().iterator().next().val;
+                return String.valueOf(
+                        val instanceof Expression
+                                ? ((Expression) val).evaluate(new Environment().withPrimitive(p))
+                                : val
+                );
+            }
         }
 
@@ -312,12 +321,12 @@
          *
          * @return a description (possibly with alternative suggestions)
-         * @see #getDescriptionForMatchingSelector(Selector)
-         */
-        String getDescription() {
+         * @see #getDescriptionForMatchingSelector
+         */
+        String getDescription(OsmPrimitive p) {
             if (alternatives.isEmpty()) {
-                return getMessage();
+                return getMessage(p);
             } else {
                 /* I18N: {0} is the test error message and {1} is an alternative */
-                return tr("{0}, use {1} instead", getMessage(), Utils.join(tr(" or "), alternatives));
+                return tr("{0}, use {1} instead", getMessage(p), Utils.join(tr(" or "), alternatives));
             }
         }
@@ -329,6 +338,6 @@
          * @return a description (possibly with alternative suggestions)
          */
-        String getDescriptionForMatchingSelector(Selector matchingSelector) {
-            return insertArguments(matchingSelector, getDescription());
+        String getDescriptionForMatchingSelector(OsmPrimitive p, Selector matchingSelector) {
+            return insertArguments(matchingSelector, getDescription(p));
         }
 
@@ -339,5 +348,5 @@
         @Override
         public String toString() {
-            return getDescription();
+            return getDescription(null);
         }
 
@@ -355,5 +364,5 @@
             if (matchingSelector != null && !errors.isEmpty()) {
                 final Command fix = fixPrimitive(p);
-                final String description = getDescriptionForMatchingSelector(matchingSelector);
+                final String description = getDescriptionForMatchingSelector(p, matchingSelector);
                 if (fix != null) {
                     return new FixableTestError(null, getSeverity(), description, null, matchingSelector.toString(), 3000, p, fix);
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java	(revision 6675)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java	(revision 6677)
@@ -468,4 +468,5 @@
          * and the subsequent arguments are parameters for the string indicated by {@code {0}}, {@code {1}}, …
          */
+        @NullableArguments
         public static String tr(String... args) {
             final String text = args[0];
