Index: trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/DataSet.java	(revision 2459)
+++ trunk/src/org/openstreetmap/josm/data/osm/DataSet.java	(revision 2460)
@@ -874,15 +874,14 @@
 
 
-    // TODO Should be part of validator
-    // This used to be OsmPrimitive.errors. I don't really like that such information is kept here,
-    // but at least it's not such memory waste as having it in (every) OsmPrimitive
+    // TODO Should be completely part of validator
     private Map<OsmPrimitive, List<String>> errors = new HashMap<OsmPrimitive, List<String>>();
 
-    void setErrors(OsmPrimitive primitive, List<String> errors) {
-        if (errors != null && !errors.isEmpty()) {
-            this.errors.put(primitive, errors);
-        } else {
-            this.errors.remove(primitive);
-        }
+    public void addError(OsmPrimitive primitive, String error) {
+        List<String> perrors = errors.get(primitive);
+        if (perrors == null) {
+            perrors = new ArrayList<String>();
+        }
+        perrors.add(error);
+        errors.put(primitive, perrors);
     }
 
@@ -890,3 +889,8 @@
         return errors.get(primitive);
     }
+
+    public void clearErrors()
+    {
+        errors.clear();
+    }
 }
Index: trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java	(revision 2459)
+++ trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java	(revision 2460)
@@ -99,28 +99,4 @@
     public Integer mappaintDrawnCode = 0;
 
-    public void putError(String text, boolean isError)
-    {
-        checkDataset();
-        List<String> errors = dataSet.getErrors(this);
-        if (errors == null) {
-            errors = new ArrayList<String>();
-        }
-        String s = isError ? tr("Error: {0}", text) : tr("Warning: {0}", text);
-        errors.add(s);
-        dataSet.setErrors(this, errors);
-    }
-    public void clearErrors()
-    {
-        if (dataSet != null) {
-            dataSet.setErrors(this, null);
-        }
-    }
-
-    public List<String> getErrors() {
-        if (dataSet == null)
-            return null;
-        else
-            return dataSet.getErrors(this);
-    }
     /* This should not be called from outside. Fixing the UI to add relevant
        get/set functions calling this implicitely is preferred, so we can have
@@ -154,5 +130,5 @@
 
     /**
-     * 
+     *
      * @return DataSet this primitive is part of.
      */
@@ -736,10 +712,10 @@
      * Find primitives that reference this primitive. Returns only primitives that are included in the same
      * dataset as this primitive. <br>
-     * 
+     *
      * For example following code will add wnew as referer to all nodes of existingWay, but this method will
      * not return wnew because it's not part of the dataset <br>
-     * 
+     *
      * <code>Way wnew = new Way(existingWay)</code>
-     * 
+     *
      * @return a collection of all primitives that reference this primitive.
      */
@@ -809,8 +785,8 @@
     /**
      * Merges the technical and semantical attributes from <code>other</code> onto this.
-     * 
+     *
      * Both this and other must be new, or both must be assigned an OSM ID. If both this and <code>other</code>
      * have an assigend OSM id, the IDs have to be the same.
-     * 
+     *
      * @param other the other primitive. Must not be null.
      * @throws IllegalArgumentException thrown if other is null.
@@ -1032,5 +1008,5 @@
     /**
      * Replies the unique primitive id for this primitive
-     * 
+     *
      * @return the unique primitive id for this primitive
      */
Index: trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java	(revision 2459)
+++ trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java	(revision 2460)
@@ -217,8 +217,4 @@
             return;
 
-        if(fillAreas > dist) {
-            w.clearErrors();
-        }
-
         if(wayStyle==null)
         {
@@ -246,5 +242,5 @@
                 drawArea(w, data.isSelected(w) ? selectedColor : areaStyle.color);
                 if(!w.isClosed()) {
-                    w.putError(tr("Area style way is not closed."), true);
+                    putError(w, tr("Area style way is not closed."), true);
                 }
             }
@@ -479,5 +475,5 @@
                 if(errs != null)
                 {
-                    errs.putError(tr("multipolygon way ''{0}'' is not closed.",
+                    putError(errs, tr("multipolygon way ''{0}'' is not closed.",
                             w.getDisplayName(DefaultNameFormatter.getInstance())), true);
                 }
@@ -556,6 +552,4 @@
         //    System.out.println("Restriction: " + r.keys.get("name") + " restriction " + r.keys.get("restriction"));
 
-        r.clearErrors();
-
         Way fromWay = null;
         Way toWay = null;
@@ -569,5 +563,5 @@
 
             if (m.getMember().isDeleted()) {
-                r.putError(tr("Deleted member ''{0}'' in relation.",
+                putError(r, tr("Deleted member ''{0}'' in relation.",
                         m.getMember().getDisplayName(DefaultNameFormatter.getInstance())), true);
             } else if(m.getMember().incomplete)
@@ -580,10 +574,10 @@
                     if(w.getNodesCount() < 2)
                     {
-                        r.putError(tr("Way ''{0}'' with less than two points.",
+                        putError(r, tr("Way ''{0}'' with less than two points.",
                                 w.getDisplayName(DefaultNameFormatter.getInstance())), true);
                     }
                     else if("from".equals(m.getRole())) {
                         if(fromWay != null) {
-                            r.putError(tr("More than one \"from\" way found."), true);
+                            putError(r, tr("More than one \"from\" way found."), true);
                         } else {
                             fromWay = w;
@@ -591,5 +585,5 @@
                     } else if("to".equals(m.getRole())) {
                         if(toWay != null) {
-                            r.putError(tr("More than one \"to\" way found."), true);
+                            putError(r, tr("More than one \"to\" way found."), true);
                         } else {
                             toWay = w;
@@ -597,10 +591,10 @@
                     } else if("via".equals(m.getRole())) {
                         if(via != null) {
-                            r.putError(tr("More than one \"via\" found."), true);
+                            putError(r, tr("More than one \"via\" found."), true);
                         } else {
                             via = w;
                         }
                     } else {
-                        r.putError(tr("Unknown role ''{0}''.", m.getRole()), true);
+                        putError(r, tr("Unknown role ''{0}''.", m.getRole()), true);
                     }
                 }
@@ -611,13 +605,13 @@
                     {
                         if(via != null) {
-                            r.putError(tr("More than one \"via\" found."), true);
+                            putError(r, tr("More than one \"via\" found."), true);
                         } else {
                             via = n;
                         }
                     } else {
-                        r.putError(tr("Unknown role ''{0}''.", m.getRole()), true);
+                        putError(r, tr("Unknown role ''{0}''.", m.getRole()), true);
                     }
                 } else {
-                    r.putError(tr("Unknown member type for ''{0}''.", m.getMember().getDisplayName(DefaultNameFormatter.getInstance())), true);
+                    putError(r, tr("Unknown member type for ''{0}''.", m.getMember().getDisplayName(DefaultNameFormatter.getInstance())), true);
                 }
             }
@@ -625,13 +619,13 @@
 
         if (fromWay == null) {
-            r.putError(tr("No \"from\" way found."), true);
+            putError(r, tr("No \"from\" way found."), true);
             return;
         }
         if (toWay == null) {
-            r.putError(tr("No \"to\" way found."), true);
+            putError(r, tr("No \"to\" way found."), true);
             return;
         }
         if (via == null) {
-            r.putError(tr("No \"via\" node or way found."), true);
+            putError(r, tr("No \"via\" node or way found."), true);
             return;
         }
@@ -642,9 +636,9 @@
             viaNode = (Node) via;
             if(!fromWay.isFirstLastNode(viaNode)) {
-                r.putError(tr("The \"from\" way doesn't start or end at a \"via\" node."), true);
+                putError(r, tr("The \"from\" way doesn't start or end at a \"via\" node."), true);
                 return;
             }
             if(!toWay.isFirstLastNode(viaNode)) {
-                r.putError(tr("The \"to\" way doesn't start or end at a \"via\" node."), true);
+                putError(r, tr("The \"to\" way doesn't start or end at a \"via\" node."), true);
             }
         }
@@ -673,9 +667,9 @@
                 viaNode = lastNode;
             } else {
-                r.putError(tr("The \"from\" way doesn't start or end at the \"via\" way."), true);
+                putError(r, tr("The \"from\" way doesn't start or end at the \"via\" way."), true);
                 return;
             }
             if(!toWay.isFirstLastNode(viaNode == firstNode ? lastNode : firstNode)) {
-                r.putError(tr("The \"to\" way doesn't start or end at the \"via\" way."), true);
+                putError(r, tr("The \"to\" way doesn't start or end at the \"via\" way."), true);
             }
         }
@@ -800,5 +794,5 @@
 
         if (nodeStyle == null) {
-            r.putError(tr("Style for restriction {0} not found.", r.get("restriction")), true);
+            putError(r, tr("Style for restriction {0} not found.", r.get("restriction")), true);
             return;
         }
@@ -894,5 +888,5 @@
                 if(c > 1 && pdOuter.way != null && pdOuter.way.isClosed())
                 {
-                    r.putError(tr("Intersection between ways ''{0}'' and ''{1}''.",
+                    putError(r, tr("Intersection between ways ''{0}'' and ''{1}''.",
                             pdOuter.way.getDisplayName(DefaultNameFormatter.getInstance()), wInner.getDisplayName(DefaultNameFormatter.getInstance())), true);
                 }
@@ -906,5 +900,5 @@
             if(!incomplete)
             {
-                r.putError(tr("Inner way ''{0}'' is outside.",
+                putError(r, tr("Inner way ''{0}'' is outside.",
                         wInner.getDisplayName(DefaultNameFormatter.getInstance())), true);
             }
@@ -922,10 +916,8 @@
         Boolean drawn = false;
 
-        r.clearErrors();
-
         for (RelationMember m : r.getMembers())
         {
             if (m.getMember().isDeleted()) {
-                r.putError(tr("Deleted member ''{0}'' in relation.",
+                putError(r, tr("Deleted member ''{0}'' in relation.",
                         m.getMember().getDisplayName(DefaultNameFormatter.getInstance())), true);
             } else if(m.getMember().incomplete) {
@@ -935,5 +927,5 @@
                     Way w = m.getWay();
                     if(w.getNodesCount() < 2) {
-                        r.putError(tr("Way ''{0}'' with less than two points.",
+                        putError(r, tr("Way ''{0}'' with less than two points.",
                                 w.getDisplayName(DefaultNameFormatter.getInstance())), true);
                     }
@@ -943,5 +935,5 @@
                         outer.add(w);
                     } else {
-                        r.putError(tr("No useful role ''{0}'' for Way ''{1}''.",
+                        putError(r, tr("No useful role ''{0}'' for Way ''{1}''.",
                                 m.getRole(), w.getDisplayName(DefaultNameFormatter.getInstance())), true);
                         if(!m.hasRole()) {
@@ -955,5 +947,5 @@
                 else
                 {
-                    r.putError(tr("Non-Way ''{0}'' in multipolygon.",
+                    putError(r, tr("Non-Way ''{0}'' in multipolygon.",
                             m.getMember().getDisplayName(DefaultNameFormatter.getInstance())), true);
                 }
@@ -999,5 +991,5 @@
             if(outerclosed.size() == 0 && outerjoin.size() == 0)
             {
-                r.putError(tr("No outer way for multipolygon ''{0}''.",
+                putError(r, tr("No outer way for multipolygon ''{0}''.",
                         r.getDisplayName(DefaultNameFormatter.getInstance())), true);
                 visible = true; /* prevent killing remaining ways */
@@ -1059,5 +1051,5 @@
                     if(wayStyle.equals(innerStyle))
                     {
-                        r.putError(tr("Style for inner way ''{0}'' equals multipolygon.",
+                        putError(r, tr("Style for inner way ''{0}'' equals multipolygon.",
                                 wInner.getDisplayName(DefaultNameFormatter.getInstance())), false);
                         if(!data.isSelected(r)) {
@@ -1089,5 +1081,5 @@
                             && !wayStyle.equals(outerStyle))
                     {
-                        r.putError(tr("Style for outer way ''{0}'' mismatches.",
+                        putError(r, tr("Style for outer way ''{0}'' mismatches.",
                                 wOuter.getDisplayName(DefaultNameFormatter.getInstance())), true);
                     }
@@ -1464,4 +1456,5 @@
         maxEN = nc.getEastNorth(nc.getWidth() - 1, 0);
 
+        data.clearErrors();
 
         ++paintid;
@@ -1645,3 +1638,8 @@
         drawOrderNumber(p1, p2, orderNumber);
     }
+
+    public void putError(OsmPrimitive p, String text, boolean isError)
+    {
+        data.addError(p, isError ? tr("Error: {0}", text) : tr("Warning: {0}", text));
+    }
 }
