Ignore:
Timestamp:
2016-07-27T02:08:34+02:00 (8 years ago)
Author:
Don-vip
Message:

see #11390, see #12890 - use Java 8 Predicates

File:
1 edited

Legend:

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

    r10601 r10657  
    235235        }
    236236
    237         static PropertiesMembershipDialog showIfNecessary(Iterable<Node> selectedNodes, boolean preselectNew) throws UserCancelException {
     237        static PropertiesMembershipDialog showIfNecessary(Collection<Node> selectedNodes, boolean preselectNew) throws UserCancelException {
    238238            final boolean tagged = isTagged(selectedNodes);
    239239            final boolean usedInRelations = isUsedInRelations(selectedNodes);
     
    249249        }
    250250
    251         private static boolean isTagged(final Iterable<Node> existingNodes) {
    252             return Utils.exists(existingNodes, selectedNode -> selectedNode.hasKeys());
    253         }
    254 
    255         private static boolean isUsedInRelations(final Iterable<Node> existingNodes) {
    256             return Utils.exists(existingNodes, selectedNode -> Utils.exists(selectedNode.getReferrers(), OsmPrimitive.relationPredicate));
     251        private static boolean isTagged(final Collection<Node> existingNodes) {
     252            return existingNodes.stream().anyMatch(selectedNode -> selectedNode.hasKeys());
     253        }
     254
     255        private static boolean isUsedInRelations(final Collection<Node> existingNodes) {
     256            return existingNodes.stream().anyMatch(
     257                    selectedNode -> selectedNode.getReferrers().stream().anyMatch(OsmPrimitive.relationPredicate));
    257258        }
    258259
Note: See TracChangeset for help on using the changeset viewer.