From 42a4454fba42b259736d267f9d860542fa937179 Mon Sep 17 00:00:00 2001
From: Matthew W. S. Bell <matthew@bells23.org.uk>
Date: Sat, 7 Aug 2010 01:00:22 +0100
Subject: [PATCH 4/4] Whitespace
---
.../openstreetmap/josm/data/osm/DataSetMerger.java | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/org/openstreetmap/josm/data/osm/DataSetMerger.java b/src/org/openstreetmap/josm/data/osm/DataSetMerger.java
index e1d8f30..a76a7ec 100644
|
a
|
b
|
public class DataSetMerger {
|
| 92 | 92 | // yet but which is equal in its semantic attributes |
| 93 | 93 | // |
| 94 | 94 | Collection<? extends OsmPrimitive> candidates = null; |
| 95 | | switch(source.getType()) { |
| | 95 | switch (source.getType()) { |
| 96 | 96 | case NODE: candidates = targetDataSet.getNodes(); break; |
| 97 | | case WAY: candidates =targetDataSet.getWays(); break; |
| | 97 | case WAY: candidates = targetDataSet.getWays(); break; |
| 98 | 98 | case RELATION: candidates = targetDataSet.getRelations(); break; |
| 99 | 99 | default: throw new AssertionError(); |
| 100 | 100 | } |
| … |
… |
public class DataSetMerger {
|
| 132 | 132 | objectsWithChildrenToMerge.add(source.getPrimitiveId()); |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | | protected OsmPrimitive getMergeTarget(OsmPrimitive mergeSource) throws IllegalStateException{ |
| | 135 | protected OsmPrimitive getMergeTarget(OsmPrimitive mergeSource) throws IllegalStateException { |
| 136 | 136 | PrimitiveId targetId = mergedMap.get(mergeSource.getPrimitiveId()); |
| 137 | 137 | if (targetId == null) |
| 138 | 138 | return null; |
| … |
… |
public class DataSetMerger {
|
| 256 | 256 | // target and source are incomplete. Doesn't matter which one to |
| 257 | 257 | // take. We take target. |
| 258 | 258 | // |
| 259 | | } else if (target.isDeleted() && ! source.isDeleted() && target.getVersion() == source.getVersion()) { |
| | 259 | } else if (target.isDeleted() && !source.isDeleted() && target.getVersion() == source.getVersion()) { |
| 260 | 260 | // same version, but target is deleted. Assume target takes precedence |
| 261 | 261 | // otherwise too many conflicts when refreshing from the server |
| 262 | 262 | // but, if source has a referrer that is not in the target dataset there is a conflict |
| … |
… |
public class DataSetMerger {
|
| 273 | 273 | // happen if one layer is merged onto another layer |
| 274 | 274 | // |
| 275 | 275 | conflicts.add(target,source); |
| 276 | | } else if (! target.isModified() && source.isModified()) { |
| | 276 | } else if (!target.isModified() && source.isModified()) { |
| 277 | 277 | // target not modified. We can assume that source is the most recent version. |
| 278 | 278 | // clone it into target. But check first, whether source is deleted. if so, |
| 279 | 279 | // make sure that target is not referenced any more in myDataSet. If it is there |
| … |
… |
public class DataSetMerger {
|
| 286 | 286 | target.mergeFrom(source); |
| 287 | 287 | objectsWithChildrenToMerge.add(source.getPrimitiveId()); |
| 288 | 288 | } |
| 289 | | } else if (! target.isModified() && !source.isModified() && target.getVersion() == source.getVersion()) { |
| | 289 | } else if (!target.isModified() && !source.isModified() && target.getVersion() == source.getVersion()) { |
| 290 | 290 | // both not modified. Merge nevertheless. |
| 291 | 291 | // This helps when updating "empty" relations, see #4295 |
| 292 | 292 | target.mergeFrom(source); |
| 293 | 293 | objectsWithChildrenToMerge.add(source.getPrimitiveId()); |
| 294 | | } else if (! target.isModified() && !source.isModified() && target.getVersion() < source.getVersion()) { |
| | 294 | } else if (!target.isModified() && !source.isModified() && target.getVersion() < source.getVersion()) { |
| 295 | 295 | // my not modified but other is newer. clone other onto mine. |
| 296 | 296 | // |
| 297 | 297 | target.mergeFrom(source); |
| 298 | 298 | objectsWithChildrenToMerge.add(source.getPrimitiveId()); |
| 299 | | } else if (target.isModified() && ! source.isModified() && target.getVersion() == source.getVersion()) { |
| | 299 | } else if (target.isModified() && !source.isModified() && target.getVersion() == source.getVersion()) { |
| 300 | 300 | // target is same as source but target is modified |
| 301 | 301 | // => keep target and reset modified flag if target and source are semantically equal |
| 302 | 302 | if (target.hasEqualSemanticAttributes(source)) { |
| 303 | 303 | target.setModified(false); |
| 304 | 304 | } |
| 305 | | } else if (! target.hasEqualSemanticAttributes(source)) { |
| | 305 | } else if (!target.hasEqualSemanticAttributes(source)) { |
| 306 | 306 | // target is modified and is not semantically equal with source. Can't automatically |
| 307 | 307 | // resolve the differences |
| 308 | 308 | // => create a conflict |