diff --git a/src/main/java/org/opentripplanner/street/model/StreetTraversalPermission.java b/src/main/java/org/opentripplanner/street/model/StreetTraversalPermission.java index 98f7f2c3c91..b55a50eb097 100644 --- a/src/main/java/org/opentripplanner/street/model/StreetTraversalPermission.java +++ b/src/main/java/org/opentripplanner/street/model/StreetTraversalPermission.java @@ -49,10 +49,6 @@ public StreetTraversalPermission remove(StreetTraversalPermission perm) { return get(this.code & ~perm.code); } - public StreetTraversalPermission modify(boolean permissive, StreetTraversalPermission perm) { - return permissive ? add(perm) : remove(perm); - } - public boolean allows(StreetTraversalPermission perm) { return (code & perm.code) != 0; } diff --git a/src/main/java/org/opentripplanner/street/model/edge/StreetEdge.java b/src/main/java/org/opentripplanner/street/model/edge/StreetEdge.java index ca33396b0a3..80d0b8c2698 100644 --- a/src/main/java/org/opentripplanner/street/model/edge/StreetEdge.java +++ b/src/main/java/org/opentripplanner/street/model/edge/StreetEdge.java @@ -170,7 +170,7 @@ public boolean canTraverse(TraverseModeSet modes) { * This checks if start or end vertex is bollard If it is it creates intersection of street edge * permissions and from/to barriers. Then it checks if mode is allowed to traverse the edge. *

- * By default CAR isn't allowed to traverse barrier but foot and bicycle are. This can be changed + * By default, CAR isn't allowed to traverse barrier but foot and bicycle are. This can be changed * with different tags *

* If start/end isn't bollard it just checks the street permissions. @@ -179,11 +179,11 @@ public boolean canTraverse(TraverseModeSet modes) { */ public boolean canTraverse(TraverseMode mode) { StreetTraversalPermission permission = getPermission(); - if (fromv instanceof BarrierVertex) { - permission = permission.intersection(((BarrierVertex) fromv).getBarrierPermissions()); + if (fromv instanceof BarrierVertex bv) { + permission = permission.intersection(bv.getBarrierPermissions()); } - if (tov instanceof BarrierVertex) { - permission = permission.intersection(((BarrierVertex) tov).getBarrierPermissions()); + if (tov instanceof BarrierVertex bv) { + permission = permission.intersection(bv.getBarrierPermissions()); } return permission.allows(mode);