Changeset 21639 in osm for applications/editors
- Timestamp:
- 2010-06-11T00:27:15+02:00 (14 years ago)
- Location:
- applications/editors/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/reverter/src/reverter/ChangesetReverter.java
r21634 r21639 203 203 toDelete.add(dp); 204 204 } 205 // Check object version 205 } 206 207 // Check objects version 208 Iterator<ChangesetDataSetEntry> iterator = cds.iterator(); 209 while (iterator.hasNext()) { 210 ChangesetDataSetEntry entry = iterator.next(); 211 HistoryOsmPrimitive p = entry.getPrimitive(); 212 OsmPrimitive dp = ds.getPrimitiveById(p.getPrimitiveId()); 213 if (dp == null) 214 throw new IllegalStateException(tr("Missing merge target for {0} with id {1}", 215 p.getType(), p.getId())); 216 OsmPrimitive np = nds.getPrimitiveById(p.getPrimitiveId()); 217 if (np == null && entry.getModificationType() != ChangesetModificationType.CREATED) 218 throw new IllegalStateException(tr("Missing new dataset object for {0} with id {1}", 219 p.getType(), p.getId())); 206 220 if (p.getVersion() != dp.getVersion() 207 221 && (p.isVisible() || dp.isVisible())) { … … 209 223 switch (dp.getType()) { 210 224 case NODE: 211 c = new Conflict<Node>((Node)p,new Node((Node)dp),!p.isVisible()); 225 if (np == null) { 226 np = new Node((Node)dp); 227 np.setDeleted(true); 228 } 229 c = new Conflict<Node>((Node)np,new Node((Node)dp), 230 entry.getModificationType() == ChangesetModificationType.CREATED); 212 231 break; 213 232 case WAY: 214 c = new Conflict<Way>((Way)p,new Way((Way)dp),!p.isVisible()); 233 if (np == null) { 234 np = new Way((Way)dp); 235 np.setDeleted(true); 236 } 237 c = new Conflict<Way>((Way)np,new Way((Way)dp), 238 entry.getModificationType() == ChangesetModificationType.CREATED); 215 239 break; 216 240 case RELATION: 217 c = new Conflict<Relation>((Relation)p,new Relation((Relation)dp),!p.isVisible()); 241 if (np == null) { 242 np = new Relation((Relation)dp); 243 np.setDeleted(true); 244 } 245 c = new Conflict<Relation>((Relation)np,new Relation((Relation)dp), 246 entry.getModificationType() == ChangesetModificationType.CREATED); 218 247 break; 219 248 default: throw new AssertionError();
Note:
See TracChangeset
for help on using the changeset viewer.