diff --git a/application/src/main/java/org/opentripplanner/osm/model/OsmWithTags.java b/application/src/main/java/org/opentripplanner/osm/model/OsmWithTags.java index 11d64949ce3..30a8a463a02 100644 --- a/application/src/main/java/org/opentripplanner/osm/model/OsmWithTags.java +++ b/application/src/main/java/org/opentripplanner/osm/model/OsmWithTags.java @@ -49,6 +49,7 @@ public class OsmWithTags { private static final Set LEVEL_TAGS = Set.of("level", "layer"); private static final Set DEFAULT_LEVEL = Set.of("0"); + private static final Consumer NO_OP = (i) -> {}; /* To save memory this is only created when an entity actually has tags. */ private Map tags; @@ -230,7 +231,7 @@ public OptionalInt getTagAsInt(String tag, Consumer errorHandler) { * Everything else is returned as an emtpy optional. */ public OptionalInt parseIntOrBoolean(String tag, Consumer errorHandler) { - var maybeInt = getTagAsInt(tag, errorHandler); + var maybeInt = getTagAsInt(tag, NO_OP); if (maybeInt.isPresent()) { return maybeInt; } else {