From be070c2494f65ae158525abdb762298d57189131 Mon Sep 17 00:00:00 2001 From: Vincent Privat Date: Sun, 21 Apr 2019 02:34:50 +0200 Subject: [PATCH] remove call to deprecated API --- .../josm/plugins/pt_assistant/utils/StopUtils.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/utils/StopUtils.java b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/utils/StopUtils.java index 22514c50..13df8d7c 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/utils/StopUtils.java +++ b/src/main/java/org/openstreetmap/josm/plugins/pt_assistant/utils/StopUtils.java @@ -4,6 +4,7 @@ import org.openstreetmap.josm.data.osm.Node; import org.openstreetmap.josm.data.osm.OsmPrimitive; import org.openstreetmap.josm.data.osm.Relation; +import org.openstreetmap.josm.tools.Utils; /** * Utils class for stop areas @@ -69,12 +70,8 @@ public static boolean verifyStopAreaPlatform(final OsmPrimitive p) { * @return true if the object part of stop area relation, false otherwise. */ public static boolean verifyIfMemberOfStopArea(final OsmPrimitive member) { - for (Relation parentRelation : OsmPrimitive.getFilteredList(member.getReferrers(), Relation.class)) { - if (StopUtils.isStopArea(parentRelation)) { - return true; - } - } - return false; + return Utils.filteredCollection(member.getReferrers(), Relation.class).stream() + .anyMatch(StopUtils::isStopArea); } }