Changeset 10689 in josm for trunk/src


Ignore:
Timestamp:
2016-07-31T14:11:38+02:00 (8 years ago)
Author:
Don-vip
Message:

see #11390, see #12890 - Use Java 8 Function

Location:
trunk/src/org/openstreetmap/josm
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/Relation.java

    r10662 r10689  
    1010import java.util.Map;
    1111import java.util.Set;
     12import java.util.function.Function;
    1213
    1314import org.openstreetmap.josm.Main;
     
    1718import org.openstreetmap.josm.tools.SubclassFilteredCollection;
    1819import org.openstreetmap.josm.tools.Utils;
    19 import org.openstreetmap.josm.tools.Utils.Function;
    2020
    2121/**
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java

    r10670 r10689  
    1717import java.util.List;
    1818import java.util.TreeSet;
     19import java.util.function.Function;
    1920import java.util.regex.Matcher;
    2021import java.util.regex.Pattern;
     
    4041import org.openstreetmap.josm.tools.SubclassFilteredCollection;
    4142import org.openstreetmap.josm.tools.Utils;
    42 import org.openstreetmap.josm.tools.Utils.Function;
    4343
    4444/**
  • trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionManager.java

    r10627 r10689  
    1313import java.util.Objects;
    1414import java.util.Set;
     15import java.util.function.Function;
    1516
    1617import org.openstreetmap.josm.Main;
     
    3839import org.openstreetmap.josm.tools.MultiMap;
    3940import org.openstreetmap.josm.tools.Utils;
    40 import org.openstreetmap.josm.tools.Utils.Function;
    4141
    4242/**
  • trunk/src/org/openstreetmap/josm/io/MultiFetchOverpassObjectReader.java

    r10615 r10689  
    33
    44import java.util.Set;
     5import java.util.function.Function;
    56
    67import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
     
    1718    @Override
    1819    protected String buildRequestString(final OsmPrimitiveType type, Set<Long> idPackage) {
    19         final Utils.Function<Long, Object> toOverpassExpression = x -> type.getAPIName() + '(' + x + ");>;";
     20        final Function<Long, Object> toOverpassExpression = x -> type.getAPIName() + '(' + x + ");>;";
    2021        final String query = '(' + Utils.join("", Utils.transform(idPackage, toOverpassExpression)) + ");out meta;";
    2122        return "interpreter?data=" + Utils.encodeUrl(query);
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImageryHandler.java

    r10615 r10689  
    55
    66import java.util.Arrays;
     7import java.util.function.Function;
    78
    89import org.openstreetmap.josm.Main;
     
    1415import org.openstreetmap.josm.io.remotecontrol.PermissionPrefWithDefault;
    1516import org.openstreetmap.josm.tools.Utils;
    16 import org.openstreetmap.josm.tools.Utils.Function;
    1717
    1818/**
  • trunk/src/org/openstreetmap/josm/tools/ExceptionUtil.java

    r10626 r10689  
    1616import java.util.Date;
    1717import java.util.TreeSet;
     18import java.util.function.Function;
    1819import java.util.regex.Matcher;
    1920import java.util.regex.Pattern;
     
    3435import org.openstreetmap.josm.io.OsmTransferException;
    3536import org.openstreetmap.josm.io.auth.CredentialsManager;
    36 import org.openstreetmap.josm.tools.Utils.Function;
    3737import org.openstreetmap.josm.tools.date.DateUtils;
    3838
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r10680 r10689  
    770770    @Deprecated
    771771    @FunctionalInterface
    772     public interface Function<A, B> {
     772    public interface Function<A, B> extends java.util.function.Function<A, B> {
    773773
    774774        /**
     
    777777         * @return the transformed object
    778778         */
     779        @Override
    779780        B apply(A x);
    780781    }
     
    789790     * @return the transformed unmodifiable collection
    790791     */
    791     public static <A, B> Collection<B> transform(final Collection<? extends A> c, final Function<A, B> f) {
     792    public static <A, B> Collection<B> transform(final Collection<? extends A> c, final java.util.function.Function<A, B> f) {
    792793        return new AbstractCollection<B>() {
    793794
     
    831832     * @return the transformed unmodifiable list
    832833     */
    833     public static <A, B> List<B> transform(final List<? extends A> l, final Function<A, B> f) {
     834    public static <A, B> List<B> transform(final List<? extends A> l, final java.util.function.Function<A, B> f) {
    834835        return new AbstractList<B>() {
    835836
Note: See TracChangeset for help on using the changeset viewer.