Changeset 9979 in josm


Ignore:
Timestamp:
2016-03-13T01:17:21+01:00 (3 years ago)
Author:
Don-vip
Message:

see #12599, fix #12616 - Random repositioning of nodes (incomplete fix from r9961)

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/Node.java

    r9243 r9979  
    281281
    282282    @Override
    283     public boolean hasEqualSemanticAttributes(OsmPrimitive other) {
     283    public boolean hasEqualSemanticAttributes(OsmPrimitive other, boolean testInterestingTagsOnly) {
    284284        if (!(other instanceof Node))
    285285            return false;
    286         if (!super.hasEqualSemanticAttributes(other))
     286        if (!super.hasEqualSemanticAttributes(other, testInterestingTagsOnly))
    287287            return false;
    288288        Node n = (Node) other;
  • trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java

    r9970 r9979  
    12371237     * @return true if this primitive and other are equal with respect to their semantic attributes.
    12381238     */
    1239     public boolean hasEqualSemanticAttributes(OsmPrimitive other) {
     1239    public final boolean hasEqualSemanticAttributes(OsmPrimitive other) {
    12401240        return hasEqualSemanticAttributes(other, true);
    12411241    }
  • trunk/src/org/openstreetmap/josm/data/osm/Relation.java

    r9716 r9979  
    287287
    288288    @Override
    289     public boolean hasEqualSemanticAttributes(OsmPrimitive other) {
     289    public boolean hasEqualSemanticAttributes(OsmPrimitive other, boolean testInterestingTagsOnly) {
    290290        if (!(other instanceof Relation))
    291291            return false;
    292         if (!super.hasEqualSemanticAttributes(other))
     292        if (!super.hasEqualSemanticAttributes(other, testInterestingTagsOnly))
    293293            return false;
    294294        Relation r = (Relation) other;
  • trunk/src/org/openstreetmap/josm/data/osm/Way.java

    r9460 r9979  
    331331
    332332    @Override
    333     public boolean hasEqualSemanticAttributes(OsmPrimitive other) {
     333    public boolean hasEqualSemanticAttributes(OsmPrimitive other, boolean testInterestingTagsOnly) {
    334334        if (!(other instanceof Way))
    335335            return false;
    336         if (!super.hasEqualSemanticAttributes(other))
     336        if (!super.hasEqualSemanticAttributes(other, testInterestingTagsOnly))
    337337            return false;
    338338        Way w = (Way) other;
  • trunk/test/unit/org/openstreetmap/josm/data/osm/DataSetMergerTest.java

    r9961 r9979  
    10341034    }
    10351035
     1036
     1037    /**
     1038     * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/12616">Bug #12616</a>.
     1039     */
     1040    @Test
     1041    public void testTicket12616() {
     1042        // Server node: no modifications
     1043        Node n1 = new Node(1, 1);
     1044        n1.setCoor(LatLon.ZERO);
     1045        assertFalse(n1.isModified());
     1046        their.addPrimitive(n1);
     1047
     1048        // Local node: one modification: move
     1049        Node n1b = new Node(n1);
     1050        n1b.setCoor(new LatLon(1, 1));
     1051        n1b.setModified(true);
     1052        assertTrue(n1b.isModified());
     1053        assertEquals(new LatLon(1, 1), n1b.getCoor());
     1054        my.addPrimitive(n1b);
     1055
     1056        // Merge
     1057        DataSetMerger visitor = new DataSetMerger(my, their);
     1058        visitor.merge();
     1059
     1060        // Check that modification is still here
     1061        Node n = (Node) my.getPrimitiveById(1, OsmPrimitiveType.NODE);
     1062        assertNotNull(n);
     1063        assertEquals(new LatLon(1, 1), n.getCoor());
     1064        assertTrue(n.isModified());
     1065
     1066        // Merge again
     1067        visitor = new DataSetMerger(my, their);
     1068        visitor.merge();
     1069
     1070        // Check that modification is still here
     1071        n = (Node) my.getPrimitiveById(1, OsmPrimitiveType.NODE);
     1072        assertNotNull(n);
     1073        assertEquals(new LatLon(1, 1), n.getCoor());
     1074        assertTrue(n.isModified());
     1075    }
    10361076}
Note: See TracChangeset for help on using the changeset viewer.