Ignore:
Timestamp:
2020-05-17T12:08:17+02:00 (4 years ago)
Author:
simon04
Message:

see #19251 - Java 8: use Stream

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/command/ChangePropertyCommand.java

    r15905 r16436  
    229229            }
    230230        } else {
    231             boolean allnull = true;
    232             for (Map.Entry<String, String> tag : this.tags.entrySet()) {
    233                 if (tag.getValue() != null && !tag.getValue().isEmpty()) {
    234                     allnull = false;
    235                     break;
    236                 }
    237             }
    238 
    239             if (allnull) {
     231            boolean allNull = this.tags.entrySet().stream()
     232                    .allMatch(tag -> tag.getValue() == null || tag.getValue().isEmpty());
     233
     234            if (allNull) {
    240235                /* I18n: plural form detected for objects only (but value < 2 not possible!), try to do your best for tags */
    241236                text = trn("Deleted {0} tags for {1} object", "Deleted {0} tags for {1} objects", objects.size(), tags.size(), objects.size());
Note: See TracChangeset for help on using the changeset viewer.