Index: trunk/src/org/openstreetmap/josm/data/osm/Node.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/Node.java	(revision 11291)
+++ trunk/src/org/openstreetmap/josm/data/osm/Node.java	(revision 11292)
@@ -298,17 +298,14 @@
     @Override
     public boolean hasEqualSemanticAttributes(OsmPrimitive other, boolean testInterestingTagsOnly) {
-        if (!(other instanceof Node))
-            return false;
-        if (!super.hasEqualSemanticAttributes(other, testInterestingTagsOnly))
-            return false;
-        Node n = (Node) other;
-        LatLon coor = getCoor();
-        LatLon otherCoor = n.getCoor();
-        if (coor == null && otherCoor == null)
-            return true;
-        else if (coor != null && otherCoor != null)
-            return coor.equalsEpsilon(otherCoor);
-        else
-            return false;
+        return (other instanceof Node)
+                && hasEqualSemanticFlags(other)
+                && hasEqualCoordinates((Node) other)
+                && super.hasEqualSemanticAttributes(other, testInterestingTagsOnly);
+    }
+
+    private boolean hasEqualCoordinates(Node other) {
+        final LatLon c1 = getCoor();
+        final LatLon c2 = other.getCoor();
+        return (c1 == null && c2 == null) || (c1 != null && c2 != null && c1.equalsEpsilon(c2));
     }
 
Index: trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java	(revision 11291)
+++ trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java	(revision 11292)
@@ -1188,10 +1188,15 @@
     }
 
-    boolean hasEqualSemanticAttributes(final OsmPrimitive other, final boolean testInterestingTagsOnly) {
+    boolean hasEqualSemanticFlags(final OsmPrimitive other) {
         if (!isNew() && id != other.id)
             return false;
         if (isIncomplete() ^ other.isIncomplete()) // exclusive or operator for performance (see #7159)
             return false;
-        return testInterestingTagsOnly ? hasSameInterestingTags(other) : getKeys().equals(other.getKeys());
+        return true;
+    }
+
+    boolean hasEqualSemanticAttributes(final OsmPrimitive other, final boolean testInterestingTagsOnly) {
+        return hasEqualSemanticFlags(other)
+                && (testInterestingTagsOnly ? hasSameInterestingTags(other) : getKeys().equals(other.getKeys()));
     }
 
Index: trunk/src/org/openstreetmap/josm/data/osm/Relation.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/Relation.java	(revision 11291)
+++ trunk/src/org/openstreetmap/josm/data/osm/Relation.java	(revision 11292)
@@ -303,10 +303,8 @@
     @Override
     public boolean hasEqualSemanticAttributes(OsmPrimitive other, boolean testInterestingTagsOnly) {
-        if (!(other instanceof Relation))
-            return false;
-        if (!super.hasEqualSemanticAttributes(other, testInterestingTagsOnly))
-            return false;
-        Relation r = (Relation) other;
-        return Arrays.equals(members, r.members);
+        return (other instanceof Relation)
+                && hasEqualSemanticFlags(other)
+                && Arrays.equals(members, ((Relation) other).members)
+                && super.hasEqualSemanticAttributes(other, testInterestingTagsOnly);
     }
 
Index: trunk/src/org/openstreetmap/josm/data/osm/Way.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/Way.java	(revision 11291)
+++ trunk/src/org/openstreetmap/josm/data/osm/Way.java	(revision 11292)
@@ -334,8 +334,8 @@
         if (!(other instanceof Way))
             return false;
+        Way w = (Way) other;
+        if (getNodesCount() != w.getNodesCount()) return false;
         if (!super.hasEqualSemanticAttributes(other, testInterestingTagsOnly))
             return false;
-        Way w = (Way) other;
-        if (getNodesCount() != w.getNodesCount()) return false;
         for (int i = 0; i < getNodesCount(); i++) {
             if (!getNode(i).hasEqualSemanticAttributes(w.getNode(i)))
