Changeset 13611 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 2018-04-10T19:02:58+02:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/OsmUtils.java
r12986 r13611 3 3 4 4 import java.util.Arrays; 5 import java.util.Collection; 5 6 import java.util.HashSet; 6 7 import java.util.Locale; 7 8 import java.util.Map; 9 import java.util.Objects; 8 10 import java.util.Set; 9 11 … … 153 155 return layer1; 154 156 } 157 158 /** 159 * Determines if the given collection contains primitives, and that none of them belong to a locked layer. 160 * @param collection collection of OSM primitives 161 * @return {@code true} if the given collection is not empty and does not contain any primitive in a locked layer. 162 * @since 13611 163 */ 164 public static boolean isOsmCollectionEditable(Collection<? extends OsmPrimitive> collection) { 165 return collection != null && !collection.isEmpty() 166 && collection.stream().map(OsmPrimitive::getDataSet).filter(Objects::nonNull).noneMatch(DataSet::isLocked); 167 } 155 168 } -
trunk/src/org/openstreetmap/josm/data/validation/TestError.java
r13489 r13611 12 12 13 13 import org.openstreetmap.josm.command.Command; 14 import org.openstreetmap.josm.data.osm.DataSet;15 14 import org.openstreetmap.josm.data.osm.Node; 16 15 import org.openstreetmap.josm.data.osm.OsmPrimitive; 16 import org.openstreetmap.josm.data.osm.OsmUtils; 17 17 import org.openstreetmap.josm.data.osm.Relation; 18 18 import org.openstreetmap.josm.data.osm.Way; … … 360 360 public boolean isFixable() { 361 361 return (fixingCommand != null || ((tester != null) && tester.isFixable(this))) 362 && primitives.stream().map(OsmPrimitive::getDataSet).noneMatch(DataSet::isLocked);362 && OsmUtils.isOsmCollectionEditable(primitives); 363 363 } 364 364
Note:
See TracChangeset
for help on using the changeset viewer.