Changeset 18208 in josm for trunk/src/org/openstreetmap/josm/command/ChangePropertyCommand.java
- Timestamp:
- 2021-09-11T17:50:57+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/command/ChangePropertyCommand.java
r17358 r18208 26 26 import org.openstreetmap.josm.tools.I18n; 27 27 import org.openstreetmap.josm.tools.ImageProvider; 28 import org.openstreetmap.josm.tools.Utils; 28 29 29 30 /** … … 139 140 String newVal = tag.getValue(); 140 141 141 if ( newVal == null || newVal.isEmpty()) {142 if (Utils.isEmpty(newVal)) { 142 143 if (oldVal != null) { 143 144 // new value is null and tag exists (will delete tag) … … 173 174 String newVal = tag.getValue(); 174 175 175 if ( newVal == null || newVal.isEmpty()) {176 if (Utils.isEmpty(newVal)) { 176 177 if (oldVal != null) 177 178 osm.remove(tag.getKey()); … … 204 205 String msg; 205 206 Map.Entry<String, String> entry = tags.entrySet().iterator().next(); 206 if (entry.getValue() == null || entry.getValue().isEmpty()) {207 if (Utils.isEmpty(entry.getValue())) { 207 208 switch(OsmPrimitiveType.from(primitive)) { 208 209 case NODE: msg = marktr("Remove \"{0}\" for node ''{1}''"); break; … … 223 224 } else if (objects.size() > 1 && tags.size() == 1) { 224 225 Map.Entry<String, String> entry = tags.entrySet().iterator().next(); 225 if (entry.getValue() == null || entry.getValue().isEmpty()) {226 if (Utils.isEmpty(entry.getValue())) { 226 227 /* I18n: plural form for objects, but value < 2 not possible! */ 227 228 text = trn("Remove \"{0}\" for {1} object", "Remove \"{0}\" for {1} objects", objects.size(), entry.getKey(), objects.size()); … … 233 234 } else { 234 235 boolean allNull = this.tags.entrySet().stream() 235 .allMatch(tag -> tag.getValue() == null || tag.getValue().isEmpty());236 .allMatch(tag -> Utils.isEmpty(tag.getValue())); 236 237 237 238 if (allNull) {
Note:
See TracChangeset
for help on using the changeset viewer.
