Changeset 11115 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2016-10-11T19:05:20+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/Changeset.java
r10378 r11115 208 208 public void setKeys(Map<String, String> keys) { 209 209 CheckParameterUtil.ensureParameterNotNull(keys, "keys"); 210 for (String value : keys.values()) { 211 if (value != null && value.length() > MAX_CHANGESET_TAG_LENGTH) { 210 keys.values().stream() 211 .filter(value -> (value != null && value.length() > MAX_CHANGESET_TAG_LENGTH)) 212 .findFirst() 213 .ifPresent(value -> { 212 214 throw new IllegalArgumentException("Changeset tag value is too long: "+value); 213 } 214 } 215 }); 215 216 this.tags = keys; 216 217 } -
trunk/src/org/openstreetmap/josm/data/osm/ChangesetCache.java
r10763 r11115 10 10 import java.util.Set; 11 11 import java.util.concurrent.CopyOnWriteArrayList; 12 import java.util.stream.Collectors; 12 13 13 14 import org.openstreetmap.josm.Main; … … 183 184 */ 184 185 public List<Changeset> getOpenChangesets() { 185 List<Changeset> ret = new ArrayList<>(); 186 for (Changeset cs: cache.values()) { 187 if (cs.isOpen()) { 188 ret.add(cs); 189 } 190 } 191 return ret; 186 return cache.values().stream() 187 .filter(Changeset::isOpen) 188 .collect(Collectors.toList()); 192 189 } 193 190 -
trunk/src/org/openstreetmap/josm/data/osm/ChangesetDataSet.java
r10378 r11115 3 3 4 4 import java.util.HashMap; 5 import java.util.HashSet;6 5 import java.util.Iterator; 7 6 import java.util.Map; 8 7 import java.util.Map.Entry; 9 8 import java.util.Set; 9 import java.util.stream.Collectors; 10 10 11 11 import org.openstreetmap.josm.data.osm.history.HistoryOsmPrimitive; … … 117 117 public Set<HistoryOsmPrimitive> getPrimitivesByModificationType(ChangesetModificationType cmt) { 118 118 CheckParameterUtil.ensureParameterNotNull(cmt, "cmt"); 119 Set<HistoryOsmPrimitive> ret = new HashSet<>(); 120 for (Entry<PrimitiveId, ChangesetModificationType> entry: modificationTypes.entrySet()) { 121 if (entry.getValue().equals(cmt)) { 122 ret.add(primitives.get(entry.getKey())); 123 } 124 } 125 return ret; 119 return modificationTypes.entrySet().stream() 120 .filter(entry -> entry.getValue().equals(cmt)) 121 .map(entry -> primitives.get(entry.getKey())) 122 .collect(Collectors.toSet()); 126 123 } 127 124 -
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r11095 r11115 21 21 import java.util.concurrent.locks.ReentrantReadWriteLock; 22 22 import java.util.function.Predicate; 23 import java.util.stream.Collectors; 23 24 24 25 import org.openstreetmap.josm.Main; … … 420 421 try { 421 422 // QuadBuckets might be useful here (don't forget to do reindexing after some of rm is changed) 422 List<Relation> result = new ArrayList<>(); 423 for (Relation r: relations) { 424 if (r.getBBox().intersects(bbox)) { 425 result.add(r); 426 } 427 } 428 return result; 423 return relations.stream() 424 .filter(r -> r.getBBox().intersects(bbox)) 425 .collect(Collectors.toList()); 429 426 } finally { 430 427 lock.readLock().unlock(); -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMergeModel.java
r10680 r11115 226 226 synchronized (listeners) { 227 227 PropertyChangeEvent evt = new PropertyChangeEvent(this, FROZEN_PROP, oldValue, newValue); 228 for (PropertyChangeListener listener: listeners){228 listeners.forEach((listener) -> { 229 229 listener.propertyChange(evt); 230 }); 230 231 } 231 232 } 232 }233 233 234 234 public final void setFrozen(boolean isFrozen) { … … 678 678 if (row >= getEntries().size()) return false; 679 679 T e1 = getEntries().get(row); 680 for (T e2: getOppositeEntries()) { 681 if (isEqualEntry(e1, e2)) return true; 680 return getOppositeEntries().stream().anyMatch(e2 -> isEqualEntry(e1, e2)); 682 681 } 683 return false;684 }685 682 686 683 protected List<T> getEntries() {
Note:
See TracChangeset
for help on using the changeset viewer.