Ignore:
Timestamp:
2016-08-03T15:39:00+02:00 (5 years ago)
Author:
simon04
Message:

see #11390, see #12890 - Lambda can be replaced with method reference

Location:
trunk/src/org/openstreetmap/josm/tools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/ExceptionUtil.java

    r10689 r10717  
    1616import java.util.Date;
    1717import java.util.TreeSet;
    18 import java.util.function.Function;
    1918import java.util.regex.Matcher;
    2019import java.util.regex.Pattern;
     
    142141            OsmPrimitive firstRefs = conflict.b.iterator().next();
    143142            String objId = Long.toString(conflict.a.getId());
    144             Collection<Long> refIds = Utils.transform(conflict.b, (Function<OsmPrimitive, Long>) x -> x.getId());
     143            Collection<Long> refIds = Utils.transform(conflict.b, OsmPrimitive::getId);
    145144            String refIdsString = refIds.size() == 1 ? refIds.iterator().next().toString() : refIds.toString();
    146145            if (conflict.a instanceof Node) {
  • trunk/src/org/openstreetmap/josm/tools/MemoryManager.java

    r10598 r10717  
    8787     */
    8888    public synchronized long getAvailableMemory() {
    89         return getMaxMemory() - activeHandles.stream().mapToLong(h -> h.getSize()).sum();
     89        return getMaxMemory() - activeHandles.stream().mapToLong(MemoryHandle::getSize).sum();
    9090    }
    9191
     
    104104    protected synchronized List<MemoryHandle<?>> resetState() {
    105105        ArrayList<MemoryHandle<?>> toFree = new ArrayList<>(activeHandles);
    106         toFree.stream().forEach(h -> h.free());
     106        toFree.forEach(MemoryHandle::free);
    107107        return toFree;
    108108    }
  • trunk/src/org/openstreetmap/josm/tools/MultiLineFlowLayout.java

    r10622 r10717  
    4848    @Override
    4949    public Dimension preferredLayoutSize(Container target) {
    50         return getLayoutSize(target, c -> c.getPreferredSize());
     50        return getLayoutSize(target, Component::getPreferredSize);
    5151    }
    5252
    5353    @Override
    5454    public Dimension minimumLayoutSize(Container target) {
    55         return getLayoutSize(target, c -> c.getMinimumSize());
     55        return getLayoutSize(target, Component::getMinimumSize);
    5656    }
    5757
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r10715 r10717  
    319319     */
    320320    public static String joinAsHtmlUnorderedList(Iterable<?> values) {
    321         return StreamUtils.toStream(values.iterator()).map(x -> x.toString()).collect(StreamUtils.toHtmlList());
     321        return StreamUtils.toStream(values.iterator()).map(Object::toString).collect(StreamUtils.toHtmlList());
    322322    }
    323323
     
    13411341     */
    13421342    public static Executor newDirectExecutor() {
    1343         return command -> command.run();
     1343        return Runnable::run;
    13441344    }
    13451345
Note: See TracChangeset for help on using the changeset viewer.