Skip to content

Commit be070c2

Browse files
committed
remove call to deprecated API
1 parent 92d9f4b commit be070c2

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

  • src/main/java/org/openstreetmap/josm/plugins/pt_assistant/utils

src/main/java/org/openstreetmap/josm/plugins/pt_assistant/utils/StopUtils.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import org.openstreetmap.josm.data.osm.Node;
55
import org.openstreetmap.josm.data.osm.OsmPrimitive;
66
import org.openstreetmap.josm.data.osm.Relation;
7+
import org.openstreetmap.josm.tools.Utils;
78

89
/**
910
* Utils class for stop areas
@@ -69,12 +70,8 @@ public static boolean verifyStopAreaPlatform(final OsmPrimitive p) {
6970
* @return true if the object part of stop area relation, false otherwise.
7071
*/
7172
public static boolean verifyIfMemberOfStopArea(final OsmPrimitive member) {
72-
for (Relation parentRelation : OsmPrimitive.getFilteredList(member.getReferrers(), Relation.class)) {
73-
if (StopUtils.isStopArea(parentRelation)) {
74-
return true;
75-
}
76-
}
77-
return false;
73+
return Utils.filteredCollection(member.getReferrers(), Relation.class).stream()
74+
.anyMatch(StopUtils::isStopArea);
7875
}
7976

8077
}

0 commit comments

Comments
 (0)