Ignore:
Timestamp:
2017-02-12T16:32:18+01:00 (7 years ago)
Author:
Don-vip
Message:

refactor handling of null values - use Java 8 Optional where possible

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java

    r11389 r11553  
    1717import java.util.Map;
    1818import java.util.Objects;
     19import java.util.Optional;
    1920import java.util.Set;
    2021import java.util.Stack;
     
    520521
    521522        protected List<NodePair> getOutboundPairs(Node node) {
    522             List<NodePair> l = successors.get(node);
    523             if (l == null)
    524                 return Collections.emptyList();
    525             return l;
     523            return Optional.ofNullable(successors.get(node)).orElseGet(Collections::emptyList);
    526524        }
    527525
Note: See TracChangeset for help on using the changeset viewer.