Ignore:
Timestamp:
2016-07-24T00:19:35+02:00 (8 years ago)
Author:
Don-vip
Message:

see #11390 - Java 8: use List.sort(Comparator) instead of Collections.sort(list, Comparator)

Location:
trunk/src/org/openstreetmap/josm/gui/layer
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java

    r10611 r10619  
    14471447                return;
    14481448            List<Tile> allTiles = allTilesCreate();
    1449             Collections.sort(allTiles, getTileDistanceComparator());
     1449            allTiles.sort(getTileDistanceComparator());
    14501450            for (Tile t : allTiles) {
    14511451                loadTile(t, force);
  • trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java

    r10611 r10619  
    646646         */
    647647        final List<Way> sortedWays = new ArrayList<>(ways);
    648         Collections.sort(sortedWays, new OsmPrimitiveComparator(true, false)); // sort by OsmPrimitive#getUniqueId ascending
     648        sortedWays.sort(new OsmPrimitiveComparator(true, false)); // sort by OsmPrimitive#getUniqueId ascending
    649649        Collections.reverse(sortedWays); // sort by OsmPrimitive#getUniqueId descending
    650650        for (Way w : sortedWays) {
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java

    r10611 r10619  
    10811081        }
    10821082
    1083         Collections.sort(dateImgLst, (o1, o2) -> o1.getExifTime().compareTo(o2.getExifTime()));
     1083        dateImgLst.sort((o1, o2) -> o1.getExifTime().compareTo(o2.getExifTime()));
    10841084
    10851085        return dateImgLst;
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/ImportAudioAction.java

    r10611 r10619  
    1111import java.util.Arrays;
    1212import java.util.Collection;
    13 import java.util.Collections;
    1413
    1514import javax.swing.AbstractAction;
     
    278277        /* we must have got at least one waypoint now */
    279278
    280         Collections.sort((ArrayList<WayPoint>) waypoints, (a, b) -> a.time <= b.time ? -1 : 1);
     279        ((ArrayList<WayPoint>) waypoints).sort((a, b) -> a.time <= b.time ? -1 : 1);
    281280
    282281        firstTime = -1.0; /* this time of the first waypoint, not first trackpoint */
  • trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java

    r10611 r10619  
    1919import java.util.ArrayList;
    2020import java.util.Collection;
    21 import java.util.Collections;
    2221import java.util.List;
    2322
     
    234233        if (from instanceof MarkerLayer) {
    235234            data.addAll(((MarkerLayer) from).data);
    236             Collections.sort(data, (o1, o2) -> Double.compare(o1.time, o2.time));
     235            data.sort((o1, o2) -> Double.compare(o1.time, o2.time));
    237236        }
    238237    }
Note: See TracChangeset for help on using the changeset viewer.