Ticket #4055: OsmPrimitive.compareTo.patch

File OsmPrimitive.compareTo.patch, 1.7 KB (added by mjulius, 12 years ago)
  • src/org/openstreetmap/josm/data/osm/Node.java

     
    160160    }
    161161
    162162    public int compareTo(OsmPrimitive o) {
    163         return o instanceof Node ? Long.valueOf(getId()).compareTo(o.getId()) : 1;
     163        return o instanceof Node ? Long.valueOf(getUniqueId()).compareTo(o.getUniqueId()) : 1;
    164164    }
    165165
    166166    @Override
  • src/org/openstreetmap/josm/data/osm/Relation.java

     
    230230    }
    231231
    232232    public int compareTo(OsmPrimitive o) {
    233         return o instanceof Relation ? Long.valueOf(getId()).compareTo(o.getId()) : -1;
     233        return o instanceof Relation ? Long.valueOf(getUniqueId()).compareTo(o.getUniqueId()) : -1;
    234234    }
    235235
    236236    // seems to be different from member "incomplete" - FIXME
  • src/org/openstreetmap/josm/data/osm/Way.java

     
    240240    public int compareTo(OsmPrimitive o) {
    241241        if (o instanceof Relation)
    242242            return 1;
    243         return o instanceof Way ? Long.valueOf(getId()).compareTo(o.getId()) : -1;
     243        return o instanceof Way ? Long.valueOf(getUniqueId()).compareTo(o.getUniqueId()) : -1;
    244244    }
    245245
    246246    public void removeNode(Node n) {