Index: trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java	(revision 9399)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java	(revision 9400)
@@ -83,9 +83,7 @@
 
     /**
-     * IconReference is used to remember the associated style source for
-     * each icon URL.
+     * IconReference is used to remember the associated style source for each icon URL.
      * This is necessary because image URLs can be paths relative
-     * to the source file and we have cascading of properties from different
-     * source files.
+     * to the source file and we have cascading of properties from different source files.
      */
     public static class IconReference {
@@ -106,6 +104,5 @@
 
     /**
-     * Image provider for icon. Note that this is a provider only. A @link{ImageProvider#get()} call may still
-     * fail!
+     * Image provider for icon. Note that this is a provider only. A @link{ImageProvider#get()} call may still fail!
      *
      * @param ref reference to the requested icon
@@ -124,5 +121,7 @@
                 .setOptional(true);
         if (test && i.get() == null) {
-            Main.warn("Mappaint style \""+namespace+"\" ("+ref.source.getDisplayString()+") icon \"" + ref.iconName + "\" not found.");
+            String msg = "Mappaint style \""+namespace+"\" ("+ref.source.getDisplayString()+") icon \"" + ref.iconName + "\" not found.";
+            ref.source.logWarning(msg);
+            Main.warn(msg);
             return null;
         }
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTest.java	(revision 9399)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTest.java	(revision 9400)
@@ -14,5 +14,11 @@
 import org.openstreetmap.josm.JOSMFixture;
 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles;
+import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.IconReference;
+import org.openstreetmap.josm.gui.mappaint.StyleKeys;
 import org.openstreetmap.josm.gui.mappaint.StyleSource;
+import org.openstreetmap.josm.gui.mappaint.mapcss.Instruction;
+import org.openstreetmap.josm.gui.mappaint.mapcss.Instruction.AssignmentInstruction;
+import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSRule;
+import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource;
 import org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException;
 import org.openstreetmap.josm.gui.preferences.SourceEditor.ExtendedSourceEntry;
@@ -48,4 +54,21 @@
                 System.out.println(source.url);
                 StyleSource style = MapPaintStyles.addStyle(source);
+                if (style instanceof MapCSSStyleSource) {
+                    // Force loading of all icons to detect missing ones
+                    for (MapCSSRule rule : ((MapCSSStyleSource) style).rules) {
+                        for (Instruction instruction : rule.declaration.instructions) {
+                            if (instruction instanceof AssignmentInstruction) {
+                                AssignmentInstruction ai = (AssignmentInstruction) instruction;
+                                if (StyleKeys.ICON_IMAGE.equals(ai.key)
+                                 || StyleKeys.FILL_IMAGE.equals(ai.key)
+                                 || StyleKeys.REPEAT_IMAGE.equals(ai.key)) {
+                                    if (ai.val instanceof String) {
+                                        MapPaintStyles.getIconProvider(new IconReference((String) ai.val, style), true);
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
                 System.out.println(style.isValid() ? " => OK" : " => KO");
                 Collection<Throwable> errors = style.getErrors();
