Changeset 3053 in josm
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/DataSetMerger.java
r3040 r3053 149 149 150 150 /** 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 the153 * merge operation.154 *155 * This method loops over all parent ways of such nodes and turns them into complete ways156 * if necessary.157 *158 * @param other159 */160 //TODO This method is probably useless161 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 /**169 151 * Postprocess the dataset and fix all merged references to point to the actual 170 152 * data. … … 188 170 targetDataSet.unlinkReferencesToPrimitive(target); 189 171 } 190 // objectsWithChildrenToMerge also includes complete nodes which have191 // 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 203 172 } 204 173 -
trunk/test/unit/org/openstreetmap/josm/data/osm/DataSetMergerTest.java
r3034 r3053 292 292 /** 293 293 * 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 297 296 */ 298 297 @Test … … 309 308 visitor.merge(); 310 309 311 assertEquals( 1,visitor.getConflicts().size());310 assertEquals(0, visitor.getConflicts().size()); 312 311 assertTrue(n.getDataSet() == my); 313 312 assertTrue(n1.getDataSet() == their);
Note:
See TracChangeset
for help on using the changeset viewer.