Changeset 11553 in josm for trunk/src/org/openstreetmap/josm/command
- Timestamp:
- 2017-02-12T16:32:18+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/command/AddPrimitivesCommand.java
r11374 r11553 9 9 import java.util.List; 10 10 import java.util.Objects; 11 import java.util.Optional; 11 12 12 13 import javax.swing.Icon; … … 169 170 Collection<OsmPrimitive> prims = new HashSet<>(); 170 171 for (PrimitiveData d : data) { 171 OsmPrimitive osm = getAffectedDataSet().getPrimitiveById(d); 172 if (osm == null) 173 throw new JosmRuntimeException("No primitive found for " + d); 174 prims.add(osm); 172 prims.add(Optional.ofNullable(getAffectedDataSet().getPrimitiveById(d)).orElseThrow( 173 () -> new JosmRuntimeException("No primitive found for " + d))); 175 174 } 176 175 return prims;
Note:
See TracChangeset
for help on using the changeset viewer.