Changeset 6302 in josm
- Timestamp:
- 2013-10-06T19:14:04+02:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/command/ChangeCommand.java
r5077 r6302 11 11 import org.openstreetmap.josm.data.osm.OsmPrimitive; 12 12 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 13 import org.openstreetmap.josm.data.osm.Way; 13 14 import org.openstreetmap.josm.gui.DefaultNameFormatter; 14 15 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 16 import org.openstreetmap.josm.tools.CheckParameterUtil; 15 17 import org.openstreetmap.josm.tools.ImageProvider; 16 18 … … 26 28 private final OsmPrimitive newOsm; 27 29 28 29 30 public ChangeCommand(OsmPrimitive osm, OsmPrimitive newOsm) { 30 31 super(); 31 32 this.osm = osm; 32 33 this.newOsm = newOsm; 34 sanityChecks(); 33 35 } 34 36 … … 37 39 this.osm = osm; 38 40 this.newOsm = newOsm; 41 sanityChecks(); 42 } 43 44 private void sanityChecks() { 45 CheckParameterUtil.ensureParameterNotNull(osm, "osm"); 46 CheckParameterUtil.ensureParameterNotNull(newOsm, "newOsm"); 47 if (newOsm instanceof Way) { 48 // Do not allow to create empty ways (see #7465) 49 if (((Way)newOsm).getNodesCount() == 0) { 50 throw new IllegalArgumentException(tr("New way {0} has 0 nodes", newOsm)); 51 } 52 } 39 53 } 40 54
Note:
See TracChangeset
for help on using the changeset viewer.