Ignore:
Timestamp:
2020-01-18T14:14:01+01:00 (4 years ago)
Author:
simon04
Message:

Java 8: use Collectors.joining

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/MultiFetchOverpassObjectReader.java

    r12816 r15717  
    33
    44import java.util.Set;
    5 import java.util.function.Function;
     5import java.util.stream.Collectors;
    66
    77import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
     
    1717    @Override
    1818    protected String buildRequestString(final OsmPrimitiveType type, Set<Long> idPackage) {
    19         final Function<Long, Object> toOverpassExpression = x -> type.getAPIName() + '(' + x + ");>;";
    20         final String query = '(' + Utils.join("", Utils.transform(idPackage, toOverpassExpression)) + ");out meta;";
     19        final String query = idPackage.stream()
     20                .map(x -> type.getAPIName() + '(' + x + ");>;")
     21                .collect(Collectors.joining("", "(", ");out meta;"));
    2122        return "interpreter?data=" + Utils.encodeUrl(query);
    2223    }
Note: See TracChangeset for help on using the changeset viewer.