Changeset 17240 in josm for trunk/src/org
- Timestamp:
- 2020-10-19T10:56:31+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/command/AddPrimitivesCommand.java
r16436 r17240 100 100 // a subsequent command (e.g. MoveCommand) cannot be redone. 101 101 for (OsmPrimitive osm : createdPrimitives) { 102 if (preExistingData.stream().anyMatch(pd -> pd.getUniqueId() == osm.getUniqueId())) { 103 Optional<PrimitiveData> o = data.stream().filter(pd -> pd.getUniqueId() == osm.getUniqueId()).findAny(); 102 if (preExistingData.stream().anyMatch(pd -> pd.getPrimitiveId().equals(osm.getPrimitiveId()))) { 103 Optional<PrimitiveData> o = data.stream() 104 .filter(pd -> pd.getPrimitiveId().equals(osm.getPrimitiveId())).findAny(); 104 105 if (o.isPresent()) { 105 106 osm.load(o.get()); … … 126 127 createdPrimitives = PurgeCommand.topoSort(createdPrimitives); 127 128 } 128 for (OsmPrimitive osm : createdPrimitives) { 129 Optional<PrimitiveData> previous = preExistingData.stream().filter(pd -> pd.getUniqueId() == osm.getUniqueId()).findAny(); 129 // reversed order, see #14620 130 for (int i = createdPrimitives.size() - 1; i >= 0; i--) { 131 OsmPrimitive osm = createdPrimitives.get(i); 132 Optional<PrimitiveData> previous = preExistingData.stream() 133 .filter(pd -> pd.getPrimitiveId().equals(osm.getPrimitiveId())).findAny(); 130 134 if (previous.isPresent()) { 131 135 osm.load(previous.get());
Note:
See TracChangeset
for help on using the changeset viewer.