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/gui/dialogs/relation/ChildRelationBrowser.java

    r16189 r16436  
    1414import java.io.IOException;
    1515import java.util.Arrays;
    16 import java.util.HashSet;
    1716import java.util.List;
    1817import java.util.Set;
     
    302301            if (selection == null || selection.length == 0)
    303302                return;
    304             Set<Relation> relations = new HashSet<>();
    305             for (TreePath aSelection : selection) {
    306                 relations.add((Relation) aSelection.getLastPathComponent());
    307             }
     303            Set<Relation> relations = Arrays.stream(selection)
     304                    .map(s -> (Relation) s.getLastPathComponent())
     305                    .collect(Collectors.toSet());
    308306            MainApplication.worker.submit(new DownloadRelationSetTask(getParentDialog(), relations));
    309307        }
Note: See TracChangeset for help on using the changeset viewer.