Changeset 3053 in josm


Ignore:
Timestamp:
2010-02-27T15:46:00+01:00 (14 years ago)
Author:
jttt
Message:

Fix tests

Location:
trunk
Files:
2 edited

Legend:

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

    r3040 r3053  
    149149
    150150    /**
    151      * A way in the target dataset might be incomplete because at least one of its nodes is incomplete.
    152      * The nodes might have become complete because a complete node was merged into in the
    153      * merge operation.
    154      *
    155      * This method loops over all parent ways of such nodes and turns them into complete ways
    156      * if necessary.
    157      *
    158      * @param other
    159      */
    160     //TODO This method is probably useless
    161     protected void fixIncompleteParentWays(Node other) {
    162         Node myNode = (Node)getMergeTarget(other);
    163         if (myNode == null)
    164             throw new RuntimeException(tr("Missing merge target for node with id {0}", other.getUniqueId()));
    165         if (myNode.isIncomplete() || myNode.isDeleted() || !myNode.isVisible()) return;
    166     }
    167 
    168     /**
    169151     * Postprocess the dataset and fix all merged references to point to the actual
    170152     * data.
     
    188170            targetDataSet.unlinkReferencesToPrimitive(target);
    189171        }
    190         // objectsWithChildrenToMerge also includes complete nodes which have
    191         // been merged into their incomplete equivalents.
    192         //
    193         for (PrimitiveId id: objectsWithChildrenToMerge) {
    194             if (!id.getType().equals(OsmPrimitiveType.NODE)) {
    195                 continue;
    196             }
    197             Node n = (Node)sourceDataSet.getPrimitiveById(id);
    198             if (!conflicts.hasConflictForTheir(n)) {
    199                 fixIncompleteParentWays(n);
    200             }
    201         }
    202 
    203172    }
    204173
  • trunk/test/unit/org/openstreetmap/josm/data/osm/DataSetMergerTest.java

    r3034 r3053  
    292292    /**
    293293     * My and their node are new but semantically equal. My node is deleted.
    294      *
    295      * => create a conflict
    296      *
     294     *
     295     * => Ignore my node, no conflict
    297296     */
    298297    @Test
     
    309308        visitor.merge();
    310309
    311         assertEquals(1,visitor.getConflicts().size());
     310        assertEquals(0, visitor.getConflicts().size());
    312311        assertTrue(n.getDataSet() == my);
    313312        assertTrue(n1.getDataSet() == their);
Note: See TracChangeset for help on using the changeset viewer.