Index: /trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java	(revision 2480)
+++ /trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java	(revision 2481)
@@ -41,5 +41,5 @@
     }
 
-    private static class KeysEntry implements Entry<String, String> {
+    private static class KeysEntry implements Entry<String, String>{
 
         private final String key;
@@ -63,4 +63,34 @@
         }
 
+        @Override
+        public int hashCode() {
+            final int prime = 31;
+            int result = 1;
+            result = prime * result + ((key == null) ? 0 : key.hashCode());
+            result = prime * result + ((value == null) ? 0 : value.hashCode());
+            return result;
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj)
+                return true;
+            if (obj == null)
+                return false;
+            if (getClass() != obj.getClass())
+                return false;
+            KeysEntry other = (KeysEntry) obj;
+            if (key == null) {
+                if (other.key != null)
+                    return false;
+            } else if (!key.equals(other.key))
+                return false;
+            if (value == null) {
+                if (other.value != null)
+                    return false;
+            } else if (!value.equals(other.value))
+                return false;
+            return true;
+        }
     }
 
@@ -142,4 +172,5 @@
     private long id = 0;
 
+    /** the parent dataset */
     private DataSet dataSet;
 
@@ -908,5 +939,5 @@
         if (incomplete && ! other.incomplete || !incomplete  && other.incomplete)
             return false;
-        return (keys == null ? other.keys==null : keys.equals(other.keys));
+        return keySet().equals(other.keySet());
     }
 
