- Timestamp:
- 2016-11-22T15:42:54+01:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/osm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/Node.java
r11269 r11292 298 298 @Override 299 299 public boolean hasEqualSemanticAttributes(OsmPrimitive other, boolean testInterestingTagsOnly) { 300 if (!(other instanceof Node)) 301 return false; 302 if (!super.hasEqualSemanticAttributes(other, testInterestingTagsOnly)) 303 return false; 304 Node n = (Node) other; 305 LatLon coor = getCoor(); 306 LatLon otherCoor = n.getCoor(); 307 if (coor == null && otherCoor == null) 308 return true; 309 else if (coor != null && otherCoor != null) 310 return coor.equalsEpsilon(otherCoor); 311 else 312 return false; 300 return (other instanceof Node) 301 && hasEqualSemanticFlags(other) 302 && hasEqualCoordinates((Node) other) 303 && super.hasEqualSemanticAttributes(other, testInterestingTagsOnly); 304 } 305 306 private boolean hasEqualCoordinates(Node other) { 307 final LatLon c1 = getCoor(); 308 final LatLon c2 = other.getCoor(); 309 return (c1 == null && c2 == null) || (c1 != null && c2 != null && c1.equalsEpsilon(c2)); 313 310 } 314 311 -
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r11291 r11292 1188 1188 } 1189 1189 1190 boolean hasEqualSemantic Attributes(final OsmPrimitive other, final boolean testInterestingTagsOnly) {1190 boolean hasEqualSemanticFlags(final OsmPrimitive other) { 1191 1191 if (!isNew() && id != other.id) 1192 1192 return false; 1193 1193 if (isIncomplete() ^ other.isIncomplete()) // exclusive or operator for performance (see #7159) 1194 1194 return false; 1195 return testInterestingTagsOnly ? hasSameInterestingTags(other) : getKeys().equals(other.getKeys()); 1195 return true; 1196 } 1197 1198 boolean hasEqualSemanticAttributes(final OsmPrimitive other, final boolean testInterestingTagsOnly) { 1199 return hasEqualSemanticFlags(other) 1200 && (testInterestingTagsOnly ? hasSameInterestingTags(other) : getKeys().equals(other.getKeys())); 1196 1201 } 1197 1202 -
trunk/src/org/openstreetmap/josm/data/osm/Relation.java
r11269 r11292 303 303 @Override 304 304 public boolean hasEqualSemanticAttributes(OsmPrimitive other, boolean testInterestingTagsOnly) { 305 if (!(other instanceof Relation)) 306 return false; 307 if (!super.hasEqualSemanticAttributes(other, testInterestingTagsOnly)) 308 return false; 309 Relation r = (Relation) other; 310 return Arrays.equals(members, r.members); 305 return (other instanceof Relation) 306 && hasEqualSemanticFlags(other) 307 && Arrays.equals(members, ((Relation) other).members) 308 && super.hasEqualSemanticAttributes(other, testInterestingTagsOnly); 311 309 } 312 310 -
trunk/src/org/openstreetmap/josm/data/osm/Way.java
r11269 r11292 334 334 if (!(other instanceof Way)) 335 335 return false; 336 Way w = (Way) other; 337 if (getNodesCount() != w.getNodesCount()) return false; 336 338 if (!super.hasEqualSemanticAttributes(other, testInterestingTagsOnly)) 337 339 return false; 338 Way w = (Way) other;339 if (getNodesCount() != w.getNodesCount()) return false;340 340 for (int i = 0; i < getNodesCount(); i++) { 341 341 if (!getNode(i).hasEqualSemanticAttributes(w.getNode(i)))
Note:
See TracChangeset
for help on using the changeset viewer.