Changeset 6365 in josm for trunk/src/org/openstreetmap/josm/command
- Timestamp:
- 2013-11-05T01:53:15+01:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/command/ChangeCommand.java
r6302 r6365 18 18 19 19 /** 20 * Command that basically replaces one OSM primitive by another of the 21 * same type. 20 * Command that basically replaces one OSM primitive by another of the same type. 22 21 * 23 * @ author Imi22 * @since 93 24 23 */ 25 24 public class ChangeCommand extends Command { … … 45 44 CheckParameterUtil.ensureParameterNotNull(osm, "osm"); 46 45 CheckParameterUtil.ensureParameterNotNull(newOsm, "newOsm"); 47 if (newOsm instanceof Way) { 46 if (newOsm instanceof Way && ((Way)newOsm).getNodesCount() == 0) { 48 47 // 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 } 48 throw new IllegalArgumentException(tr("New way {0} has 0 nodes", newOsm)); 52 49 } 53 50 } 54 51 55 @Override public boolean executeCommand() { 52 @Override 53 public boolean executeCommand() { 56 54 super.executeCommand(); 57 55 osm.cloneFrom(newOsm); … … 60 58 } 61 59 62 @Override public void fillModifiedData(Collection<OsmPrimitive> modified, Collection<OsmPrimitive> deleted, Collection<OsmPrimitive> added) { 60 @Override 61 public void fillModifiedData(Collection<OsmPrimitive> modified, Collection<OsmPrimitive> deleted, Collection<OsmPrimitive> added) { 63 62 modified.add(osm); 64 63 }
Note:
See TracChangeset
for help on using the changeset viewer.