Changeset 12113 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2017-05-11T01:26:34+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/DataSelectionListener.java
r12097 r12113 133 133 public SelectionReplaceEvent(DataSet source, Set<OsmPrimitive> old, Stream<OsmPrimitive> newSelection) { 134 134 super(source, old); 135 this.current = newSelection.collect(Collectors.to Set());135 this.current = newSelection.collect(Collectors.toCollection(LinkedHashSet::new)); 136 136 } 137 137 … … 144 144 public synchronized Set<OsmPrimitive> getRemoved() { 145 145 if (removed == null) { 146 removed = getOldSelection().stream().filter(p -> !current.contains(p)).collect(Collectors.toSet()); 146 removed = getOldSelection().stream() 147 .filter(p -> !current.contains(p)) 148 .collect(Collectors.toCollection(LinkedHashSet::new)); 147 149 } 148 150 return removed; … … 152 154 public synchronized Set<OsmPrimitive> getAdded() { 153 155 if (added == null) { 154 added = current.stream().filter(p -> !getOldSelection().contains(p)).collect(Collectors.toSet()); 156 added = current.stream() 157 .filter(p -> !getOldSelection().contains(p)).collect(Collectors.toCollection(LinkedHashSet::new)); 155 158 } 156 159 return added; … … 175 178 public SelectionAddEvent(DataSet source, Set<OsmPrimitive> old, Stream<OsmPrimitive> toAdd) { 176 179 super(source, old); 177 this.add = toAdd.filter(p -> !old.contains(p)).collect(Collectors.toSet()); 180 this.add = toAdd 181 .filter(p -> !old.contains(p)) 182 .collect(Collectors.toCollection(LinkedHashSet::new)); 178 183 if (this.add.isEmpty()) { 179 184 this.current = this.getOldSelection(); … … 217 222 public SelectionRemoveEvent(DataSet source, Set<OsmPrimitive> old, Stream<OsmPrimitive> toRemove) { 218 223 super(source, old); 219 this.remove = toRemove.filter(old::contains).collect(Collectors.toSet()); 224 this.remove = toRemove 225 .filter(old::contains) 226 .collect(Collectors.toCollection(LinkedHashSet::new)); 220 227 if (this.remove.isEmpty()) { 221 228 this.current = this.getOldSelection();
Note:
See TracChangeset
for help on using the changeset viewer.