Changeset 2333 in josm for trunk/src/org/openstreetmap/josm/command
- Timestamp:
- 2009-10-27T19:03:58+01:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/command/DeleteCommand.java
r2323 r2333 51 51 * Constructor. Deletes a collection of primitives in the current edit layer. 52 52 * 53 * @param data the primitives to delete 54 */ 55 public DeleteCommand(Collection<? extends OsmPrimitive> data) { 56 if (data == null) { 57 data = Collections.emptyList(); 58 } 53 * @param data the primitives to delete. Must neither be null nor empty. 54 * @throws IllegalArgumentException thrown if data is null or empty 55 */ 56 public DeleteCommand(Collection<? extends OsmPrimitive> data) throws IllegalArgumentException { 57 if (data == null) 58 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be empty")); 59 if (data.isEmpty()) 60 throw new IllegalArgumentException(tr("At least one object to delete requird, got empty collection")); 59 61 this.toDelete = data; 60 62 } … … 93 95 * 94 96 * @param layer the layer context for deleting these primitives. Must not be null. 95 * @param data the primitives to delete 97 * @param data the primitives to delete. Must neither be null nor empty. 96 98 * @throws IllegalArgumentException thrown if layer is null 99 * @throws IllegalArgumentException thrown if data is null or empty 97 100 */ 98 101 public DeleteCommand(OsmDataLayer layer, Collection<? extends OsmPrimitive> data) throws IllegalArgumentException{ 99 102 super(layer); 100 if (data == null) { 101 data = Collections.emptyList(); 102 } 103 if (data == null) 104 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be empty")); 105 if (data.isEmpty()) 106 throw new IllegalArgumentException(tr("At least one object to delete requird, got empty collection")); 103 107 this.toDelete = data; 104 108 }
Note: See TracChangeset
for help on using the changeset viewer.