From b70c9d6249df47a7dc5a161422ed230e785be06e Mon Sep 17 00:00:00 2001 From: Ville Pihlava Date: Tue, 3 Sep 2024 16:25:09 +0300 Subject: [PATCH 001/110] Change GraphQL schema for carsAllowed and generate files. --- .../gtfs/generated/GraphQLDataFetchers.java | 33 ++++++++++--------- .../apis/gtfs/generated/GraphQLTypes.java | 9 +++++ .../apis/gtfs/generated/graphql-codegen.yml | 1 + .../opentripplanner/apis/gtfs/schema.graphqls | 26 +++++++++++++++ 4 files changed, 54 insertions(+), 15 deletions(-) diff --git a/src/main/java/org/opentripplanner/apis/gtfs/generated/GraphQLDataFetchers.java b/src/main/java/org/opentripplanner/apis/gtfs/generated/GraphQLDataFetchers.java index 67944543580..a33a5d31f10 100644 --- a/src/main/java/org/opentripplanner/apis/gtfs/generated/GraphQLDataFetchers.java +++ b/src/main/java/org/opentripplanner/apis/gtfs/generated/GraphQLDataFetchers.java @@ -12,16 +12,30 @@ import org.locationtech.jts.geom.Geometry; import org.opentripplanner.api.resource.DebugOutput; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLAbsoluteDirection; +import org.opentripplanner.transit.model.organization.Agency; +import org.opentripplanner.routing.alertpatch.TransitAlert; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLAlertCauseType; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLAlertEffectType; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLAlertSeverityLevelType; +import org.opentripplanner.routing.vehicle_parking.VehicleParking; +import org.opentripplanner.service.vehiclerental.model.VehicleRentalPlace; +import org.opentripplanner.service.vehiclerental.model.VehicleRentalStationUris; +import org.opentripplanner.service.vehiclerental.model.VehicleRentalStation; +import org.opentripplanner.service.vehiclerental.model.RentalVehicleEntityCounts; +import org.opentripplanner.service.vehiclerental.model.RentalVehicleTypeCount; +import org.opentripplanner.service.vehiclerental.model.VehicleRentalVehicle; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLBikesAllowed; +import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLCarsAllowed; +import org.opentripplanner.transit.model.timetable.booking.BookingInfo; +import org.opentripplanner.transit.model.timetable.booking.BookingTime; +import org.opentripplanner.routing.graphfinder.PatternAtStop; +import org.opentripplanner.model.plan.Emissions; +import org.opentripplanner.apis.gtfs.model.FeedPublisher; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLInputField; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLOccupancyStatus; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLRelativeDirection; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLRoutingErrorCode; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLTransitMode; -import org.opentripplanner.apis.gtfs.model.FeedPublisher; import org.opentripplanner.apis.gtfs.model.PlanPageInfo; import org.opentripplanner.apis.gtfs.model.RideHailingProvider; import org.opentripplanner.apis.gtfs.model.StopPosition; @@ -36,37 +50,24 @@ import org.opentripplanner.model.fare.FareProduct; import org.opentripplanner.model.fare.FareProductUse; import org.opentripplanner.model.fare.RiderCategory; -import org.opentripplanner.model.plan.Emissions; import org.opentripplanner.model.plan.Itinerary; import org.opentripplanner.model.plan.Leg; import org.opentripplanner.model.plan.LegTime; import org.opentripplanner.model.plan.StopArrival; import org.opentripplanner.model.plan.WalkStep; -import org.opentripplanner.routing.alertpatch.TransitAlert; import org.opentripplanner.routing.api.response.RoutingError; import org.opentripplanner.routing.graphfinder.NearbyStop; -import org.opentripplanner.routing.graphfinder.PatternAtStop; +import org.opentripplanner.transit.model.timetable.Trip; import org.opentripplanner.routing.graphfinder.PlaceAtDistance; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; import org.opentripplanner.routing.vehicle_parking.VehicleParkingSpaces; import org.opentripplanner.routing.vehicle_parking.VehicleParkingState; import org.opentripplanner.service.realtimevehicles.model.RealtimeVehicle; import org.opentripplanner.service.realtimevehicles.model.RealtimeVehicle.StopRelationship; -import org.opentripplanner.service.vehiclerental.model.RentalVehicleEntityCounts; import org.opentripplanner.service.vehiclerental.model.RentalVehicleType; -import org.opentripplanner.service.vehiclerental.model.RentalVehicleTypeCount; -import org.opentripplanner.service.vehiclerental.model.VehicleRentalPlace; -import org.opentripplanner.service.vehiclerental.model.VehicleRentalStation; -import org.opentripplanner.service.vehiclerental.model.VehicleRentalStationUris; import org.opentripplanner.service.vehiclerental.model.VehicleRentalSystem; -import org.opentripplanner.service.vehiclerental.model.VehicleRentalVehicle; import org.opentripplanner.transit.model.basic.Money; import org.opentripplanner.transit.model.network.Route; import org.opentripplanner.transit.model.network.TripPattern; -import org.opentripplanner.transit.model.organization.Agency; -import org.opentripplanner.transit.model.timetable.Trip; -import org.opentripplanner.transit.model.timetable.booking.BookingInfo; -import org.opentripplanner.transit.model.timetable.booking.BookingTime; public class GraphQLDataFetchers { @@ -1148,6 +1149,8 @@ public interface GraphQLTrip { public DataFetcher blockId(); + public DataFetcher carsAllowed(); + public DataFetcher departureStoptime(); public DataFetcher directionId(); diff --git a/src/main/java/org/opentripplanner/apis/gtfs/generated/GraphQLTypes.java b/src/main/java/org/opentripplanner/apis/gtfs/generated/GraphQLTypes.java index 67051444cdf..06f515466ac 100644 --- a/src/main/java/org/opentripplanner/apis/gtfs/generated/GraphQLTypes.java +++ b/src/main/java/org/opentripplanner/apis/gtfs/generated/GraphQLTypes.java @@ -566,6 +566,12 @@ public void setGraphQLBannedNetworks(List bannedNetworks) { } } + public enum GraphQLCarsAllowed { + ALLOWED, + NOT_ALLOWED, + NO_INFORMATION, + } + public static class GraphQLCyclingOptimizationInput { private GraphQLTriangleCyclingFactorsInput triangle; @@ -1492,6 +1498,7 @@ public enum GraphQLPlanAccessMode { BICYCLE, BICYCLE_PARKING, BICYCLE_RENTAL, + CAR, CAR_DROP_OFF, CAR_PARKING, CAR_RENTAL, @@ -1575,6 +1582,7 @@ public enum GraphQLPlanDirectMode { public enum GraphQLPlanEgressMode { BICYCLE, BICYCLE_RENTAL, + CAR, CAR_PICKUP, CAR_RENTAL, FLEX, @@ -1877,6 +1885,7 @@ public void setGraphQLWalk(GraphQLWalkPreferencesInput walk) { public enum GraphQLPlanTransferMode { BICYCLE, + CAR, WALK, } diff --git a/src/main/java/org/opentripplanner/apis/gtfs/generated/graphql-codegen.yml b/src/main/java/org/opentripplanner/apis/gtfs/generated/graphql-codegen.yml index 29490a28b78..fb72e63986c 100644 --- a/src/main/java/org/opentripplanner/apis/gtfs/generated/graphql-codegen.yml +++ b/src/main/java/org/opentripplanner/apis/gtfs/generated/graphql-codegen.yml @@ -53,6 +53,7 @@ config: RentalVehicle: org.opentripplanner.service.vehiclerental.model.VehicleRentalVehicle#VehicleRentalVehicle VehicleRentalUris: org.opentripplanner.service.vehiclerental.model.VehicleRentalStationUris#VehicleRentalStationUris BikesAllowed: org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLBikesAllowed#GraphQLBikesAllowed + CarsAllowed: org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLCarsAllowed#GraphQLCarsAllowed BookingInfo: org.opentripplanner.transit.model.timetable.booking.BookingInfo#BookingInfo BookingTime: org.opentripplanner.transit.model.timetable.booking.BookingTime#BookingTime CarPark: org.opentripplanner.routing.vehicle_parking.VehicleParking#VehicleParking diff --git a/src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls b/src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls index 927af19f8b1..dee8d0b7a60 100644 --- a/src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls +++ b/src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls @@ -2267,6 +2267,8 @@ type Trip implements Node { ): Stoptime "Whether bikes are allowed on board the vehicle running this trip" bikesAllowed: BikesAllowed + "Whether cars are allowed on board the vehicle running this trip" + carsAllowed: CarsAllowed blockId: String "Departure time from the first stop" departureStoptime( @@ -2774,6 +2776,15 @@ enum BikesAllowed { NO_INFORMATION } +enum CarsAllowed { + "The vehicle being used on this particular trip can accommodate at least one car." + ALLOWED + "No cars are allowed on this trip." + NOT_ALLOWED + "There is no car information for the trip." + NO_INFORMATION +} + """ Predefined optimization alternatives for bicycling routing. For more customization, one can use the triangle factors. @@ -3062,6 +3073,11 @@ enum PlanAccessMode { """ BICYCLE_RENTAL """ + Driving a car from the origin to the destination. + TODO add more thorough description + """ + CAR + """ Getting dropped off by a car to a location that is accessible with a car. Note, this can include walking after the drop-off. """ @@ -3171,6 +3187,11 @@ enum PlanEgressMode { """ BICYCLE_RENTAL """ + Driving a car from the origin to the destination. + TODO add more thorough description + """ + CAR + """ Getting picked up by a car from a location that is accessible with a car. Note, this can include walking before the pickup. """ @@ -3208,6 +3229,11 @@ enum PlanTransferMode { cycling if the mode used for access and egress is also `BICYCLE`. """ BICYCLE + """ + Driving a car from the origin to the destination. + TODO add more thorough description + """ + CAR "Walking between transit vehicles (typically between stops)." WALK } From 3efe676f264f8f9301e8e20506ed5f3cc834213a Mon Sep 17 00:00:00 2001 From: Ville Pihlava Date: Tue, 3 Sep 2024 16:30:42 +0300 Subject: [PATCH 002/110] Add functionality for cars on trips. --- .../api/parameter/QualifiedModeSet.java | 7 +++-- .../apis/gtfs/datafetchers/TripImpl.java | 7 +++++ .../apis/gtfs/mapping/CarsAllowedMapper.java | 17 ++++++++++ .../routerequest/AccessModeMapper.java | 1 + .../routerequest/EgressModeMapper.java | 1 + .../routerequest/ModePreferencesMapper.java | 5 +++ .../routerequest/TransferModeMapper.java | 1 + .../mapping/RequestModesMapper.java | 5 +-- .../module/StreetLinkerModule.java | 31 ++++++++++++++++++- .../gtfs/mapping/CarAccessMapper.java | 22 +++++++++++++ .../gtfs/mapping/TripMapper.java | 1 + ...RouteRequestTransitDataProviderFilter.java | 16 ++++++++++ .../routing/api/request/StreetMode.java | 4 +-- .../transit/model/network/CarAccess.java | 11 +++++++ .../transit/model/timetable/Trip.java | 9 ++++++ .../transit/model/timetable/TripBuilder.java | 12 +++++++ 16 files changed, 141 insertions(+), 9 deletions(-) create mode 100644 src/main/java/org/opentripplanner/apis/gtfs/mapping/CarsAllowedMapper.java create mode 100644 src/main/java/org/opentripplanner/gtfs/mapping/CarAccessMapper.java create mode 100644 src/main/java/org/opentripplanner/transit/model/network/CarAccess.java diff --git a/src/main/java/org/opentripplanner/api/parameter/QualifiedModeSet.java b/src/main/java/org/opentripplanner/api/parameter/QualifiedModeSet.java index c6f1a3d74ec..6e62c4ea78a 100644 --- a/src/main/java/org/opentripplanner/api/parameter/QualifiedModeSet.java +++ b/src/main/java/org/opentripplanner/api/parameter/QualifiedModeSet.java @@ -126,9 +126,10 @@ public RequestModes getRequestModes() { mBuilder.withEgressMode(StreetMode.CAR_HAILING); mBuilder.withDirectMode(StreetMode.WALK); } else { - mBuilder.withAccessMode(StreetMode.WALK); - mBuilder.withTransferMode(StreetMode.WALK); - mBuilder.withEgressMode(StreetMode.WALK); + // Cars can use transit, for example, with car ferries. + mBuilder.withAccessMode(StreetMode.CAR); + mBuilder.withTransferMode(StreetMode.CAR); + mBuilder.withEgressMode(StreetMode.CAR); mBuilder.withDirectMode(StreetMode.CAR); } } diff --git a/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/TripImpl.java b/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/TripImpl.java index 21bff637976..0ec7d63b101 100644 --- a/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/TripImpl.java +++ b/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/TripImpl.java @@ -20,7 +20,9 @@ import org.opentripplanner.apis.gtfs.generated.GraphQLDataFetchers; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLBikesAllowed; +import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLCarsAllowed; import org.opentripplanner.apis.gtfs.mapping.BikesAllowedMapper; +import org.opentripplanner.apis.gtfs.mapping.CarsAllowedMapper; import org.opentripplanner.apis.gtfs.model.TripOccupancy; import org.opentripplanner.apis.support.SemanticHash; import org.opentripplanner.framework.time.ServiceDateUtils; @@ -172,6 +174,11 @@ public DataFetcher bikesAllowed() { return environment -> BikesAllowedMapper.map(getSource(environment).getBikesAllowed()); } + @Override + public DataFetcher carsAllowed() { + return environment -> CarsAllowedMapper.map(getSource(environment).getCarsAllowed()); + } + @Override public DataFetcher blockId() { return environment -> getSource(environment).getGtfsBlockId(); diff --git a/src/main/java/org/opentripplanner/apis/gtfs/mapping/CarsAllowedMapper.java b/src/main/java/org/opentripplanner/apis/gtfs/mapping/CarsAllowedMapper.java new file mode 100644 index 00000000000..0c479a8664c --- /dev/null +++ b/src/main/java/org/opentripplanner/apis/gtfs/mapping/CarsAllowedMapper.java @@ -0,0 +1,17 @@ +package org.opentripplanner.apis.gtfs.mapping; + +import javax.annotation.Nonnull; +import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLCarsAllowed; +import org.opentripplanner.transit.model.network.CarAccess; + +public class CarsAllowedMapper { + + @Nonnull + public static GraphQLCarsAllowed map(@Nonnull CarAccess carsAllowed) { + return switch (carsAllowed) { + case UNKNOWN -> GraphQLCarsAllowed.NO_INFORMATION; + case ALLOWED -> GraphQLCarsAllowed.ALLOWED; + case NOT_ALLOWED -> GraphQLCarsAllowed.NOT_ALLOWED; + }; + } +} diff --git a/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/AccessModeMapper.java b/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/AccessModeMapper.java index ac4c90a1a56..e0e3ac0bbb2 100644 --- a/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/AccessModeMapper.java +++ b/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/AccessModeMapper.java @@ -13,6 +13,7 @@ public static StreetMode map(GraphQLTypes.GraphQLPlanAccessMode mode) { case BICYCLE -> StreetMode.BIKE; case BICYCLE_RENTAL -> StreetMode.BIKE_RENTAL; case BICYCLE_PARKING -> StreetMode.BIKE_TO_PARK; + case CAR -> StreetMode.CAR; case CAR_RENTAL -> StreetMode.CAR_RENTAL; case CAR_PARKING -> StreetMode.CAR_TO_PARK; case CAR_DROP_OFF -> StreetMode.CAR_PICKUP; diff --git a/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/EgressModeMapper.java b/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/EgressModeMapper.java index f03b160ac97..ddcaa255f2a 100644 --- a/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/EgressModeMapper.java +++ b/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/EgressModeMapper.java @@ -12,6 +12,7 @@ public static StreetMode map(GraphQLTypes.GraphQLPlanEgressMode mode) { return switch (mode) { case BICYCLE -> StreetMode.BIKE; case BICYCLE_RENTAL -> StreetMode.BIKE_RENTAL; + case CAR -> StreetMode.CAR; case CAR_RENTAL -> StreetMode.CAR_RENTAL; case CAR_PICKUP -> StreetMode.CAR_PICKUP; case FLEX -> StreetMode.FLEXIBLE; diff --git a/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/ModePreferencesMapper.java b/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/ModePreferencesMapper.java index 32d3456df57..663e93acca9 100644 --- a/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/ModePreferencesMapper.java +++ b/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/ModePreferencesMapper.java @@ -168,5 +168,10 @@ private static void validateStreetModes(JourneyRequest journey) { "If BICYCLE is used for access, egress or transfer, then it should be used for all." ); } + if (modes.contains(StreetMode.CAR) && modes.size() != 1) { + throw new IllegalArgumentException( + "If CAR is used for access, egress or transfer, then it should be used for all." + ); + } } } diff --git a/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/TransferModeMapper.java b/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/TransferModeMapper.java index ffa7363e3a7..18d2c0e3811 100644 --- a/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/TransferModeMapper.java +++ b/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/TransferModeMapper.java @@ -10,6 +10,7 @@ public class TransferModeMapper { public static StreetMode map(GraphQLTypes.GraphQLPlanTransferMode mode) { return switch (mode) { + case CAR -> StreetMode.CAR; case BICYCLE -> StreetMode.BIKE; case WALK -> StreetMode.WALK; }; diff --git a/src/main/java/org/opentripplanner/apis/transmodel/mapping/RequestModesMapper.java b/src/main/java/org/opentripplanner/apis/transmodel/mapping/RequestModesMapper.java index 974b8dd10c3..849d39e35e7 100644 --- a/src/main/java/org/opentripplanner/apis/transmodel/mapping/RequestModesMapper.java +++ b/src/main/java/org/opentripplanner/apis/transmodel/mapping/RequestModesMapper.java @@ -10,7 +10,8 @@ class RequestModesMapper { - private static final Predicate IS_BIKE = m -> m == StreetMode.BIKE; + private static final Predicate IS_BIKE_OR_CAR = m -> + m == StreetMode.BIKE || m == StreetMode.CAR; private static final String accessModeKey = "accessMode"; private static final String egressModeKey = "egressMode"; private static final String directModeKey = "directMode"; @@ -27,7 +28,7 @@ static RequestModes mapRequestModes(Map modesInput) { ensureValueAndSet(accessMode, mBuilder::withAccessMode); ensureValueAndSet((StreetMode) modesInput.get(egressModeKey), mBuilder::withEgressMode); ensureValueAndSet((StreetMode) modesInput.get(directModeKey), mBuilder::withDirectMode); - Optional.ofNullable(accessMode).filter(IS_BIKE).ifPresent(mBuilder::withTransferMode); + Optional.ofNullable(accessMode).filter(IS_BIKE_OR_CAR).ifPresent(mBuilder::withTransferMode); return mBuilder.build(); } diff --git a/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java b/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java index 48e6e484a0c..fbb65a5a850 100644 --- a/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java +++ b/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java @@ -25,6 +25,7 @@ import org.opentripplanner.street.model.vertex.VehicleParkingEntranceVertex; import org.opentripplanner.street.search.TraverseMode; import org.opentripplanner.street.search.TraverseModeSet; +import org.opentripplanner.transit.model.network.CarAccess; import org.opentripplanner.transit.model.site.GroupStop; import org.opentripplanner.transit.model.site.RegularStop; import org.opentripplanner.transit.model.site.StopLocation; @@ -102,6 +103,31 @@ public void linkTransitStops(Graph graph, TransitModel transitModel) { ); } + // The stops that are used by transit capable of transporting cars need to be connected to the road network (e.g. car ferries). + Set stopLocationsUsedForCarsAllowedTrips = Set.of(); + stopLocationsUsedForCarsAllowedTrips = + transitModel + .getAllTripPatterns() + .stream() + .filter(t -> + t + .getScheduledTimetable() + .getTripTimes() + .stream() + .anyMatch(tt -> tt.getTrip().getCarsAllowed() == CarAccess.ALLOWED) + ) + .flatMap(t -> t.getStops().stream()) + .collect(Collectors.toSet()); + + stopLocationsUsedForCarsAllowedTrips.addAll( + stopLocationsUsedForCarsAllowedTrips + .stream() + .filter(GroupStop.class::isInstance) + .map(GroupStop.class::cast) + .flatMap(g -> g.getChildLocations().stream().filter(RegularStop.class::isInstance)) + .toList() + ); + for (TransitStopVertex tStop : vertices) { // Stops with pathways do not need to be connected to the street network, since there are explicit entrances defined for that if (tStop.hasPathways()) { @@ -116,7 +142,10 @@ public void linkTransitStops(Graph graph, TransitModel transitModel) { StopLinkType linkType = StopLinkType.WALK_ONLY; if ( - OTPFeature.FlexRouting.isOn() && stopLocationsUsedForFlexTrips.contains(tStop.getStop()) + ( + OTPFeature.FlexRouting.isOn() && stopLocationsUsedForFlexTrips.contains(tStop.getStop()) + ) || + stopLocationsUsedForCarsAllowedTrips.contains(tStop.getStop()) ) { linkType = StopLinkType.WALK_AND_CAR; } diff --git a/src/main/java/org/opentripplanner/gtfs/mapping/CarAccessMapper.java b/src/main/java/org/opentripplanner/gtfs/mapping/CarAccessMapper.java new file mode 100644 index 00000000000..d328d1aa06e --- /dev/null +++ b/src/main/java/org/opentripplanner/gtfs/mapping/CarAccessMapper.java @@ -0,0 +1,22 @@ +package org.opentripplanner.gtfs.mapping; + +import org.onebusaway.gtfs.model.Trip; +import org.opentripplanner.transit.model.network.CarAccess; + +/** + * Model car access for GTFS trips. + */ +class CarAccessMapper { + + public static CarAccess mapForTrip(Trip rhs) { + int carsAllowed = rhs.getCarsAllowed(); + switch (carsAllowed) { + case 1: + return CarAccess.ALLOWED; + case 2: + return CarAccess.NOT_ALLOWED; + default: + return CarAccess.UNKNOWN; + } + } +} diff --git a/src/main/java/org/opentripplanner/gtfs/mapping/TripMapper.java b/src/main/java/org/opentripplanner/gtfs/mapping/TripMapper.java index 3a62ba2b269..9f2663dd9b3 100644 --- a/src/main/java/org/opentripplanner/gtfs/mapping/TripMapper.java +++ b/src/main/java/org/opentripplanner/gtfs/mapping/TripMapper.java @@ -71,6 +71,7 @@ private Trip doMap(org.onebusaway.gtfs.model.Trip rhs) { lhs.withShapeId(AgencyAndIdMapper.mapAgencyAndId(rhs.getShapeId())); lhs.withWheelchairBoarding(WheelchairAccessibilityMapper.map(rhs.getWheelchairAccessible())); lhs.withBikesAllowed(BikeAccessMapper.mapForTrip(rhs)); + lhs.withCarsAllowed(CarAccessMapper.mapForTrip(rhs)); var trip = lhs.build(); mapSafeTimePenalty(rhs).ifPresent(f -> flexSafeTimePenalties.put(trip, f)); diff --git a/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RouteRequestTransitDataProviderFilter.java b/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RouteRequestTransitDataProviderFilter.java index 44d9f3cdb3d..2fa4a9dff15 100644 --- a/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RouteRequestTransitDataProviderFilter.java +++ b/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RouteRequestTransitDataProviderFilter.java @@ -12,6 +12,7 @@ import org.opentripplanner.transit.model.basic.Accessibility; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.transit.model.network.BikeAccess; +import org.opentripplanner.transit.model.network.CarAccess; import org.opentripplanner.transit.model.network.RoutingTripPattern; import org.opentripplanner.transit.model.timetable.Trip; import org.opentripplanner.transit.model.timetable.TripTimes; @@ -20,6 +21,8 @@ public class RouteRequestTransitDataProviderFilter implements TransitDataProvide private final boolean requireBikesAllowed; + private final boolean requireCarsAllowed; + private final boolean wheelchairEnabled; private final WheelchairPreferences wheelchairPreferences; @@ -41,6 +44,7 @@ public class RouteRequestTransitDataProviderFilter implements TransitDataProvide public RouteRequestTransitDataProviderFilter(RouteRequest request) { this( request.journey().transfer().mode() == StreetMode.BIKE, + request.journey().transfer().mode() == StreetMode.CAR, request.wheelchair(), request.preferences().wheelchair(), request.preferences().transit().includePlannedCancellations(), @@ -53,6 +57,7 @@ public RouteRequestTransitDataProviderFilter(RouteRequest request) { // This constructor is used only for testing public RouteRequestTransitDataProviderFilter( boolean requireBikesAllowed, + boolean requireCarsAllowed, boolean wheelchairEnabled, WheelchairPreferences wheelchairPreferences, boolean includePlannedCancellations, @@ -61,6 +66,7 @@ public RouteRequestTransitDataProviderFilter( List filters ) { this.requireBikesAllowed = requireBikesAllowed; + this.requireCarsAllowed = requireCarsAllowed; this.wheelchairEnabled = wheelchairEnabled; this.wheelchairPreferences = wheelchairPreferences; this.includePlannedCancellations = includePlannedCancellations; @@ -83,6 +89,10 @@ public static BikeAccess bikeAccessForTrip(Trip trip) { return trip.getRoute().getBikesAllowed(); } + public static CarAccess carAccessForTrip(Trip trip) { + return trip.getCarsAllowed(); + } + @Override public boolean tripPatternPredicate(TripPatternForDate tripPatternForDate) { for (TransitFilter filter : filters) { @@ -103,6 +113,12 @@ public boolean tripTimesPredicate(TripTimes tripTimes, boolean withFilters) { } } + if (requireCarsAllowed) { + if (carAccessForTrip(trip) != CarAccess.ALLOWED) { + return false; + } + } + if (wheelchairEnabled) { if ( wheelchairPreferences.trip().onlyConsiderAccessible() && diff --git a/src/main/java/org/opentripplanner/routing/api/request/StreetMode.java b/src/main/java/org/opentripplanner/routing/api/request/StreetMode.java index 56e716d9d62..cbc2764f030 100644 --- a/src/main/java/org/opentripplanner/routing/api/request/StreetMode.java +++ b/src/main/java/org/opentripplanner/routing/api/request/StreetMode.java @@ -36,10 +36,8 @@ public enum StreetMode implements DocumentedEnum { SCOOTER_RENTAL(Feature.ACCESS, Feature.EGRESS, Feature.WALKING, Feature.SCOOTER, Feature.RENTING), /** * Car only - *

- * Direct mode only. */ - CAR(Feature.ACCESS, Feature.DRIVING), + CAR(Feature.ACCESS, Feature.TRANSFER, Feature.EGRESS, Feature.DRIVING), /** * Start in the car, drive to a parking area, and walk the rest of the way. *

diff --git a/src/main/java/org/opentripplanner/transit/model/network/CarAccess.java b/src/main/java/org/opentripplanner/transit/model/network/CarAccess.java new file mode 100644 index 00000000000..0a7a4f91845 --- /dev/null +++ b/src/main/java/org/opentripplanner/transit/model/network/CarAccess.java @@ -0,0 +1,11 @@ +package org.opentripplanner.transit.model.network; + +/** + * GTFS codes: + * 0 = unknown / unspecified, 1 = cars allowed, 2 = cars NOT allowed + */ +public enum CarAccess { + UNKNOWN, + NOT_ALLOWED, + ALLOWED, +} diff --git a/src/main/java/org/opentripplanner/transit/model/timetable/Trip.java b/src/main/java/org/opentripplanner/transit/model/timetable/Trip.java index 5a1e9150e78..ac16ec0173a 100644 --- a/src/main/java/org/opentripplanner/transit/model/timetable/Trip.java +++ b/src/main/java/org/opentripplanner/transit/model/timetable/Trip.java @@ -17,6 +17,7 @@ import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.transit.model.framework.LogInfo; import org.opentripplanner.transit.model.network.BikeAccess; +import org.opentripplanner.transit.model.network.CarAccess; import org.opentripplanner.transit.model.network.Route; import org.opentripplanner.transit.model.organization.Operator; @@ -33,6 +34,7 @@ public final class Trip extends AbstractTransitEntity impleme private final Direction direction; private final BikeAccess bikesAllowed; + private final CarAccess carsAllowed; private final Accessibility wheelchairBoarding; private final String gtfsBlockId; @@ -52,6 +54,7 @@ public final class Trip extends AbstractTransitEntity impleme : route.getNetexSubmode(); this.direction = requireNonNullElse(builder.getDirection(), Direction.UNKNOWN); this.bikesAllowed = requireNonNullElse(builder.getBikesAllowed(), route.getBikesAllowed()); + this.carsAllowed = requireNonNullElse(builder.getCarsAllowed(), CarAccess.UNKNOWN); this.wheelchairBoarding = requireNonNullElse(builder.getWheelchairBoarding(), Accessibility.NO_INFORMATION); this.netexAlteration = requireNonNullElse(builder.getNetexAlteration(), TripAlteration.PLANNED); @@ -137,6 +140,11 @@ public BikeAccess getBikesAllowed() { return bikesAllowed; } + @Nonnull + public CarAccess getCarsAllowed() { + return carsAllowed; + } + @Nonnull public Accessibility getWheelchairBoarding() { return wheelchairBoarding; @@ -200,6 +208,7 @@ public boolean sameAs(@Nonnull Trip other) { Objects.equals(this.shapeId, other.shapeId) && Objects.equals(this.direction, other.direction) && Objects.equals(this.bikesAllowed, other.bikesAllowed) && + Objects.equals(this.carsAllowed, other.carsAllowed) && Objects.equals(this.wheelchairBoarding, other.wheelchairBoarding) && Objects.equals(this.netexAlteration, other.netexAlteration) ); diff --git a/src/main/java/org/opentripplanner/transit/model/timetable/TripBuilder.java b/src/main/java/org/opentripplanner/transit/model/timetable/TripBuilder.java index 063dfe10da2..5ed0616831d 100644 --- a/src/main/java/org/opentripplanner/transit/model/timetable/TripBuilder.java +++ b/src/main/java/org/opentripplanner/transit/model/timetable/TripBuilder.java @@ -6,6 +6,7 @@ import org.opentripplanner.transit.model.framework.AbstractEntityBuilder; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.transit.model.network.BikeAccess; +import org.opentripplanner.transit.model.network.CarAccess; import org.opentripplanner.transit.model.network.Route; import org.opentripplanner.transit.model.organization.Operator; @@ -21,6 +22,7 @@ public class TripBuilder extends AbstractEntityBuilder { private FeedScopedId shapeId; private Direction direction; private BikeAccess bikesAllowed; + private CarAccess carsAllowed; private Accessibility wheelchairBoarding; private String gtfsBlockId; private String netexInternalPlanningCode; @@ -44,6 +46,7 @@ public class TripBuilder extends AbstractEntityBuilder { this.shapeId = original.getShapeId(); this.direction = original.getDirection(); this.bikesAllowed = original.getBikesAllowed(); + this.carsAllowed = original.getCarsAllowed(); this.wheelchairBoarding = original.getWheelchairBoarding(); this.netexInternalPlanningCode = original.getNetexInternalPlanningCode(); } @@ -151,11 +154,20 @@ public BikeAccess getBikesAllowed() { return bikesAllowed; } + public CarAccess getCarsAllowed() { + return carsAllowed; + } + public TripBuilder withBikesAllowed(BikeAccess bikesAllowed) { this.bikesAllowed = bikesAllowed; return this; } + public TripBuilder withCarsAllowed(CarAccess carsAllowed) { + this.carsAllowed = carsAllowed; + return this; + } + public Accessibility getWheelchairBoarding() { return wheelchairBoarding; } From a555f3dee169349f18c32fe315b7572ad98925be Mon Sep 17 00:00:00 2001 From: Ville Pihlava Date: Tue, 3 Sep 2024 16:31:14 +0300 Subject: [PATCH 003/110] Add tests for cars on trips. --- .../gtfs/mapping/CarsAllowedMapperTest.java | 21 +++++ .../module/StreetLinkerModuleTest.java | 69 ++++++++++++++ .../gtfs/mapping/CarAccessMapperTest.java | 26 ++++++ .../gtfs/mapping/TripMapperTest.java | 5 ++ ...eRequestTransitDataProviderFilterTest.java | 90 +++++++++++++++++++ .../transit/model/timetable/TripTest.java | 5 ++ 6 files changed, 216 insertions(+) create mode 100644 src/test/java/org/opentripplanner/apis/gtfs/mapping/CarsAllowedMapperTest.java create mode 100644 src/test/java/org/opentripplanner/gtfs/mapping/CarAccessMapperTest.java diff --git a/src/test/java/org/opentripplanner/apis/gtfs/mapping/CarsAllowedMapperTest.java b/src/test/java/org/opentripplanner/apis/gtfs/mapping/CarsAllowedMapperTest.java new file mode 100644 index 00000000000..a2a1b40a5e8 --- /dev/null +++ b/src/test/java/org/opentripplanner/apis/gtfs/mapping/CarsAllowedMapperTest.java @@ -0,0 +1,21 @@ +package org.opentripplanner.apis.gtfs.mapping; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.util.Arrays; +import org.junit.jupiter.api.Test; +import org.opentripplanner.transit.model.network.CarAccess; + +class CarsAllowedMapperTest { + + @Test + void mapping() { + Arrays + .stream(CarAccess.values()) + .filter(ba -> ba != CarAccess.UNKNOWN) + .forEach(d -> { + var mapped = CarsAllowedMapper.map(d); + assertEquals(d.toString(), mapped.toString()); + }); + } +} diff --git a/src/test/java/org/opentripplanner/graph_builder/module/StreetLinkerModuleTest.java b/src/test/java/org/opentripplanner/graph_builder/module/StreetLinkerModuleTest.java index 06b10575ef9..e5f77f57659 100644 --- a/src/test/java/org/opentripplanner/graph_builder/module/StreetLinkerModuleTest.java +++ b/src/test/java/org/opentripplanner/graph_builder/module/StreetLinkerModuleTest.java @@ -9,12 +9,14 @@ import static org.opentripplanner.street.model.StreetTraversalPermission.PEDESTRIAN; import static org.opentripplanner.transit.model._data.TransitModelForTest.id; +import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; import org.opentripplanner.ext.flex.trip.UnscheduledTrip; import org.opentripplanner.framework.application.OTPFeature; import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; +import org.opentripplanner.model.StopTime; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.street.model._data.StreetModelForTest; import org.opentripplanner.street.model.edge.Edge; @@ -23,7 +25,15 @@ import org.opentripplanner.street.model.vertex.TransitStopVertex; import org.opentripplanner.transit.model._data.TransitModelForTest; import org.opentripplanner.transit.model.framework.Deduplicator; +import org.opentripplanner.transit.model.network.CarAccess; +import org.opentripplanner.transit.model.network.Route; +import org.opentripplanner.transit.model.network.StopPattern; +import org.opentripplanner.transit.model.network.TripPattern; import org.opentripplanner.transit.model.site.RegularStop; +import org.opentripplanner.transit.model.site.StopLocation; +import org.opentripplanner.transit.model.timetable.RealTimeTripTimes; +import org.opentripplanner.transit.model.timetable.Trip; +import org.opentripplanner.transit.model.timetable.TripTimesFactory; import org.opentripplanner.transit.service.StopModel; import org.opentripplanner.transit.service.TransitModel; @@ -92,6 +102,37 @@ void linkFlexStop() { }); } + @Test + void linkCarsAllowedStop() { + var model = new TestModel(); + var carsAllowedTrip = TransitModelForTest + .of() + .trip("carsAllowedTrip") + .withCarsAllowed(CarAccess.ALLOWED) + .build(); + model.withCarsAllowedTrip(carsAllowedTrip, model.stop()); + + var module = model.streetLinkerModule(); + + module.buildGraph(); + + assertTrue(model.stopVertex().isConnectedToGraph()); + + // Because the stop is used by a carsAllowed trip it needs to be linked to both the walk and car edge + assertEquals(2, model.stopVertex().getOutgoing().size()); + var linkToWalk = model.outgoingLinks().getFirst(); + SplitterVertex walkSplit = (SplitterVertex) linkToWalk.getToVertex(); + + assertTrue(walkSplit.isConnectedToWalkingEdge()); + assertFalse(walkSplit.isConnectedToDriveableEdge()); + + var linkToCar = model.outgoingLinks().getLast(); + SplitterVertex carSplit = (SplitterVertex) linkToCar.getToVertex(); + + assertFalse(carSplit.isConnectedToWalkingEdge()); + assertTrue(carSplit.isConnectedToDriveableEdge()); + } + private static class TestModel { private final TransitStopVertex stopVertex; @@ -155,5 +196,33 @@ public RegularStop stop() { public void withFlexTrip(UnscheduledTrip flexTrip) { transitModel.addFlexTrip(flexTrip.getId(), flexTrip); } + + public void withCarsAllowedTrip(Trip trip, StopLocation... stops) { + Route route = TransitModelForTest.route("carsAllowedRoute").build(); + var stopTimes = Arrays + .stream(stops) + .map(s -> { + var stopTime = new StopTime(); + stopTime.setStop(s); + stopTime.setArrivalTime(30); + stopTime.setDepartureTime(60); + stopTime.setTrip(trip); + return stopTime; + }) + .toList(); + StopPattern stopPattern = new StopPattern(stopTimes); + TripPattern tripPattern = TransitModelForTest + .tripPattern("carsAllowedTripPattern", route) + .withStopPattern(stopPattern) + .build(); + RealTimeTripTimes tripTimes = TripTimesFactory.tripTimes( + trip, + stopTimes, + transitModel.getDeduplicator() + ); + + tripPattern.add(tripTimes); + transitModel.addTripPattern(tripPattern.getId(), tripPattern); + } } } diff --git a/src/test/java/org/opentripplanner/gtfs/mapping/CarAccessMapperTest.java b/src/test/java/org/opentripplanner/gtfs/mapping/CarAccessMapperTest.java new file mode 100644 index 00000000000..a312d9967d6 --- /dev/null +++ b/src/test/java/org/opentripplanner/gtfs/mapping/CarAccessMapperTest.java @@ -0,0 +1,26 @@ +package org.opentripplanner.gtfs.mapping; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; +import org.onebusaway.gtfs.model.Route; +import org.onebusaway.gtfs.model.Trip; +import org.opentripplanner.transit.model.network.CarAccess; + +public class CarAccessMapperTest { + + private static final int CARS_ALLOWED = 1; + private static final int CARS_NOT_ALLOWED = 2; + + @Test + public void testTripProvidedValues() { + Trip trip = new Trip(); + assertEquals(CarAccess.UNKNOWN, CarAccessMapper.mapForTrip(trip)); + + trip.setCarsAllowed(CARS_ALLOWED); + assertEquals(CarAccess.ALLOWED, CarAccessMapper.mapForTrip(trip)); + + trip.setCarsAllowed(CARS_NOT_ALLOWED); + assertEquals(CarAccess.NOT_ALLOWED, CarAccessMapper.mapForTrip(trip)); + } +} diff --git a/src/test/java/org/opentripplanner/gtfs/mapping/TripMapperTest.java b/src/test/java/org/opentripplanner/gtfs/mapping/TripMapperTest.java index 964c3d8155e..98f5519926c 100644 --- a/src/test/java/org/opentripplanner/gtfs/mapping/TripMapperTest.java +++ b/src/test/java/org/opentripplanner/gtfs/mapping/TripMapperTest.java @@ -14,6 +14,7 @@ import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.transit.model.basic.Accessibility; import org.opentripplanner.transit.model.network.BikeAccess; +import org.opentripplanner.transit.model.network.CarAccess; import org.opentripplanner.transit.model.timetable.Direction; public class TripMapperTest { @@ -21,6 +22,7 @@ public class TripMapperTest { private static final String FEED_ID = "FEED"; private static final AgencyAndId AGENCY_AND_ID = new AgencyAndId("A", "1"); private static final int BIKES_ALLOWED = 1; + private static final int CARS_ALLOWED = 1; private static final String BLOCK_ID = "Block Id"; private static final int DIRECTION_ID = 1; private static final String TRIP_HEADSIGN = "Trip Headsign"; @@ -47,6 +49,7 @@ private static TripMapper defaultTripMapper() { TRIP.setId(AGENCY_AND_ID); TRIP.setBikesAllowed(BIKES_ALLOWED); + TRIP.setCarsAllowed(CARS_ALLOWED); TRIP.setBlockId(BLOCK_ID); TRIP.setDirectionId(Integer.toString(DIRECTION_ID)); TRIP.setRoute(data.route); @@ -78,6 +81,7 @@ void testMap() throws Exception { assertEquals(TRIP_SHORT_NAME, result.getShortName()); assertEquals(Accessibility.POSSIBLE, result.getWheelchairBoarding()); assertEquals(BikeAccess.ALLOWED, result.getBikesAllowed()); + assertEquals(CarAccess.ALLOWED, result.getCarsAllowed()); } @Test @@ -99,6 +103,7 @@ void testMapWithNulls() throws Exception { assertEquals(Direction.UNKNOWN, result.getDirection()); assertEquals(Accessibility.NO_INFORMATION, result.getWheelchairBoarding()); assertEquals(BikeAccess.UNKNOWN, result.getBikesAllowed()); + assertEquals(CarAccess.UNKNOWN, result.getCarsAllowed()); } /** Mapping the same object twice, should return the same instance. */ diff --git a/src/test/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RouteRequestTransitDataProviderFilterTest.java b/src/test/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RouteRequestTransitDataProviderFilterTest.java index be6266ccdbe..c5dea627d5a 100644 --- a/src/test/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RouteRequestTransitDataProviderFilterTest.java +++ b/src/test/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RouteRequestTransitDataProviderFilterTest.java @@ -34,6 +34,7 @@ import org.opentripplanner.transit.model.framework.Deduplicator; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.transit.model.network.BikeAccess; +import org.opentripplanner.transit.model.network.CarAccess; import org.opentripplanner.transit.model.network.Route; import org.opentripplanner.transit.model.network.RouteBuilder; import org.opentripplanner.transit.model.network.RoutingTripPattern; @@ -107,6 +108,7 @@ void testWheelchairAccess(Accessibility wheelchair, WheelchairPreferences access .getRoutingTripPattern(); var filter = new RouteRequestTransitDataProviderFilter( + false, false, true, accessibility, @@ -157,6 +159,7 @@ void testRealtimeCancelledStops(boolean includeRealtimeCancellations) { .getRoutingTripPattern(); var filter = new RouteRequestTransitDataProviderFilter( + false, false, false, DEFAULT_ACCESSIBILITY, @@ -202,6 +205,7 @@ void notFilteringExpectedTripPatternForDateTest() { TripPatternForDate tripPatternForDate = createTestTripPatternForDate(); var filter = new RouteRequestTransitDataProviderFilter( + false, false, false, DEFAULT_ACCESSIBILITY, @@ -221,6 +225,7 @@ void bannedRouteFilteringTest() { TripPatternForDate tripPatternForDate = createTestTripPatternForDate(); var filter = new RouteRequestTransitDataProviderFilter( + false, false, false, DEFAULT_ACCESSIBILITY, @@ -246,6 +251,7 @@ void bannedTripFilteringTest() { TRIP_ID, ROUTE, BikeAccess.NOT_ALLOWED, + CarAccess.NOT_ALLOWED, TransitMode.BUS, null, Accessibility.NOT_POSSIBLE, @@ -253,6 +259,7 @@ void bannedTripFilteringTest() { ); var filter = new RouteRequestTransitDataProviderFilter( + false, false, false, DEFAULT_ACCESSIBILITY, @@ -281,6 +288,7 @@ void matchModeFilterAndBannedAgencyFilter() { ); var filter = new RouteRequestTransitDataProviderFilter( + false, false, false, DEFAULT_ACCESSIBILITY, @@ -316,6 +324,7 @@ void matchCombinedModesAndBannedAgencyFilter() { ); var filter = new RouteRequestTransitDataProviderFilter( + false, false, false, DEFAULT_ACCESSIBILITY, @@ -347,6 +356,7 @@ void matchSelectedAgencyExcludedSubMode() { ); var filter = new RouteRequestTransitDataProviderFilter( + false, false, false, DEFAULT_ACCESSIBILITY, @@ -386,6 +396,7 @@ void transitModeFilteringTest() { TRIP_ID, ROUTE, BikeAccess.NOT_ALLOWED, + CarAccess.NOT_ALLOWED, TransitMode.BUS, TransmodelTransportSubmode.LOCAL_BUS.getValue(), Accessibility.NOT_POSSIBLE, @@ -412,6 +423,7 @@ void notFilteringExpectedTripTimesTest() { TRIP_ID, ROUTE, BikeAccess.NOT_ALLOWED, + CarAccess.NOT_ALLOWED, TransitMode.BUS, null, Accessibility.NOT_POSSIBLE, @@ -419,6 +431,7 @@ void notFilteringExpectedTripTimesTest() { ); var filter = new RouteRequestTransitDataProviderFilter( + false, false, false, DEFAULT_ACCESSIBILITY, @@ -439,6 +452,36 @@ void bikesAllowedFilteringTest() { TRIP_ID, ROUTE, BikeAccess.NOT_ALLOWED, + CarAccess.NOT_ALLOWED, + TransitMode.BUS, + null, + Accessibility.NOT_POSSIBLE, + null + ); + + var filter = new RouteRequestTransitDataProviderFilter( + true, + false, + true, + WheelchairPreferences.DEFAULT, + false, + false, + Set.of(), + List.of(AllowAllTransitFilter.of()) + ); + + boolean valid = filter.tripTimesPredicate(tripTimes, true); + + assertFalse(valid); + } + + @Test + void carsAllowedFilteringTest() { + TripTimes tripTimes = createTestTripTimes( + TRIP_ID, + ROUTE, + BikeAccess.NOT_ALLOWED, + CarAccess.NOT_ALLOWED, TransitMode.BUS, null, Accessibility.NOT_POSSIBLE, @@ -446,6 +489,7 @@ void bikesAllowedFilteringTest() { ); var filter = new RouteRequestTransitDataProviderFilter( + false, true, true, WheelchairPreferences.DEFAULT, @@ -466,6 +510,7 @@ void removeInaccessibleTrip() { TRIP_ID, ROUTE, BikeAccess.NOT_ALLOWED, + CarAccess.NOT_ALLOWED, TransitMode.BUS, null, Accessibility.NOT_POSSIBLE, @@ -473,6 +518,7 @@ void removeInaccessibleTrip() { ); var filter = new RouteRequestTransitDataProviderFilter( + false, false, true, WheelchairPreferences.DEFAULT, @@ -493,6 +539,7 @@ void keepAccessibleTrip() { TRIP_ID, ROUTE, BikeAccess.NOT_ALLOWED, + CarAccess.NOT_ALLOWED, TransitMode.BUS, null, Accessibility.POSSIBLE, @@ -500,6 +547,7 @@ void keepAccessibleTrip() { ); var filter = new RouteRequestTransitDataProviderFilter( + false, false, true, WheelchairPreferences.DEFAULT, @@ -520,6 +568,7 @@ void keepRealTimeAccessibleTrip() { TRIP_ID, ROUTE, BikeAccess.NOT_ALLOWED, + CarAccess.NOT_ALLOWED, TransitMode.BUS, null, Accessibility.NOT_POSSIBLE, @@ -527,6 +576,7 @@ void keepRealTimeAccessibleTrip() { ); var filter = new RouteRequestTransitDataProviderFilter( + false, false, true, WheelchairPreferences.DEFAULT, @@ -549,6 +599,7 @@ void includePlannedCancellationsTest() { TRIP_ID, ROUTE, BikeAccess.NOT_ALLOWED, + CarAccess.NOT_ALLOWED, TransitMode.BUS, null, Accessibility.NOT_POSSIBLE, @@ -558,6 +609,7 @@ void includePlannedCancellationsTest() { TRIP_ID, ROUTE, BikeAccess.NOT_ALLOWED, + CarAccess.NOT_ALLOWED, TransitMode.BUS, null, Accessibility.NOT_POSSIBLE, @@ -566,6 +618,7 @@ void includePlannedCancellationsTest() { // Given var filter1 = new RouteRequestTransitDataProviderFilter( + false, false, false, WheelchairPreferences.DEFAULT, @@ -587,6 +640,7 @@ void includePlannedCancellationsTest() { // Given var filter2 = new RouteRequestTransitDataProviderFilter( + false, false, false, DEFAULT_ACCESSIBILITY, @@ -613,6 +667,7 @@ void includeRealtimeCancellationsTest() { TRIP_ID, ROUTE, BikeAccess.NOT_ALLOWED, + CarAccess.NOT_ALLOWED, TransitMode.BUS, null, Accessibility.NOT_POSSIBLE, @@ -623,6 +678,7 @@ void includeRealtimeCancellationsTest() { TRIP_ID, ROUTE, BikeAccess.NOT_ALLOWED, + CarAccess.NOT_ALLOWED, TransitMode.BUS, null, Accessibility.NOT_POSSIBLE, @@ -632,6 +688,7 @@ void includeRealtimeCancellationsTest() { // Given var filter1 = new RouteRequestTransitDataProviderFilter( + false, false, false, WheelchairPreferences.DEFAULT, @@ -653,6 +710,7 @@ void includeRealtimeCancellationsTest() { // Given var filter2 = new RouteRequestTransitDataProviderFilter( + false, false, false, DEFAULT_ACCESSIBILITY, @@ -709,12 +767,34 @@ void testBikesAllowed() { ); } + @Test + void testCarsAllowed() { + RouteBuilder routeBuilder = TransitModelForTest.route("1"); + TripBuilder trip = Trip.of(TransitModelForTest.id("T1")).withRoute(routeBuilder.build()); + + assertEquals( + CarAccess.UNKNOWN, + RouteRequestTransitDataProviderFilter.carAccessForTrip(trip.build()) + ); + trip.withCarsAllowed(CarAccess.ALLOWED); + assertEquals( + CarAccess.ALLOWED, + RouteRequestTransitDataProviderFilter.carAccessForTrip(trip.build()) + ); + trip.withCarsAllowed(CarAccess.NOT_ALLOWED); + assertEquals( + CarAccess.NOT_ALLOWED, + RouteRequestTransitDataProviderFilter.carAccessForTrip(trip.build()) + ); + } + @Test void multipleFilteringTest() { TripTimes matchingTripTimes = createTestTripTimes( TRIP_ID, ROUTE, BikeAccess.ALLOWED, + CarAccess.NOT_ALLOWED, TransitMode.BUS, null, Accessibility.POSSIBLE, @@ -724,6 +804,7 @@ void multipleFilteringTest() { TRIP_ID, ROUTE, BikeAccess.ALLOWED, + CarAccess.NOT_ALLOWED, TransitMode.RAIL, null, Accessibility.POSSIBLE, @@ -733,6 +814,7 @@ void multipleFilteringTest() { TRIP_ID, ROUTE, BikeAccess.NOT_ALLOWED, + CarAccess.NOT_ALLOWED, TransitMode.RAIL, null, Accessibility.POSSIBLE, @@ -742,6 +824,7 @@ void multipleFilteringTest() { TRIP_ID, ROUTE, BikeAccess.NOT_ALLOWED, + CarAccess.NOT_ALLOWED, TransitMode.RAIL, null, Accessibility.NOT_POSSIBLE, @@ -751,6 +834,7 @@ void multipleFilteringTest() { TRIP_ID, ROUTE, BikeAccess.ALLOWED, + CarAccess.NOT_ALLOWED, TransitMode.BUS, null, Accessibility.NOT_POSSIBLE, @@ -760,6 +844,7 @@ void multipleFilteringTest() { TRIP_ID, ROUTE, BikeAccess.ALLOWED, + CarAccess.NOT_ALLOWED, TransitMode.BUS, null, Accessibility.POSSIBLE, @@ -768,6 +853,7 @@ void multipleFilteringTest() { var filter = new RouteRequestTransitDataProviderFilter( true, + false, true, DEFAULT_ACCESSIBILITY, false, @@ -790,6 +876,7 @@ private boolean validateModesOnTripTimes( TripTimes tripTimes ) { var filter = new RouteRequestTransitDataProviderFilter( + false, false, false, DEFAULT_ACCESSIBILITY, @@ -867,6 +954,7 @@ private RealTimeTripTimes createTestTripTimes( FeedScopedId tripId, Route route, BikeAccess bikeAccess, + CarAccess carAccess, TransitMode mode, String submode, Accessibility wheelchairBoarding, @@ -878,6 +966,7 @@ private RealTimeTripTimes createTestTripTimes( .withMode(mode) .withNetexSubmode(submode) .withBikesAllowed(bikeAccess) + .withCarsAllowed(carAccess) .withWheelchairBoarding(wheelchairBoarding) .withNetexAlteration(tripAlteration) .build(); @@ -896,6 +985,7 @@ private TripTimes createTestTripTimesWithSubmode(String submode) { TRIP_ID, ROUTE, BikeAccess.NOT_ALLOWED, + CarAccess.NOT_ALLOWED, TransitMode.BUS, submode, Accessibility.NOT_POSSIBLE, diff --git a/src/test/java/org/opentripplanner/transit/model/timetable/TripTest.java b/src/test/java/org/opentripplanner/transit/model/timetable/TripTest.java index 3a3f35643fa..eeaa979257d 100644 --- a/src/test/java/org/opentripplanner/transit/model/timetable/TripTest.java +++ b/src/test/java/org/opentripplanner/transit/model/timetable/TripTest.java @@ -12,6 +12,7 @@ import org.opentripplanner.transit.model.basic.TransitMode; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.transit.model.network.BikeAccess; +import org.opentripplanner.transit.model.network.CarAccess; import org.opentripplanner.transit.model.network.Route; import org.opentripplanner.transit.model.organization.Operator; @@ -24,6 +25,7 @@ class TripTest { private static final Direction DIRECTION = Direction.INBOUND; public static final NonLocalizedString HEAD_SIGN = new NonLocalizedString("head sign"); private static final BikeAccess BIKE_ACCESS = BikeAccess.ALLOWED; + private static final CarAccess CAR_ACCESS = CarAccess.ALLOWED; private static final TransitMode TRANSIT_MODE = TransitMode.BUS; private static final String BLOCK_ID = "blockId"; private static final TripAlteration TRIP_ALTERATION = TripAlteration.CANCELLATION; @@ -43,6 +45,7 @@ class TripTest { .withDirection(DIRECTION) .withHeadsign(HEAD_SIGN) .withBikesAllowed(BIKE_ACCESS) + .withCarsAllowed(CAR_ACCESS) .withMode(TRANSIT_MODE) .withGtfsBlockId(BLOCK_ID) .withNetexAlteration(TRIP_ALTERATION) @@ -84,6 +87,7 @@ void copy() { assertEquals(DIRECTION, copy.getDirection()); assertEquals(HEAD_SIGN, copy.getHeadsign()); assertEquals(BIKE_ACCESS, copy.getBikesAllowed()); + assertEquals(CAR_ACCESS, copy.getCarsAllowed()); assertEquals(TRANSIT_MODE, copy.getMode()); assertEquals(BLOCK_ID, copy.getGtfsBlockId()); assertEquals(TRIP_ALTERATION, copy.getNetexAlteration()); @@ -110,6 +114,7 @@ void sameAs() { assertFalse(subject.sameAs(subject.copy().withDirection(Direction.OUTBOUND).build())); assertFalse(subject.sameAs(subject.copy().withHeadsign(new NonLocalizedString("X")).build())); assertFalse(subject.sameAs(subject.copy().withBikesAllowed(BikeAccess.NOT_ALLOWED).build())); + assertFalse(subject.sameAs(subject.copy().withCarsAllowed(CarAccess.NOT_ALLOWED).build())); assertFalse(subject.sameAs(subject.copy().withMode(TransitMode.RAIL).build())); assertFalse(subject.sameAs(subject.copy().withGtfsBlockId("X").build())); assertFalse( From 5afc63c34cc4b4a577468f7791085f0d8b879bcb Mon Sep 17 00:00:00 2001 From: Ville Pihlava Date: Thu, 5 Sep 2024 12:36:03 +0300 Subject: [PATCH 004/110] Remove changes to QualifiedModeSet. --- .../opentripplanner/api/parameter/QualifiedModeSet.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/opentripplanner/api/parameter/QualifiedModeSet.java b/src/main/java/org/opentripplanner/api/parameter/QualifiedModeSet.java index 6e62c4ea78a..c6f1a3d74ec 100644 --- a/src/main/java/org/opentripplanner/api/parameter/QualifiedModeSet.java +++ b/src/main/java/org/opentripplanner/api/parameter/QualifiedModeSet.java @@ -126,10 +126,9 @@ public RequestModes getRequestModes() { mBuilder.withEgressMode(StreetMode.CAR_HAILING); mBuilder.withDirectMode(StreetMode.WALK); } else { - // Cars can use transit, for example, with car ferries. - mBuilder.withAccessMode(StreetMode.CAR); - mBuilder.withTransferMode(StreetMode.CAR); - mBuilder.withEgressMode(StreetMode.CAR); + mBuilder.withAccessMode(StreetMode.WALK); + mBuilder.withTransferMode(StreetMode.WALK); + mBuilder.withEgressMode(StreetMode.WALK); mBuilder.withDirectMode(StreetMode.CAR); } } From c644034c08cda3eaf5fb5b8c59dd293524ae3cfe Mon Sep 17 00:00:00 2001 From: Ville Pihlava Date: Tue, 10 Sep 2024 09:20:08 +0300 Subject: [PATCH 005/110] Fix format. --- .../gtfs/generated/GraphQLDataFetchers.java | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/main/java/org/opentripplanner/apis/gtfs/generated/GraphQLDataFetchers.java b/src/main/java/org/opentripplanner/apis/gtfs/generated/GraphQLDataFetchers.java index a33a5d31f10..0a0d231299c 100644 --- a/src/main/java/org/opentripplanner/apis/gtfs/generated/GraphQLDataFetchers.java +++ b/src/main/java/org/opentripplanner/apis/gtfs/generated/GraphQLDataFetchers.java @@ -12,30 +12,17 @@ import org.locationtech.jts.geom.Geometry; import org.opentripplanner.api.resource.DebugOutput; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLAbsoluteDirection; -import org.opentripplanner.transit.model.organization.Agency; -import org.opentripplanner.routing.alertpatch.TransitAlert; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLAlertCauseType; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLAlertEffectType; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLAlertSeverityLevelType; -import org.opentripplanner.routing.vehicle_parking.VehicleParking; -import org.opentripplanner.service.vehiclerental.model.VehicleRentalPlace; -import org.opentripplanner.service.vehiclerental.model.VehicleRentalStationUris; -import org.opentripplanner.service.vehiclerental.model.VehicleRentalStation; -import org.opentripplanner.service.vehiclerental.model.RentalVehicleEntityCounts; -import org.opentripplanner.service.vehiclerental.model.RentalVehicleTypeCount; -import org.opentripplanner.service.vehiclerental.model.VehicleRentalVehicle; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLBikesAllowed; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLCarsAllowed; -import org.opentripplanner.transit.model.timetable.booking.BookingInfo; -import org.opentripplanner.transit.model.timetable.booking.BookingTime; -import org.opentripplanner.routing.graphfinder.PatternAtStop; -import org.opentripplanner.model.plan.Emissions; -import org.opentripplanner.apis.gtfs.model.FeedPublisher; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLInputField; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLOccupancyStatus; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLRelativeDirection; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLRoutingErrorCode; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLTransitMode; +import org.opentripplanner.apis.gtfs.model.FeedPublisher; import org.opentripplanner.apis.gtfs.model.PlanPageInfo; import org.opentripplanner.apis.gtfs.model.RideHailingProvider; import org.opentripplanner.apis.gtfs.model.StopPosition; @@ -50,24 +37,37 @@ import org.opentripplanner.model.fare.FareProduct; import org.opentripplanner.model.fare.FareProductUse; import org.opentripplanner.model.fare.RiderCategory; +import org.opentripplanner.model.plan.Emissions; import org.opentripplanner.model.plan.Itinerary; import org.opentripplanner.model.plan.Leg; import org.opentripplanner.model.plan.LegTime; import org.opentripplanner.model.plan.StopArrival; import org.opentripplanner.model.plan.WalkStep; +import org.opentripplanner.routing.alertpatch.TransitAlert; import org.opentripplanner.routing.api.response.RoutingError; import org.opentripplanner.routing.graphfinder.NearbyStop; -import org.opentripplanner.transit.model.timetable.Trip; +import org.opentripplanner.routing.graphfinder.PatternAtStop; import org.opentripplanner.routing.graphfinder.PlaceAtDistance; +import org.opentripplanner.routing.vehicle_parking.VehicleParking; import org.opentripplanner.routing.vehicle_parking.VehicleParkingSpaces; import org.opentripplanner.routing.vehicle_parking.VehicleParkingState; import org.opentripplanner.service.realtimevehicles.model.RealtimeVehicle; import org.opentripplanner.service.realtimevehicles.model.RealtimeVehicle.StopRelationship; +import org.opentripplanner.service.vehiclerental.model.RentalVehicleEntityCounts; import org.opentripplanner.service.vehiclerental.model.RentalVehicleType; +import org.opentripplanner.service.vehiclerental.model.RentalVehicleTypeCount; +import org.opentripplanner.service.vehiclerental.model.VehicleRentalPlace; +import org.opentripplanner.service.vehiclerental.model.VehicleRentalStation; +import org.opentripplanner.service.vehiclerental.model.VehicleRentalStationUris; import org.opentripplanner.service.vehiclerental.model.VehicleRentalSystem; +import org.opentripplanner.service.vehiclerental.model.VehicleRentalVehicle; import org.opentripplanner.transit.model.basic.Money; import org.opentripplanner.transit.model.network.Route; import org.opentripplanner.transit.model.network.TripPattern; +import org.opentripplanner.transit.model.organization.Agency; +import org.opentripplanner.transit.model.timetable.Trip; +import org.opentripplanner.transit.model.timetable.booking.BookingInfo; +import org.opentripplanner.transit.model.timetable.booking.BookingTime; public class GraphQLDataFetchers { From 54752ba734c0f9589f8d7fb450145b3298834809 Mon Sep 17 00:00:00 2001 From: Ville Pihlava Date: Tue, 10 Sep 2024 14:02:59 +0300 Subject: [PATCH 006/110] Fix format. --- .../resources/org/opentripplanner/apis/gtfs/schema.graphqls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls b/src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls index dee8d0b7a60..0162c2090f2 100644 --- a/src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls +++ b/src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls @@ -2267,9 +2267,9 @@ type Trip implements Node { ): Stoptime "Whether bikes are allowed on board the vehicle running this trip" bikesAllowed: BikesAllowed + blockId: String "Whether cars are allowed on board the vehicle running this trip" carsAllowed: CarsAllowed - blockId: String "Departure time from the first stop" departureStoptime( """ From fe067208d65816fca706f5c0491b95f687ef64a9 Mon Sep 17 00:00:00 2001 From: Ville Pihlava Date: Tue, 17 Sep 2024 14:08:20 +0300 Subject: [PATCH 007/110] Add changes based on review comments. --- .../apis/gtfs/datafetchers/TripImpl.java | 7 --- .../gtfs/generated/GraphQLDataFetchers.java | 3 - .../apis/gtfs/mapping/BikesAllowedMapper.java | 4 +- .../apis/gtfs/mapping/CarsAllowedMapper.java | 4 +- .../mapping/RequestModesMapper.java | 3 + .../module/StreetLinkerModule.java | 42 +------------- .../gtfs/mapping/CarAccessMapper.java | 13 ++--- ...RouteRequestTransitDataProviderFilter.java | 6 +- .../transit/model/network/BikeAccess.java | 3 + .../transit/model/network/CarAccess.java | 3 + .../transit/service/TransitModel.java | 51 +++++++++++++++++ .../opentripplanner/apis/gtfs/schema.graphqls | 15 +++-- .../gtfs/mapping/BikesAllowedMapperTest.java | 15 ++--- .../gtfs/mapping/CarsAllowedMapperTest.java | 15 ++--- .../module/StreetLinkerModuleTest.java | 10 ++-- ...eRequestTransitDataProviderFilterTest.java | 57 ++++++++++++++----- 16 files changed, 138 insertions(+), 113 deletions(-) diff --git a/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/TripImpl.java b/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/TripImpl.java index 0ec7d63b101..21bff637976 100644 --- a/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/TripImpl.java +++ b/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/TripImpl.java @@ -20,9 +20,7 @@ import org.opentripplanner.apis.gtfs.generated.GraphQLDataFetchers; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLBikesAllowed; -import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLCarsAllowed; import org.opentripplanner.apis.gtfs.mapping.BikesAllowedMapper; -import org.opentripplanner.apis.gtfs.mapping.CarsAllowedMapper; import org.opentripplanner.apis.gtfs.model.TripOccupancy; import org.opentripplanner.apis.support.SemanticHash; import org.opentripplanner.framework.time.ServiceDateUtils; @@ -174,11 +172,6 @@ public DataFetcher bikesAllowed() { return environment -> BikesAllowedMapper.map(getSource(environment).getBikesAllowed()); } - @Override - public DataFetcher carsAllowed() { - return environment -> CarsAllowedMapper.map(getSource(environment).getCarsAllowed()); - } - @Override public DataFetcher blockId() { return environment -> getSource(environment).getGtfsBlockId(); diff --git a/src/main/java/org/opentripplanner/apis/gtfs/generated/GraphQLDataFetchers.java b/src/main/java/org/opentripplanner/apis/gtfs/generated/GraphQLDataFetchers.java index 0a0d231299c..67944543580 100644 --- a/src/main/java/org/opentripplanner/apis/gtfs/generated/GraphQLDataFetchers.java +++ b/src/main/java/org/opentripplanner/apis/gtfs/generated/GraphQLDataFetchers.java @@ -16,7 +16,6 @@ import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLAlertEffectType; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLAlertSeverityLevelType; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLBikesAllowed; -import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLCarsAllowed; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLInputField; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLOccupancyStatus; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLRelativeDirection; @@ -1149,8 +1148,6 @@ public interface GraphQLTrip { public DataFetcher blockId(); - public DataFetcher carsAllowed(); - public DataFetcher departureStoptime(); public DataFetcher directionId(); diff --git a/src/main/java/org/opentripplanner/apis/gtfs/mapping/BikesAllowedMapper.java b/src/main/java/org/opentripplanner/apis/gtfs/mapping/BikesAllowedMapper.java index cd04601d599..79f55f1e50a 100644 --- a/src/main/java/org/opentripplanner/apis/gtfs/mapping/BikesAllowedMapper.java +++ b/src/main/java/org/opentripplanner/apis/gtfs/mapping/BikesAllowedMapper.java @@ -1,13 +1,11 @@ package org.opentripplanner.apis.gtfs.mapping; -import javax.annotation.Nonnull; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLBikesAllowed; import org.opentripplanner.transit.model.network.BikeAccess; public class BikesAllowedMapper { - @Nonnull - public static GraphQLBikesAllowed map(@Nonnull BikeAccess bikesAllowed) { + public static GraphQLBikesAllowed map(BikeAccess bikesAllowed) { return switch (bikesAllowed) { case UNKNOWN -> GraphQLBikesAllowed.NO_INFORMATION; case ALLOWED -> GraphQLBikesAllowed.ALLOWED; diff --git a/src/main/java/org/opentripplanner/apis/gtfs/mapping/CarsAllowedMapper.java b/src/main/java/org/opentripplanner/apis/gtfs/mapping/CarsAllowedMapper.java index 0c479a8664c..8b35133e615 100644 --- a/src/main/java/org/opentripplanner/apis/gtfs/mapping/CarsAllowedMapper.java +++ b/src/main/java/org/opentripplanner/apis/gtfs/mapping/CarsAllowedMapper.java @@ -1,13 +1,11 @@ package org.opentripplanner.apis.gtfs.mapping; -import javax.annotation.Nonnull; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLCarsAllowed; import org.opentripplanner.transit.model.network.CarAccess; public class CarsAllowedMapper { - @Nonnull - public static GraphQLCarsAllowed map(@Nonnull CarAccess carsAllowed) { + public static GraphQLCarsAllowed map(CarAccess carsAllowed) { return switch (carsAllowed) { case UNKNOWN -> GraphQLCarsAllowed.NO_INFORMATION; case ALLOWED -> GraphQLCarsAllowed.ALLOWED; diff --git a/src/main/java/org/opentripplanner/apis/transmodel/mapping/RequestModesMapper.java b/src/main/java/org/opentripplanner/apis/transmodel/mapping/RequestModesMapper.java index 849d39e35e7..bf9abd3a60d 100644 --- a/src/main/java/org/opentripplanner/apis/transmodel/mapping/RequestModesMapper.java +++ b/src/main/java/org/opentripplanner/apis/transmodel/mapping/RequestModesMapper.java @@ -28,6 +28,9 @@ static RequestModes mapRequestModes(Map modesInput) { ensureValueAndSet(accessMode, mBuilder::withAccessMode); ensureValueAndSet((StreetMode) modesInput.get(egressModeKey), mBuilder::withEgressMode); ensureValueAndSet((StreetMode) modesInput.get(directModeKey), mBuilder::withDirectMode); + // The only cases in which the transferMode isn't WALK are when the accessMode is either BIKE or CAR. + // In these cases, the transferMode is the same as the accessMode. This check is not strictly necessary + // if there is a need for more freedom for specifying the transferMode. Optional.ofNullable(accessMode).filter(IS_BIKE_OR_CAR).ifPresent(mBuilder::withTransferMode); return mBuilder.build(); diff --git a/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java b/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java index fbb65a5a850..402e1e5eedb 100644 --- a/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java +++ b/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java @@ -84,49 +84,11 @@ public void linkTransitStops(Graph graph, TransitModel transitModel) { LOG.info(progress.startMessage()); Set stopLocationsUsedForFlexTrips = Set.of(); - if (OTPFeature.FlexRouting.isOn()) { - stopLocationsUsedForFlexTrips = - transitModel - .getAllFlexTrips() - .stream() - .flatMap(t -> t.getStops().stream()) - .collect(Collectors.toSet()); - - stopLocationsUsedForFlexTrips.addAll( - stopLocationsUsedForFlexTrips - .stream() - .filter(GroupStop.class::isInstance) - .map(GroupStop.class::cast) - .flatMap(g -> g.getChildLocations().stream().filter(RegularStop.class::isInstance)) - .toList() - ); + stopLocationsUsedForFlexTrips = transitModel.getStopLocationsUsedForFlexTrips(); } - // The stops that are used by transit capable of transporting cars need to be connected to the road network (e.g. car ferries). - Set stopLocationsUsedForCarsAllowedTrips = Set.of(); - stopLocationsUsedForCarsAllowedTrips = - transitModel - .getAllTripPatterns() - .stream() - .filter(t -> - t - .getScheduledTimetable() - .getTripTimes() - .stream() - .anyMatch(tt -> tt.getTrip().getCarsAllowed() == CarAccess.ALLOWED) - ) - .flatMap(t -> t.getStops().stream()) - .collect(Collectors.toSet()); - - stopLocationsUsedForCarsAllowedTrips.addAll( - stopLocationsUsedForCarsAllowedTrips - .stream() - .filter(GroupStop.class::isInstance) - .map(GroupStop.class::cast) - .flatMap(g -> g.getChildLocations().stream().filter(RegularStop.class::isInstance)) - .toList() - ); + Set stopLocationsUsedForCarsAllowedTrips = transitModel.getStopLocationsUsedForCarsAllowedTrips(); for (TransitStopVertex tStop : vertices) { // Stops with pathways do not need to be connected to the street network, since there are explicit entrances defined for that diff --git a/src/main/java/org/opentripplanner/gtfs/mapping/CarAccessMapper.java b/src/main/java/org/opentripplanner/gtfs/mapping/CarAccessMapper.java index d328d1aa06e..4034814462b 100644 --- a/src/main/java/org/opentripplanner/gtfs/mapping/CarAccessMapper.java +++ b/src/main/java/org/opentripplanner/gtfs/mapping/CarAccessMapper.java @@ -10,13 +10,10 @@ class CarAccessMapper { public static CarAccess mapForTrip(Trip rhs) { int carsAllowed = rhs.getCarsAllowed(); - switch (carsAllowed) { - case 1: - return CarAccess.ALLOWED; - case 2: - return CarAccess.NOT_ALLOWED; - default: - return CarAccess.UNKNOWN; - } + return switch (carsAllowed) { + case 1 -> CarAccess.ALLOWED; + case 2 -> CarAccess.NOT_ALLOWED; + default -> CarAccess.UNKNOWN; + }; } } diff --git a/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RouteRequestTransitDataProviderFilter.java b/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RouteRequestTransitDataProviderFilter.java index 2fa4a9dff15..a4f89c0cf7e 100644 --- a/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RouteRequestTransitDataProviderFilter.java +++ b/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RouteRequestTransitDataProviderFilter.java @@ -89,10 +89,6 @@ public static BikeAccess bikeAccessForTrip(Trip trip) { return trip.getRoute().getBikesAllowed(); } - public static CarAccess carAccessForTrip(Trip trip) { - return trip.getCarsAllowed(); - } - @Override public boolean tripPatternPredicate(TripPatternForDate tripPatternForDate) { for (TransitFilter filter : filters) { @@ -114,7 +110,7 @@ public boolean tripTimesPredicate(TripTimes tripTimes, boolean withFilters) { } if (requireCarsAllowed) { - if (carAccessForTrip(trip) != CarAccess.ALLOWED) { + if (trip.getCarsAllowed() != CarAccess.ALLOWED) { return false; } } diff --git a/src/main/java/org/opentripplanner/transit/model/network/BikeAccess.java b/src/main/java/org/opentripplanner/transit/model/network/BikeAccess.java index 536a01a9b14..043c93e04e6 100644 --- a/src/main/java/org/opentripplanner/transit/model/network/BikeAccess.java +++ b/src/main/java/org/opentripplanner/transit/model/network/BikeAccess.java @@ -1,6 +1,9 @@ package org.opentripplanner.transit.model.network; /** + * This represents the state of whether bikes are allowed on board trips (or routes). + * If the state is unknown, bikes are not allowed. + *

* GTFS codes: * 0 = unknown / unspecified, 1 = bikes allowed, 2 = bikes NOT allowed */ diff --git a/src/main/java/org/opentripplanner/transit/model/network/CarAccess.java b/src/main/java/org/opentripplanner/transit/model/network/CarAccess.java index 0a7a4f91845..e5e15913197 100644 --- a/src/main/java/org/opentripplanner/transit/model/network/CarAccess.java +++ b/src/main/java/org/opentripplanner/transit/model/network/CarAccess.java @@ -1,6 +1,9 @@ package org.opentripplanner.transit.model.network; /** + * This represents the state of whether cars are allowed on board trips. + * If the state is unknown, cars are not allowed. + *

* GTFS codes: * 0 = unknown / unspecified, 1 = cars allowed, 2 = cars NOT allowed */ diff --git a/src/main/java/org/opentripplanner/transit/service/TransitModel.java b/src/main/java/org/opentripplanner/transit/service/TransitModel.java index 84c7597d562..99c0f3fadb8 100644 --- a/src/main/java/org/opentripplanner/transit/service/TransitModel.java +++ b/src/main/java/org/opentripplanner/transit/service/TransitModel.java @@ -19,6 +19,7 @@ import java.util.Objects; import java.util.Optional; import java.util.Set; +import java.util.stream.Collectors; import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opentripplanner.ext.flex.trip.FlexTrip; @@ -44,9 +45,12 @@ import org.opentripplanner.transit.model.framework.AbstractTransitEntity; import org.opentripplanner.transit.model.framework.Deduplicator; import org.opentripplanner.transit.model.framework.FeedScopedId; +import org.opentripplanner.transit.model.network.CarAccess; import org.opentripplanner.transit.model.network.TripPattern; import org.opentripplanner.transit.model.organization.Agency; import org.opentripplanner.transit.model.organization.Operator; +import org.opentripplanner.transit.model.site.GroupStop; +import org.opentripplanner.transit.model.site.RegularStop; import org.opentripplanner.transit.model.site.StopLocation; import org.opentripplanner.transit.model.timetable.TripOnServiceDate; import org.opentripplanner.updater.GraphUpdaterManager; @@ -556,6 +560,53 @@ public FlexTrip getFlexTrip(FeedScopedId tripId) { return flexTripsById.get(tripId); } + public Set getStopLocationsUsedForFlexTrips() { + Set stopLocations = getAllFlexTrips() + .stream() + .flatMap(t -> t.getStops().stream()) + .collect(Collectors.toSet()); + + stopLocations.addAll( + stopLocations + .stream() + .filter(GroupStop.class::isInstance) + .map(GroupStop.class::cast) + .flatMap(g -> g.getChildLocations().stream().filter(RegularStop.class::isInstance)) + .toList() + ); + return stopLocations; + } + + /** + * The stops that are used by transit capable of transporting cars need to be + * connected to the road network (e.g. car ferries). This method returns the + * stops that are used by trips that allow cars. + * @return set of stop locations that are used for trips that allow cars + */ + public Set getStopLocationsUsedForCarsAllowedTrips() { + Set stopLocations = getAllTripPatterns() + .stream() + .filter(t -> + t + .getScheduledTimetable() + .getTripTimes() + .stream() + .anyMatch(tt -> tt.getTrip().getCarsAllowed() == CarAccess.ALLOWED) + ) + .flatMap(t -> t.getStops().stream()) + .collect(Collectors.toSet()); + + stopLocations.addAll( + stopLocations + .stream() + .filter(GroupStop.class::isInstance) + .map(GroupStop.class::cast) + .flatMap(g -> g.getChildLocations().stream().filter(RegularStop.class::isInstance)) + .toList() + ); + return stopLocations; + } + private void invalidateIndex() { this.index = null; } diff --git a/src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls b/src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls index 0162c2090f2..618d3cb4850 100644 --- a/src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls +++ b/src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls @@ -2268,8 +2268,6 @@ type Trip implements Node { "Whether bikes are allowed on board the vehicle running this trip" bikesAllowed: BikesAllowed blockId: String - "Whether cars are allowed on board the vehicle running this trip" - carsAllowed: CarsAllowed "Departure time from the first stop" departureStoptime( """ @@ -3073,8 +3071,9 @@ enum PlanAccessMode { """ BICYCLE_RENTAL """ - Driving a car from the origin to the destination. - TODO add more thorough description + Driving to a stop and boarding a vehicle with the car. + Access can use driving only if the mode used for transfers + and egress is also `CAR`. """ CAR """ @@ -3187,8 +3186,8 @@ enum PlanEgressMode { """ BICYCLE_RENTAL """ - Driving a car from the origin to the destination. - TODO add more thorough description + Driving from a stop to the destination. Egress can use driving only if the mode + used for access and transfers is also `CAR`. """ CAR """ @@ -3230,8 +3229,8 @@ enum PlanTransferMode { """ BICYCLE """ - Driving a car from the origin to the destination. - TODO add more thorough description + Driving between transit vehicles. Transfers can only use driving if the mode + used for access and egress is also `CAR`. """ CAR "Walking between transit vehicles (typically between stops)." diff --git a/src/test/java/org/opentripplanner/apis/gtfs/mapping/BikesAllowedMapperTest.java b/src/test/java/org/opentripplanner/apis/gtfs/mapping/BikesAllowedMapperTest.java index 5ed267f1f4f..af1441e7dc4 100644 --- a/src/test/java/org/opentripplanner/apis/gtfs/mapping/BikesAllowedMapperTest.java +++ b/src/test/java/org/opentripplanner/apis/gtfs/mapping/BikesAllowedMapperTest.java @@ -1,8 +1,7 @@ package org.opentripplanner.apis.gtfs.mapping; -import static org.junit.jupiter.api.Assertions.assertEquals; +import static com.google.common.truth.Truth.assertThat; -import java.util.Arrays; import org.junit.jupiter.api.Test; import org.opentripplanner.transit.model.network.BikeAccess; @@ -10,12 +9,10 @@ class BikesAllowedMapperTest { @Test void mapping() { - Arrays - .stream(BikeAccess.values()) - .filter(ba -> ba != BikeAccess.UNKNOWN) - .forEach(d -> { - var mapped = BikesAllowedMapper.map(d); - assertEquals(d.toString(), mapped.toString()); - }); + assertThat(BikeAccess.ALLOWED.toString()) + .isEqualTo(BikesAllowedMapper.map(BikeAccess.ALLOWED).toString()); + assertThat(BikeAccess.NOT_ALLOWED.toString()) + .isEqualTo(BikesAllowedMapper.map(BikeAccess.NOT_ALLOWED).toString()); + assertThat("NO_INFORMATION").isEqualTo(BikesAllowedMapper.map(BikeAccess.UNKNOWN).toString()); } } diff --git a/src/test/java/org/opentripplanner/apis/gtfs/mapping/CarsAllowedMapperTest.java b/src/test/java/org/opentripplanner/apis/gtfs/mapping/CarsAllowedMapperTest.java index a2a1b40a5e8..9e942eee458 100644 --- a/src/test/java/org/opentripplanner/apis/gtfs/mapping/CarsAllowedMapperTest.java +++ b/src/test/java/org/opentripplanner/apis/gtfs/mapping/CarsAllowedMapperTest.java @@ -1,8 +1,7 @@ package org.opentripplanner.apis.gtfs.mapping; -import static org.junit.jupiter.api.Assertions.assertEquals; +import static com.google.common.truth.Truth.assertThat; -import java.util.Arrays; import org.junit.jupiter.api.Test; import org.opentripplanner.transit.model.network.CarAccess; @@ -10,12 +9,10 @@ class CarsAllowedMapperTest { @Test void mapping() { - Arrays - .stream(CarAccess.values()) - .filter(ba -> ba != CarAccess.UNKNOWN) - .forEach(d -> { - var mapped = CarsAllowedMapper.map(d); - assertEquals(d.toString(), mapped.toString()); - }); + assertThat(CarAccess.ALLOWED.toString()) + .isEqualTo(CarsAllowedMapper.map(CarAccess.ALLOWED).toString()); + assertThat(CarAccess.NOT_ALLOWED.toString()) + .isEqualTo(CarsAllowedMapper.map(CarAccess.NOT_ALLOWED).toString()); + assertThat("NO_INFORMATION").isEqualTo(CarsAllowedMapper.map(CarAccess.UNKNOWN).toString()); } } diff --git a/src/test/java/org/opentripplanner/graph_builder/module/StreetLinkerModuleTest.java b/src/test/java/org/opentripplanner/graph_builder/module/StreetLinkerModuleTest.java index e5f77f57659..a71921148aa 100644 --- a/src/test/java/org/opentripplanner/graph_builder/module/StreetLinkerModuleTest.java +++ b/src/test/java/org/opentripplanner/graph_builder/module/StreetLinkerModuleTest.java @@ -1,6 +1,6 @@ package org.opentripplanner.graph_builder.module; -import static org.junit.jupiter.api.Assertions.assertEquals; +import static com.google.common.truth.Truth.assertThat; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertInstanceOf; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -51,7 +51,7 @@ void linkingIsIdempotent() { module.buildGraph(); assertTrue(model.stopVertex().isConnectedToGraph()); - assertEquals(1, model.stopVertex().getOutgoing().size()); + assertThat(model.stopVertex().getOutgoing()).hasSize(1); } @Test @@ -63,7 +63,7 @@ void linkRegularStop() { assertTrue(model.stopVertex().isConnectedToGraph()); - assertEquals(1, model.stopVertex().getOutgoing().size()); + assertThat(model.stopVertex().getOutgoing()).hasSize(1); var outgoing = model.outgoingLinks().getFirst(); assertInstanceOf(StreetTransitStopLink.class, outgoing); @@ -87,7 +87,7 @@ void linkFlexStop() { assertTrue(model.stopVertex().isConnectedToGraph()); // stop is used by a flex trip, needs to be linked to both the walk and car edge - assertEquals(2, model.stopVertex().getOutgoing().size()); + assertThat(model.stopVertex().getOutgoing()).hasSize(2); var linkToWalk = model.outgoingLinks().getFirst(); SplitterVertex walkSplit = (SplitterVertex) linkToWalk.getToVertex(); @@ -119,7 +119,7 @@ void linkCarsAllowedStop() { assertTrue(model.stopVertex().isConnectedToGraph()); // Because the stop is used by a carsAllowed trip it needs to be linked to both the walk and car edge - assertEquals(2, model.stopVertex().getOutgoing().size()); + assertThat(model.stopVertex().getOutgoing()).hasSize(2); var linkToWalk = model.outgoingLinks().getFirst(); SplitterVertex walkSplit = (SplitterVertex) linkToWalk.getToVertex(); diff --git a/src/test/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RouteRequestTransitDataProviderFilterTest.java b/src/test/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RouteRequestTransitDataProviderFilterTest.java index c5dea627d5a..c3fe0756bb0 100644 --- a/src/test/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RouteRequestTransitDataProviderFilterTest.java +++ b/src/test/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RouteRequestTransitDataProviderFilterTest.java @@ -1,5 +1,6 @@ package org.opentripplanner.routing.algorithm.raptoradapter.transit.request; +import static com.google.common.truth.Truth.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -769,23 +770,53 @@ void testBikesAllowed() { @Test void testCarsAllowed() { - RouteBuilder routeBuilder = TransitModelForTest.route("1"); - TripBuilder trip = Trip.of(TransitModelForTest.id("T1")).withRoute(routeBuilder.build()); - - assertEquals( - CarAccess.UNKNOWN, - RouteRequestTransitDataProviderFilter.carAccessForTrip(trip.build()) - ); - trip.withCarsAllowed(CarAccess.ALLOWED); - assertEquals( + TripTimes tripTimesCarsAllowed = createTestTripTimes( + TRIP_ID, + ROUTE, + BikeAccess.UNKNOWN, CarAccess.ALLOWED, - RouteRequestTransitDataProviderFilter.carAccessForTrip(trip.build()) + TransitMode.FERRY, + null, + Accessibility.NO_INFORMATION, + TripAlteration.PLANNED ); - trip.withCarsAllowed(CarAccess.NOT_ALLOWED); - assertEquals( + + TripTimes tripTimesCarsNotAllowed = createTestTripTimes( + TRIP_ID, + ROUTE, + BikeAccess.UNKNOWN, CarAccess.NOT_ALLOWED, - RouteRequestTransitDataProviderFilter.carAccessForTrip(trip.build()) + TransitMode.FERRY, + null, + Accessibility.NO_INFORMATION, + TripAlteration.PLANNED ); + + TripTimes tripTimesCarsUnknown = createTestTripTimes( + TRIP_ID, + ROUTE, + BikeAccess.UNKNOWN, + CarAccess.UNKNOWN, + TransitMode.FERRY, + null, + Accessibility.NO_INFORMATION, + TripAlteration.PLANNED + ); + + RouteRequestTransitDataProviderFilter filter = new RouteRequestTransitDataProviderFilter( + false, + true, + false, + DEFAULT_ACCESSIBILITY, + false, + false, + Set.of(), + List.of(AllowAllTransitFilter.of()) + ); + + assertThat(filter.tripTimesPredicate(tripTimesCarsAllowed, false)).isTrue(); + assertThat(filter.tripTimesPredicate(tripTimesCarsNotAllowed, false)).isFalse(); + assertThat(filter.tripTimesPredicate(tripTimesCarsUnknown, false)).isFalse(); } @Test From 7e1022fce9eb2d7282830bf87e916ac279c4fc7a Mon Sep 17 00:00:00 2001 From: Ville Pihlava Date: Fri, 20 Sep 2024 14:12:22 +0300 Subject: [PATCH 008/110] Add changes to comments and tests. --- .../transit/model/network/BikeAccess.java | 1 - .../transit/model/network/CarAccess.java | 1 - .../apis/gtfs/mapping/BikesAllowedMapperTest.java | 11 +++++------ .../apis/gtfs/mapping/CarsAllowedMapperTest.java | 11 +++++------ 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/main/java/org/opentripplanner/transit/model/network/BikeAccess.java b/src/main/java/org/opentripplanner/transit/model/network/BikeAccess.java index 043c93e04e6..c0d850e9ce7 100644 --- a/src/main/java/org/opentripplanner/transit/model/network/BikeAccess.java +++ b/src/main/java/org/opentripplanner/transit/model/network/BikeAccess.java @@ -2,7 +2,6 @@ /** * This represents the state of whether bikes are allowed on board trips (or routes). - * If the state is unknown, bikes are not allowed. *

* GTFS codes: * 0 = unknown / unspecified, 1 = bikes allowed, 2 = bikes NOT allowed diff --git a/src/main/java/org/opentripplanner/transit/model/network/CarAccess.java b/src/main/java/org/opentripplanner/transit/model/network/CarAccess.java index e5e15913197..2fca43cfb32 100644 --- a/src/main/java/org/opentripplanner/transit/model/network/CarAccess.java +++ b/src/main/java/org/opentripplanner/transit/model/network/CarAccess.java @@ -2,7 +2,6 @@ /** * This represents the state of whether cars are allowed on board trips. - * If the state is unknown, cars are not allowed. *

* GTFS codes: * 0 = unknown / unspecified, 1 = cars allowed, 2 = cars NOT allowed diff --git a/src/test/java/org/opentripplanner/apis/gtfs/mapping/BikesAllowedMapperTest.java b/src/test/java/org/opentripplanner/apis/gtfs/mapping/BikesAllowedMapperTest.java index af1441e7dc4..035d3605a21 100644 --- a/src/test/java/org/opentripplanner/apis/gtfs/mapping/BikesAllowedMapperTest.java +++ b/src/test/java/org/opentripplanner/apis/gtfs/mapping/BikesAllowedMapperTest.java @@ -1,18 +1,17 @@ package org.opentripplanner.apis.gtfs.mapping; -import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test; +import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLBikesAllowed; import org.opentripplanner.transit.model.network.BikeAccess; class BikesAllowedMapperTest { @Test void mapping() { - assertThat(BikeAccess.ALLOWED.toString()) - .isEqualTo(BikesAllowedMapper.map(BikeAccess.ALLOWED).toString()); - assertThat(BikeAccess.NOT_ALLOWED.toString()) - .isEqualTo(BikesAllowedMapper.map(BikeAccess.NOT_ALLOWED).toString()); - assertThat("NO_INFORMATION").isEqualTo(BikesAllowedMapper.map(BikeAccess.UNKNOWN).toString()); + assertEquals(GraphQLBikesAllowed.NO_INFORMATION, BikesAllowedMapper.map(BikeAccess.UNKNOWN)); + assertEquals(GraphQLBikesAllowed.NOT_ALLOWED, BikesAllowedMapper.map(BikeAccess.NOT_ALLOWED)); + assertEquals(GraphQLBikesAllowed.ALLOWED, BikesAllowedMapper.map(BikeAccess.ALLOWED)); } } diff --git a/src/test/java/org/opentripplanner/apis/gtfs/mapping/CarsAllowedMapperTest.java b/src/test/java/org/opentripplanner/apis/gtfs/mapping/CarsAllowedMapperTest.java index 9e942eee458..a38df9b685b 100644 --- a/src/test/java/org/opentripplanner/apis/gtfs/mapping/CarsAllowedMapperTest.java +++ b/src/test/java/org/opentripplanner/apis/gtfs/mapping/CarsAllowedMapperTest.java @@ -1,18 +1,17 @@ package org.opentripplanner.apis.gtfs.mapping; -import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test; +import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLCarsAllowed; import org.opentripplanner.transit.model.network.CarAccess; class CarsAllowedMapperTest { @Test void mapping() { - assertThat(CarAccess.ALLOWED.toString()) - .isEqualTo(CarsAllowedMapper.map(CarAccess.ALLOWED).toString()); - assertThat(CarAccess.NOT_ALLOWED.toString()) - .isEqualTo(CarsAllowedMapper.map(CarAccess.NOT_ALLOWED).toString()); - assertThat("NO_INFORMATION").isEqualTo(CarsAllowedMapper.map(CarAccess.UNKNOWN).toString()); + assertEquals(GraphQLCarsAllowed.NO_INFORMATION, CarsAllowedMapper.map(CarAccess.UNKNOWN)); + assertEquals(GraphQLCarsAllowed.NOT_ALLOWED, CarsAllowedMapper.map(CarAccess.NOT_ALLOWED)); + assertEquals(GraphQLCarsAllowed.ALLOWED, CarsAllowedMapper.map(CarAccess.ALLOWED)); } } From f3e982b244595a393cba56e6376064456429ae68 Mon Sep 17 00:00:00 2001 From: Ville Pihlava Date: Tue, 24 Sep 2024 09:43:26 +0300 Subject: [PATCH 009/110] Remove unused carsAllowed related information from schema. --- .../apis/gtfs/generated/GraphQLTypes.java | 6 ------ .../apis/gtfs/generated/graphql-codegen.yml | 1 - .../apis/gtfs/mapping/CarsAllowedMapper.java | 15 --------------- .../opentripplanner/apis/gtfs/schema.graphqls | 9 --------- .../gtfs/mapping/CarsAllowedMapperTest.java | 17 ----------------- 5 files changed, 48 deletions(-) delete mode 100644 src/main/java/org/opentripplanner/apis/gtfs/mapping/CarsAllowedMapper.java delete mode 100644 src/test/java/org/opentripplanner/apis/gtfs/mapping/CarsAllowedMapperTest.java diff --git a/src/main/java/org/opentripplanner/apis/gtfs/generated/GraphQLTypes.java b/src/main/java/org/opentripplanner/apis/gtfs/generated/GraphQLTypes.java index 06f515466ac..e93fca59ac6 100644 --- a/src/main/java/org/opentripplanner/apis/gtfs/generated/GraphQLTypes.java +++ b/src/main/java/org/opentripplanner/apis/gtfs/generated/GraphQLTypes.java @@ -566,12 +566,6 @@ public void setGraphQLBannedNetworks(List bannedNetworks) { } } - public enum GraphQLCarsAllowed { - ALLOWED, - NOT_ALLOWED, - NO_INFORMATION, - } - public static class GraphQLCyclingOptimizationInput { private GraphQLTriangleCyclingFactorsInput triangle; diff --git a/src/main/java/org/opentripplanner/apis/gtfs/generated/graphql-codegen.yml b/src/main/java/org/opentripplanner/apis/gtfs/generated/graphql-codegen.yml index fb72e63986c..29490a28b78 100644 --- a/src/main/java/org/opentripplanner/apis/gtfs/generated/graphql-codegen.yml +++ b/src/main/java/org/opentripplanner/apis/gtfs/generated/graphql-codegen.yml @@ -53,7 +53,6 @@ config: RentalVehicle: org.opentripplanner.service.vehiclerental.model.VehicleRentalVehicle#VehicleRentalVehicle VehicleRentalUris: org.opentripplanner.service.vehiclerental.model.VehicleRentalStationUris#VehicleRentalStationUris BikesAllowed: org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLBikesAllowed#GraphQLBikesAllowed - CarsAllowed: org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLCarsAllowed#GraphQLCarsAllowed BookingInfo: org.opentripplanner.transit.model.timetable.booking.BookingInfo#BookingInfo BookingTime: org.opentripplanner.transit.model.timetable.booking.BookingTime#BookingTime CarPark: org.opentripplanner.routing.vehicle_parking.VehicleParking#VehicleParking diff --git a/src/main/java/org/opentripplanner/apis/gtfs/mapping/CarsAllowedMapper.java b/src/main/java/org/opentripplanner/apis/gtfs/mapping/CarsAllowedMapper.java deleted file mode 100644 index 8b35133e615..00000000000 --- a/src/main/java/org/opentripplanner/apis/gtfs/mapping/CarsAllowedMapper.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.opentripplanner.apis.gtfs.mapping; - -import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLCarsAllowed; -import org.opentripplanner.transit.model.network.CarAccess; - -public class CarsAllowedMapper { - - public static GraphQLCarsAllowed map(CarAccess carsAllowed) { - return switch (carsAllowed) { - case UNKNOWN -> GraphQLCarsAllowed.NO_INFORMATION; - case ALLOWED -> GraphQLCarsAllowed.ALLOWED; - case NOT_ALLOWED -> GraphQLCarsAllowed.NOT_ALLOWED; - }; - } -} diff --git a/src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls b/src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls index 618d3cb4850..01f4d30d487 100644 --- a/src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls +++ b/src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls @@ -2774,15 +2774,6 @@ enum BikesAllowed { NO_INFORMATION } -enum CarsAllowed { - "The vehicle being used on this particular trip can accommodate at least one car." - ALLOWED - "No cars are allowed on this trip." - NOT_ALLOWED - "There is no car information for the trip." - NO_INFORMATION -} - """ Predefined optimization alternatives for bicycling routing. For more customization, one can use the triangle factors. diff --git a/src/test/java/org/opentripplanner/apis/gtfs/mapping/CarsAllowedMapperTest.java b/src/test/java/org/opentripplanner/apis/gtfs/mapping/CarsAllowedMapperTest.java deleted file mode 100644 index a38df9b685b..00000000000 --- a/src/test/java/org/opentripplanner/apis/gtfs/mapping/CarsAllowedMapperTest.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.opentripplanner.apis.gtfs.mapping; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -import org.junit.jupiter.api.Test; -import org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLCarsAllowed; -import org.opentripplanner.transit.model.network.CarAccess; - -class CarsAllowedMapperTest { - - @Test - void mapping() { - assertEquals(GraphQLCarsAllowed.NO_INFORMATION, CarsAllowedMapper.map(CarAccess.UNKNOWN)); - assertEquals(GraphQLCarsAllowed.NOT_ALLOWED, CarsAllowedMapper.map(CarAccess.NOT_ALLOWED)); - assertEquals(GraphQLCarsAllowed.ALLOWED, CarsAllowedMapper.map(CarAccess.ALLOWED)); - } -} From 1d36e7c8837c97aa8d51f6bc2bd77ef42e13b6e6 Mon Sep 17 00:00:00 2001 From: Ville Pihlava Date: Fri, 27 Sep 2024 13:40:34 +0300 Subject: [PATCH 010/110] Change location of function and make if statement chain more compact. --- .../module/StreetLinkerModule.java | 20 ++++++++++++++++++- ...RouteRequestTransitDataProviderFilter.java | 12 ++++------- .../transit/service/TransitModel.java | 17 ---------------- 3 files changed, 23 insertions(+), 26 deletions(-) diff --git a/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java b/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java index 402e1e5eedb..0930f5a4576 100644 --- a/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java +++ b/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java @@ -85,7 +85,7 @@ public void linkTransitStops(Graph graph, TransitModel transitModel) { Set stopLocationsUsedForFlexTrips = Set.of(); if (OTPFeature.FlexRouting.isOn()) { - stopLocationsUsedForFlexTrips = transitModel.getStopLocationsUsedForFlexTrips(); + stopLocationsUsedForFlexTrips = getStopLocationsUsedForFlexTrips(transitModel); } Set stopLocationsUsedForCarsAllowedTrips = transitModel.getStopLocationsUsedForCarsAllowedTrips(); @@ -326,6 +326,24 @@ private VehicleParking removeVehicleParkingEntranceVertexFromGraph( } } + private Set getStopLocationsUsedForFlexTrips(TransitModel transitModel) { + Set stopLocations = transitModel + .getAllFlexTrips() + .stream() + .flatMap(t -> t.getStops().stream()) + .collect(Collectors.toSet()); + + stopLocations.addAll( + stopLocations + .stream() + .filter(GroupStop.class::isInstance) + .map(GroupStop.class::cast) + .flatMap(g -> g.getChildLocations().stream().filter(RegularStop.class::isInstance)) + .toList() + ); + return stopLocations; + } + private enum StopLinkType { /** * Only ensure that the link leads to a walkable edge. diff --git a/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RouteRequestTransitDataProviderFilter.java b/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RouteRequestTransitDataProviderFilter.java index a4f89c0cf7e..514a5b56f9a 100644 --- a/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RouteRequestTransitDataProviderFilter.java +++ b/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RouteRequestTransitDataProviderFilter.java @@ -103,16 +103,12 @@ public boolean tripPatternPredicate(TripPatternForDate tripPatternForDate) { public boolean tripTimesPredicate(TripTimes tripTimes, boolean withFilters) { final Trip trip = tripTimes.getTrip(); - if (requireBikesAllowed) { - if (bikeAccessForTrip(trip) != BikeAccess.ALLOWED) { - return false; - } + if (requireBikesAllowed && bikeAccessForTrip(trip) != BikeAccess.ALLOWED) { + return false; } - if (requireCarsAllowed) { - if (trip.getCarsAllowed() != CarAccess.ALLOWED) { - return false; - } + if (requireCarsAllowed && trip.getCarsAllowed() != CarAccess.ALLOWED) { + return false; } if (wheelchairEnabled) { diff --git a/src/main/java/org/opentripplanner/transit/service/TransitModel.java b/src/main/java/org/opentripplanner/transit/service/TransitModel.java index 99c0f3fadb8..b2347bf6351 100644 --- a/src/main/java/org/opentripplanner/transit/service/TransitModel.java +++ b/src/main/java/org/opentripplanner/transit/service/TransitModel.java @@ -560,23 +560,6 @@ public FlexTrip getFlexTrip(FeedScopedId tripId) { return flexTripsById.get(tripId); } - public Set getStopLocationsUsedForFlexTrips() { - Set stopLocations = getAllFlexTrips() - .stream() - .flatMap(t -> t.getStops().stream()) - .collect(Collectors.toSet()); - - stopLocations.addAll( - stopLocations - .stream() - .filter(GroupStop.class::isInstance) - .map(GroupStop.class::cast) - .flatMap(g -> g.getChildLocations().stream().filter(RegularStop.class::isInstance)) - .toList() - ); - return stopLocations; - } - /** * The stops that are used by transit capable of transporting cars need to be * connected to the road network (e.g. car ferries). This method returns the From 39634b52d5d851574d2874ce0b676496727c9e64 Mon Sep 17 00:00:00 2001 From: Ville Pihlava Date: Fri, 27 Sep 2024 15:18:52 +0300 Subject: [PATCH 011/110] Change test to conform with new changes. --- .../graph_builder/module/StreetLinkerModuleTest.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/test/java/org/opentripplanner/graph_builder/module/StreetLinkerModuleTest.java b/src/test/java/org/opentripplanner/graph_builder/module/StreetLinkerModuleTest.java index a71921148aa..e4d62a0dbd6 100644 --- a/src/test/java/org/opentripplanner/graph_builder/module/StreetLinkerModuleTest.java +++ b/src/test/java/org/opentripplanner/graph_builder/module/StreetLinkerModuleTest.java @@ -211,17 +211,17 @@ public void withCarsAllowedTrip(Trip trip, StopLocation... stops) { }) .toList(); StopPattern stopPattern = new StopPattern(stopTimes); - TripPattern tripPattern = TransitModelForTest - .tripPattern("carsAllowedTripPattern", route) - .withStopPattern(stopPattern) - .build(); RealTimeTripTimes tripTimes = TripTimesFactory.tripTimes( trip, stopTimes, transitModel.getDeduplicator() ); + TripPattern tripPattern = TransitModelForTest + .tripPattern("carsAllowedTripPattern", route) + .withStopPattern(stopPattern) + .withScheduledTimeTableBuilder(builder -> builder.addTripTimes(tripTimes)) + .build(); - tripPattern.add(tripTimes); transitModel.addTripPattern(tripPattern.getId(), tripPattern); } } From a4f955fe210ef24de81ab00a296ae9957e0fa7f8 Mon Sep 17 00:00:00 2001 From: Michael Tsang Date: Sun, 6 Oct 2024 20:09:27 +0100 Subject: [PATCH 012/110] improve area handling --- .../graph_builder/module/osm/OsmDatabase.java | 5 +- .../openstreetmap/model/OSMWay.java | 6 ++- .../openstreetmap/model/OSMWithTags.java | 9 +++- .../openstreetmap/model/OSMWayTest.java | 51 +++++++++++++++++++ 4 files changed, 65 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmDatabase.java b/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmDatabase.java index 60525b3cb6c..a52b4824e10 100644 --- a/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmDatabase.java +++ b/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmDatabase.java @@ -254,10 +254,7 @@ public void addWay(OSMWay way) { applyLevelsForWay(way); /* An area can be specified as such, or be one by default as an amenity */ - if ( - (way.isArea() || way.isParkAndRide() || way.isBikeParking() || way.isBoardingArea()) && - way.getNodeRefs().size() > 2 - ) { + if (way.isArea()) { // this is an area that's a simple polygon. So we can just add it straight // to the areas, if it's not part of a relation. if (!areaWayIds.contains(wayId)) { diff --git a/src/main/java/org/opentripplanner/openstreetmap/model/OSMWay.java b/src/main/java/org/opentripplanner/openstreetmap/model/OSMWay.java index b1e90044bf2..f5eb115e4ff 100644 --- a/src/main/java/org/opentripplanner/openstreetmap/model/OSMWay.java +++ b/src/main/java/org/opentripplanner/openstreetmap/model/OSMWay.java @@ -138,7 +138,11 @@ public boolean isBackwardEscalator() { } public boolean isArea() { - return isTag("area", "yes"); + return ( + !isTag("area", "no") && + (isTag("area", "yes") || isParking() || isBikeParking() || isBoardingArea()) && + getNodeRefs().size() > 2 + ); } /** diff --git a/src/main/java/org/opentripplanner/openstreetmap/model/OSMWithTags.java b/src/main/java/org/opentripplanner/openstreetmap/model/OSMWithTags.java index b53739bf6a1..2b228f2c537 100644 --- a/src/main/java/org/opentripplanner/openstreetmap/model/OSMWithTags.java +++ b/src/main/java/org/opentripplanner/openstreetmap/model/OSMWithTags.java @@ -423,6 +423,13 @@ public boolean isPedestrianExplicitlyAllowed() { return doesTagAllowAccess("foot"); } + /** + * @return True if this node / area is a parking. + */ + public boolean isParking() { + return isTag("amenity", "parking"); + } + /** * @return True if this node / area is a park and ride. */ @@ -430,7 +437,7 @@ public boolean isParkAndRide() { String parkingType = getTag("parking"); String parkAndRide = getTag("park_ride"); return ( - isTag("amenity", "parking") && + isParking() && ( (parkingType != null && parkingType.contains("park_and_ride")) || (parkAndRide != null && !parkAndRide.equalsIgnoreCase("no")) diff --git a/src/test/java/org/opentripplanner/openstreetmap/model/OSMWayTest.java b/src/test/java/org/opentripplanner/openstreetmap/model/OSMWayTest.java index c0af4cf2701..c6c4bd49651 100644 --- a/src/test/java/org/opentripplanner/openstreetmap/model/OSMWayTest.java +++ b/src/test/java/org/opentripplanner/openstreetmap/model/OSMWayTest.java @@ -17,6 +17,48 @@ void testIsBicycleDismountForced() { assertTrue(way.isBicycleDismountForced()); } + @Test + void testAreaMustContain3Nodes() { + OSMWay way = new OSMWay(); + way.addTag("area", "yes"); + assertFalse(way.isArea()); + way.addNodeRef(1); + assertFalse(way.isArea()); + way.addNodeRef(2); + assertFalse(way.isArea()); + way.addNodeRef(3); + assertTrue(way.isArea()); + way.addNodeRef(4); + assertTrue(way.isArea()); + } + + @Test + void testAreaTags() { + OSMWay platform = getClosedPolygon(); + platform.addTag("public_transport", "platform"); + assertTrue(platform.isArea()); + platform.addTag("area", "no"); + assertFalse(platform.isArea()); + + OSMWay roundabout = getClosedPolygon(); + roundabout.addTag("highway", "roundabout"); + assertFalse(roundabout.isArea()); + + OSMWay pedestrian = getClosedPolygon(); + pedestrian.addTag("highway", "pedestrian"); + assertFalse(pedestrian.isArea()); + pedestrian.addTag("area", "yes"); + assertTrue(pedestrian.isArea()); + + OSMWay parking = getClosedPolygon(); + parking.addTag("amenity", "parking"); + assertTrue(parking.isArea()); + + OSMWay bikeParking = getClosedPolygon(); + bikeParking.addTag("amenity", "bicycle_parking"); + assertTrue(bikeParking.isArea()); + } + @Test void testIsSteps() { OSMWay way = new OSMWay(); @@ -125,4 +167,13 @@ void escalator() { escalator.addTag("conveying", "whoknows?"); assertFalse(escalator.isEscalator()); } + + private OSMWay getClosedPolygon() { + var way = new OSMWay(); + way.addNodeRef(1); + way.addNodeRef(2); + way.addNodeRef(3); + way.addNodeRef(1); + return way; + } } From 93543b174e78883f8e5bfdff46bf7750165c8063 Mon Sep 17 00:00:00 2001 From: Michael Tsang Date: Sun, 6 Oct 2024 20:52:05 +0100 Subject: [PATCH 013/110] add indoor tags for area detection --- .../openstreetmap/model/OSMWay.java | 8 ++++++- .../openstreetmap/model/OSMWayTest.java | 24 ++++++++++++------- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/opentripplanner/openstreetmap/model/OSMWay.java b/src/main/java/org/opentripplanner/openstreetmap/model/OSMWay.java index f5eb115e4ff..299c1c6c545 100644 --- a/src/main/java/org/opentripplanner/openstreetmap/model/OSMWay.java +++ b/src/main/java/org/opentripplanner/openstreetmap/model/OSMWay.java @@ -140,11 +140,17 @@ public boolean isBackwardEscalator() { public boolean isArea() { return ( !isTag("area", "no") && - (isTag("area", "yes") || isParking() || isBikeParking() || isBoardingArea()) && + ( + isTag("area", "yes") || isParking() || isBikeParking() || isBoardingArea() || isIndoorArea() + ) && getNodeRefs().size() > 2 ); } + public boolean isIndoorArea() { + return isTag("indoor", "room") || isTag("indoor", "area") || isTag("indoor", "corridor"); + } + /** * Given a set of {@code permissions} check if it can really be applied to both directions * of the way and return the permissions for both cases. diff --git a/src/test/java/org/opentripplanner/openstreetmap/model/OSMWayTest.java b/src/test/java/org/opentripplanner/openstreetmap/model/OSMWayTest.java index c6c4bd49651..c35e2d216af 100644 --- a/src/test/java/org/opentripplanner/openstreetmap/model/OSMWayTest.java +++ b/src/test/java/org/opentripplanner/openstreetmap/model/OSMWayTest.java @@ -34,11 +34,11 @@ void testAreaMustContain3Nodes() { @Test void testAreaTags() { - OSMWay platform = getClosedPolygon(); - platform.addTag("public_transport", "platform"); - assertTrue(platform.isArea()); - platform.addTag("area", "no"); - assertFalse(platform.isArea()); + OSMWay way1 = getClosedPolygon(); + way1.addTag("public_transport", "platform"); + assertTrue(way1.isArea()); + way1.addTag("area", "no"); + assertFalse(way1.isArea()); OSMWay roundabout = getClosedPolygon(); roundabout.addTag("highway", "roundabout"); @@ -50,13 +50,21 @@ void testAreaTags() { pedestrian.addTag("area", "yes"); assertTrue(pedestrian.isArea()); - OSMWay parking = getClosedPolygon(); - parking.addTag("amenity", "parking"); - assertTrue(parking.isArea()); + OSMWay indoorArea = getClosedPolygon(); + indoorArea.addTag("indoor", "area"); + assertTrue(indoorArea.isArea()); OSMWay bikeParking = getClosedPolygon(); bikeParking.addTag("amenity", "bicycle_parking"); assertTrue(bikeParking.isArea()); + + OSMWay corridor = getClosedPolygon(); + corridor.addTag("indoor", "corridor"); + assertTrue(corridor.isArea()); + + OSMWay door = getClosedPolygon(); + door.addTag("indoor", "door"); + assertFalse(door.isArea()); } @Test From cd16137ecfd96aabb584a78ff14de9719858e85d Mon Sep 17 00:00:00 2001 From: Michael Tsang Date: Sun, 6 Oct 2024 20:58:16 +0100 Subject: [PATCH 014/110] add properties for indoor tags --- doc/user/osm/Default.md | 2 ++ doc/user/osm/Finland.md | 2 ++ doc/user/osm/Germany.md | 2 ++ doc/user/osm/UK.md | 2 ++ .../openstreetmap/tagmapping/DefaultMapper.java | 2 ++ .../openstreetmap/tagmapping/DefaultMapperTest.java | 9 +++++++++ .../openstreetmap/wayproperty/specifier/WayTestData.java | 6 ++++++ 7 files changed, 25 insertions(+) diff --git a/doc/user/osm/Default.md b/doc/user/osm/Default.md index 814420b791f..1373b499579 100644 --- a/doc/user/osm/Default.md +++ b/doc/user/osm/Default.md @@ -35,6 +35,8 @@ Lower safety values make an OSM way more desirable and higher values less desira | `public_transport=platform` | `PEDESTRIAN` | | | | `railway=platform` | `PEDESTRIAN` | | | | `footway=sidewalk; highway=footway` | `PEDESTRIAN` | | | +| `indoor=area` | `PEDESTRIAN` | | | +| `indoor=corridor` | `PEDESTRIAN` | | | | `mtb:scale=1` | `PEDESTRIAN` | | | | `mtb:scale=2` | `PEDESTRIAN` | | | | `mtb:scale=0` | `PEDESTRIAN_AND_BICYCLE` | | | diff --git a/doc/user/osm/Finland.md b/doc/user/osm/Finland.md index 8a60b5f0b13..820e47c46e0 100644 --- a/doc/user/osm/Finland.md +++ b/doc/user/osm/Finland.md @@ -79,6 +79,8 @@ Lower safety values make an OSM way more desirable and higher values less desira | `public_transport=platform` | `PEDESTRIAN` | | | | `railway=platform` | `PEDESTRIAN` | | | | `footway=sidewalk; highway=footway` | `PEDESTRIAN` | | | +| `indoor=area` | `PEDESTRIAN` | | | +| `indoor=corridor` | `PEDESTRIAN` | | | | `mtb:scale=1` | `PEDESTRIAN` | | | | `mtb:scale=2` | `PEDESTRIAN` | | | | `mtb:scale=0` | `PEDESTRIAN_AND_BICYCLE` | | | diff --git a/doc/user/osm/Germany.md b/doc/user/osm/Germany.md index 922aa3af836..f422022d4f2 100644 --- a/doc/user/osm/Germany.md +++ b/doc/user/osm/Germany.md @@ -44,6 +44,8 @@ Lower safety values make an OSM way more desirable and higher values less desira | `public_transport=platform` | `PEDESTRIAN` | | | | `railway=platform` | `PEDESTRIAN` | | | | `footway=sidewalk; highway=footway` | `PEDESTRIAN` | | | +| `indoor=area` | `PEDESTRIAN` | | | +| `indoor=corridor` | `PEDESTRIAN` | | | | `mtb:scale=1` | `PEDESTRIAN` | | | | `mtb:scale=2` | `PEDESTRIAN` | | | | `mtb:scale=0` | `PEDESTRIAN_AND_BICYCLE` | | | diff --git a/doc/user/osm/UK.md b/doc/user/osm/UK.md index 4a640caf95c..d5e401e40cc 100644 --- a/doc/user/osm/UK.md +++ b/doc/user/osm/UK.md @@ -49,6 +49,8 @@ Lower safety values make an OSM way more desirable and higher values less desira | `public_transport=platform` | `PEDESTRIAN` | | | | `railway=platform` | `PEDESTRIAN` | | | | `footway=sidewalk; highway=footway` | `PEDESTRIAN` | | | +| `indoor=area` | `PEDESTRIAN` | | | +| `indoor=corridor` | `PEDESTRIAN` | | | | `mtb:scale=1` | `PEDESTRIAN` | | | | `mtb:scale=2` | `PEDESTRIAN` | | | | `mtb:scale=0` | `PEDESTRIAN_AND_BICYCLE` | | | diff --git a/src/main/java/org/opentripplanner/openstreetmap/tagmapping/DefaultMapper.java b/src/main/java/org/opentripplanner/openstreetmap/tagmapping/DefaultMapper.java index c5d1c0d1582..fe498333aac 100644 --- a/src/main/java/org/opentripplanner/openstreetmap/tagmapping/DefaultMapper.java +++ b/src/main/java/org/opentripplanner/openstreetmap/tagmapping/DefaultMapper.java @@ -67,6 +67,8 @@ public void populateProperties(WayPropertySet props) { props.setProperties("public_transport=platform", pedestrianWayProperties); props.setProperties("railway=platform", pedestrianWayProperties); props.setProperties("footway=sidewalk;highway=footway", pedestrianWayProperties); + props.setProperties("indoor=area", pedestrianWayProperties); + props.setProperties("indoor=corridor", pedestrianWayProperties); props.setProperties("mtb:scale=1", pedestrianWayProperties); props.setProperties("mtb:scale=2", pedestrianWayProperties); diff --git a/src/test/java/org/opentripplanner/openstreetmap/tagmapping/DefaultMapperTest.java b/src/test/java/org/opentripplanner/openstreetmap/tagmapping/DefaultMapperTest.java index 2a8988dda61..8de9661f547 100644 --- a/src/test/java/org/opentripplanner/openstreetmap/tagmapping/DefaultMapperTest.java +++ b/src/test/java/org/opentripplanner/openstreetmap/tagmapping/DefaultMapperTest.java @@ -3,6 +3,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.opentripplanner.street.model.StreetTraversalPermission.ALL; +import static org.opentripplanner.street.model.StreetTraversalPermission.NONE; import static org.opentripplanner.street.model.StreetTraversalPermission.PEDESTRIAN; import static org.opentripplanner.street.model.StreetTraversalPermission.PEDESTRIAN_AND_BICYCLE; @@ -121,6 +122,14 @@ void stairs() { assertEquals(PEDESTRIAN, props.getPermission()); } + @Test + void indoor() { + var corridor = wps.getDataForWay(WayTestData.indoor("corridor")); + assertEquals(PEDESTRIAN, corridor.getPermission()); + var area = wps.getDataForWay(WayTestData.indoor("area")); + assertEquals(PEDESTRIAN, area.getPermission()); + } + @Test void footDiscouraged() { var regular = WayTestData.pedestrianTunnel(); diff --git a/src/test/java/org/opentripplanner/openstreetmap/wayproperty/specifier/WayTestData.java b/src/test/java/org/opentripplanner/openstreetmap/wayproperty/specifier/WayTestData.java index b09f690f794..7ca0901561a 100644 --- a/src/test/java/org/opentripplanner/openstreetmap/wayproperty/specifier/WayTestData.java +++ b/src/test/java/org/opentripplanner/openstreetmap/wayproperty/specifier/WayTestData.java @@ -218,4 +218,10 @@ public static OSMWithTags zooPlatform() { way.addTag("usage", "tourism"); return way; } + + public static OSMWithTags indoor(String value) { + var way = new OSMWithTags(); + way.addTag("indoor", value); + return way; + } } From b929da86ff32e8a5086e3f2457d898c9bd524959 Mon Sep 17 00:00:00 2001 From: Michael Tsang Date: Mon, 7 Oct 2024 11:48:22 +0100 Subject: [PATCH 015/110] update comment --- .../graph_builder/module/osm/OsmDatabase.java | 1 - .../java/org/opentripplanner/openstreetmap/model/OSMWay.java | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmDatabase.java b/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmDatabase.java index a52b4824e10..5fe0280270c 100644 --- a/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmDatabase.java +++ b/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmDatabase.java @@ -253,7 +253,6 @@ public void addWay(OSMWay way) { applyLevelsForWay(way); - /* An area can be specified as such, or be one by default as an amenity */ if (way.isArea()) { // this is an area that's a simple polygon. So we can just add it straight // to the areas, if it's not part of a relation. diff --git a/src/main/java/org/opentripplanner/openstreetmap/model/OSMWay.java b/src/main/java/org/opentripplanner/openstreetmap/model/OSMWay.java index 299c1c6c545..f2bd687495d 100644 --- a/src/main/java/org/opentripplanner/openstreetmap/model/OSMWay.java +++ b/src/main/java/org/opentripplanner/openstreetmap/model/OSMWay.java @@ -137,6 +137,11 @@ public boolean isBackwardEscalator() { return isEscalator() && "backward".equals(this.getTag("conveying")); } + /** + * Returns true if the way is considered an area. + * + * An area can be specified as such, or be one by default as an amenity. + */ public boolean isArea() { return ( !isTag("area", "no") && From a7952e392976d933d576d7078a834ae0eaf4aa2a Mon Sep 17 00:00:00 2001 From: Michael Tsang Date: Mon, 7 Oct 2024 11:52:58 +0100 Subject: [PATCH 016/110] use more descriptive name --- .../openstreetmap/model/OSMWayTest.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/test/java/org/opentripplanner/openstreetmap/model/OSMWayTest.java b/src/test/java/org/opentripplanner/openstreetmap/model/OSMWayTest.java index c35e2d216af..0aeaf36ff49 100644 --- a/src/test/java/org/opentripplanner/openstreetmap/model/OSMWayTest.java +++ b/src/test/java/org/opentripplanner/openstreetmap/model/OSMWayTest.java @@ -34,11 +34,11 @@ void testAreaMustContain3Nodes() { @Test void testAreaTags() { - OSMWay way1 = getClosedPolygon(); - way1.addTag("public_transport", "platform"); - assertTrue(way1.isArea()); - way1.addTag("area", "no"); - assertFalse(way1.isArea()); + OSMWay platform = getClosedPolygon(); + platform.addTag("public_transport", "platform"); + assertTrue(platform.isArea()); + platform.addTag("area", "no"); + assertFalse(platform.isArea()); OSMWay roundabout = getClosedPolygon(); roundabout.addTag("highway", "roundabout"); From 953d894762989d84422ed5e9db11f2bceddf3a6a Mon Sep 17 00:00:00 2001 From: Michael Tsang Date: Tue, 8 Oct 2024 10:11:21 +0100 Subject: [PATCH 017/110] make indoor areas routable --- .../opentripplanner/openstreetmap/model/OSMWithTags.java | 6 +++++- .../openstreetmap/model/OSMWithTagsTest.java | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/opentripplanner/openstreetmap/model/OSMWithTags.java b/src/main/java/org/opentripplanner/openstreetmap/model/OSMWithTags.java index 2b228f2c537..23511f83022 100644 --- a/src/main/java/org/opentripplanner/openstreetmap/model/OSMWithTags.java +++ b/src/main/java/org/opentripplanner/openstreetmap/model/OSMWithTags.java @@ -549,7 +549,7 @@ public void setOsmProvider(OsmProvider provider) { public boolean isRoutable() { if (isOneOfTags("highway", NON_ROUTABLE_HIGHWAYS)) { return false; - } else if (hasTag("highway") || isPlatform()) { + } else if (hasTag("highway") || isPlatform() || isIndoorRoutable()) { if (isGeneralAccessDenied()) { // There are exceptions. return ( @@ -566,6 +566,10 @@ public boolean isRoutable() { return false; } + public boolean isIndoorRoutable() { + return isTag("indoor", "area") || isTag("indoor", "corridor"); + } + /** * Is this a link to another road, like a highway ramp. */ diff --git a/src/test/java/org/opentripplanner/openstreetmap/model/OSMWithTagsTest.java b/src/test/java/org/opentripplanner/openstreetmap/model/OSMWithTagsTest.java index 3b50d0bff0d..cbc7635113c 100644 --- a/src/test/java/org/opentripplanner/openstreetmap/model/OSMWithTagsTest.java +++ b/src/test/java/org/opentripplanner/openstreetmap/model/OSMWithTagsTest.java @@ -212,6 +212,8 @@ void isWheelchairAccessible() { @Test void isRoutable() { assertFalse(WayTestData.zooPlatform().isRoutable()); + assertTrue(WayTestData.indoor("area").isRoutable()); + assertFalse(WayTestData.indoor("room").isRoutable()); } @Test From d3f7d709f8d068f76b6cd900df1d19288f9d2b65 Mon Sep 17 00:00:00 2001 From: Michael Tsang Date: Tue, 15 Oct 2024 10:41:09 +0100 Subject: [PATCH 018/110] use isOneOfTags for testing OSM objects against multiple values --- .../main/java/org/opentripplanner/osm/model/OsmWay.java | 9 ++++++++- .../java/org/opentripplanner/osm/model/OsmWithTags.java | 7 ++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/application/src/main/java/org/opentripplanner/osm/model/OsmWay.java b/application/src/main/java/org/opentripplanner/osm/model/OsmWay.java index 710d41425e7..0bd7b5a8975 100644 --- a/application/src/main/java/org/opentripplanner/osm/model/OsmWay.java +++ b/application/src/main/java/org/opentripplanner/osm/model/OsmWay.java @@ -14,6 +14,13 @@ public class OsmWay extends OsmWithTags { "backward", "reversible" ); + + private static final Set INDOOR_AREA_VALUES = Set.of( + "room", + "corridor", + "area" + ); + private final TLongList nodes = new TLongArrayList(); public void addNodeRef(long nodeRef) { @@ -153,7 +160,7 @@ public boolean isArea() { } public boolean isIndoorArea() { - return isTag("indoor", "room") || isTag("indoor", "area") || isTag("indoor", "corridor"); + return isOneOfTags("indoor", INDOOR_AREA_VALUES); } /** 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 cbc77a10fbf..28dd1db9fae 100644 --- a/application/src/main/java/org/opentripplanner/osm/model/OsmWithTags.java +++ b/application/src/main/java/org/opentripplanner/osm/model/OsmWithTags.java @@ -44,6 +44,11 @@ public class OsmWithTags { "bus_guideway", "escape" ); + + private static final Set INDOOR_ROUTABLE_VALUES = Set.of( + "corridor", + "area" + ); private static final Set LEVEL_TAGS = Set.of("level", "layer"); private static final Set DEFAULT_LEVEL = Set.of("0"); @@ -557,7 +562,7 @@ public boolean isRoutable() { } public boolean isIndoorRoutable() { - return isTag("indoor", "area") || isTag("indoor", "corridor"); + return isOneOfTags("indoor", INDOOR_ROUTABLE_VALUES); } /** From 6dbaf214a78e2479ae8241df04bf8a56e4364794 Mon Sep 17 00:00:00 2001 From: Michael Tsang Date: Tue, 15 Oct 2024 10:47:37 +0100 Subject: [PATCH 019/110] renamed isArea to isAreaWay as the logic has changed --- .../opentripplanner/graph_builder/module/osm/OsmDatabase.java | 2 +- .../src/main/java/org/opentripplanner/osm/model/OsmWay.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmDatabase.java b/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmDatabase.java index cd396c53cd3..a560b96b2ab 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmDatabase.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmDatabase.java @@ -253,7 +253,7 @@ public void addWay(OsmWay way) { applyLevelsForWay(way); - if (way.isArea()) { + if (way.isAreaWay()) { // this is an area that's a simple polygon. So we can just add it straight // to the areas, if it's not part of a relation. if (!areaWayIds.contains(wayId)) { diff --git a/application/src/main/java/org/opentripplanner/osm/model/OsmWay.java b/application/src/main/java/org/opentripplanner/osm/model/OsmWay.java index 0bd7b5a8975..31a0d8d9442 100644 --- a/application/src/main/java/org/opentripplanner/osm/model/OsmWay.java +++ b/application/src/main/java/org/opentripplanner/osm/model/OsmWay.java @@ -149,7 +149,7 @@ public boolean isBackwardEscalator() { * * An area can be specified as such, or be one by default as an amenity. */ - public boolean isArea() { + public boolean isAreaWay() { return ( !isTag("area", "no") && ( From 32a97b7fdd4f3dc5c7cc1c920f08b1cb26661dd1 Mon Sep 17 00:00:00 2001 From: Michael Tsang Date: Tue, 15 Oct 2024 11:14:28 +0100 Subject: [PATCH 020/110] only check for routable areas instead of areas in general --- .../graph_builder/module/osm/OsmDatabase.java | 2 +- .../org/opentripplanner/osm/model/OsmWay.java | 20 +++++++------------ .../osm/model/OsmWithTags.java | 7 ++----- 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmDatabase.java b/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmDatabase.java index a560b96b2ab..e6727190b54 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmDatabase.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmDatabase.java @@ -253,7 +253,7 @@ public void addWay(OsmWay way) { applyLevelsForWay(way); - if (way.isAreaWay()) { + if (way.isRoutableArea()) { // this is an area that's a simple polygon. So we can just add it straight // to the areas, if it's not part of a relation. if (!areaWayIds.contains(wayId)) { diff --git a/application/src/main/java/org/opentripplanner/osm/model/OsmWay.java b/application/src/main/java/org/opentripplanner/osm/model/OsmWay.java index 31a0d8d9442..7b5fbe56748 100644 --- a/application/src/main/java/org/opentripplanner/osm/model/OsmWay.java +++ b/application/src/main/java/org/opentripplanner/osm/model/OsmWay.java @@ -14,13 +14,7 @@ public class OsmWay extends OsmWithTags { "backward", "reversible" ); - - private static final Set INDOOR_AREA_VALUES = Set.of( - "room", - "corridor", - "area" - ); - + private final TLongList nodes = new TLongArrayList(); public void addNodeRef(long nodeRef) { @@ -149,20 +143,20 @@ public boolean isBackwardEscalator() { * * An area can be specified as such, or be one by default as an amenity. */ - public boolean isAreaWay() { + public boolean isRoutableArea() { return ( !isTag("area", "no") && ( - isTag("area", "yes") || isParking() || isBikeParking() || isBoardingArea() || isIndoorArea() + isTag("area", "yes") || + isParking() || + isBikeParking() || + isBoardingArea() || + isIndoorRoutable() ) && getNodeRefs().size() > 2 ); } - public boolean isIndoorArea() { - return isOneOfTags("indoor", INDOOR_AREA_VALUES); - } - /** * Given a set of {@code permissions} check if it can really be applied to both directions * of the way and return the permissions for both cases. 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 28dd1db9fae..cbaf4652b34 100644 --- a/application/src/main/java/org/opentripplanner/osm/model/OsmWithTags.java +++ b/application/src/main/java/org/opentripplanner/osm/model/OsmWithTags.java @@ -44,11 +44,8 @@ public class OsmWithTags { "bus_guideway", "escape" ); - - private static final Set INDOOR_ROUTABLE_VALUES = Set.of( - "corridor", - "area" - ); + + private static final Set INDOOR_ROUTABLE_VALUES = Set.of("corridor", "area"); private static final Set LEVEL_TAGS = Set.of("level", "layer"); private static final Set DEFAULT_LEVEL = Set.of("0"); From a8a7829672cdff551a80d468f34b6f85038a84af Mon Sep 17 00:00:00 2001 From: Michael Tsang Date: Tue, 15 Oct 2024 12:07:09 +0100 Subject: [PATCH 021/110] fix test cases --- .../opentripplanner/osm/model/OsmWayTest.java | 48 +++++++++---------- .../wayproperty/specifier/WayTestData.java | 4 +- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/application/src/test/java/org/opentripplanner/osm/model/OsmWayTest.java b/application/src/test/java/org/opentripplanner/osm/model/OsmWayTest.java index 16a7498f94b..9ac9457a9ec 100644 --- a/application/src/test/java/org/opentripplanner/osm/model/OsmWayTest.java +++ b/application/src/test/java/org/opentripplanner/osm/model/OsmWayTest.java @@ -19,52 +19,52 @@ void testIsBicycleDismountForced() { @Test void testAreaMustContain3Nodes() { - OSMWay way = new OSMWay(); + OsmWay way = new OsmWay(); way.addTag("area", "yes"); - assertFalse(way.isArea()); + assertFalse(way.isRoutableArea()); way.addNodeRef(1); - assertFalse(way.isArea()); + assertFalse(way.isRoutableArea()); way.addNodeRef(2); - assertFalse(way.isArea()); + assertFalse(way.isRoutableArea()); way.addNodeRef(3); - assertTrue(way.isArea()); + assertTrue(way.isRoutableArea()); way.addNodeRef(4); - assertTrue(way.isArea()); + assertTrue(way.isRoutableArea()); } @Test void testAreaTags() { - OSMWay platform = getClosedPolygon(); + OsmWay platform = getClosedPolygon(); platform.addTag("public_transport", "platform"); - assertTrue(platform.isArea()); + assertTrue(platform.isRoutableArea()); platform.addTag("area", "no"); - assertFalse(platform.isArea()); + assertFalse(platform.isRoutableArea()); - OSMWay roundabout = getClosedPolygon(); + OsmWay roundabout = getClosedPolygon(); roundabout.addTag("highway", "roundabout"); - assertFalse(roundabout.isArea()); + assertFalse(roundabout.isRoutableArea()); - OSMWay pedestrian = getClosedPolygon(); + OsmWay pedestrian = getClosedPolygon(); pedestrian.addTag("highway", "pedestrian"); - assertFalse(pedestrian.isArea()); + assertFalse(pedestrian.isRoutableArea()); pedestrian.addTag("area", "yes"); - assertTrue(pedestrian.isArea()); + assertTrue(pedestrian.isRoutableArea()); - OSMWay indoorArea = getClosedPolygon(); + OsmWay indoorArea = getClosedPolygon(); indoorArea.addTag("indoor", "area"); - assertTrue(indoorArea.isArea()); + assertTrue(indoorArea.isRoutableArea()); - OSMWay bikeParking = getClosedPolygon(); + OsmWay bikeParking = getClosedPolygon(); bikeParking.addTag("amenity", "bicycle_parking"); - assertTrue(bikeParking.isArea()); + assertTrue(bikeParking.isRoutableArea()); - OSMWay corridor = getClosedPolygon(); + OsmWay corridor = getClosedPolygon(); corridor.addTag("indoor", "corridor"); - assertTrue(corridor.isArea()); + assertTrue(corridor.isRoutableArea()); - OSMWay door = getClosedPolygon(); + OsmWay door = getClosedPolygon(); door.addTag("indoor", "door"); - assertFalse(door.isArea()); + assertFalse(door.isRoutableArea()); } @Test @@ -176,8 +176,8 @@ void escalator() { assertFalse(escalator.isEscalator()); } - private OSMWay getClosedPolygon() { - var way = new OSMWay(); + private OsmWay getClosedPolygon() { + var way = new OsmWay(); way.addNodeRef(1); way.addNodeRef(2); way.addNodeRef(3); diff --git a/application/src/test/java/org/opentripplanner/osm/wayproperty/specifier/WayTestData.java b/application/src/test/java/org/opentripplanner/osm/wayproperty/specifier/WayTestData.java index 8238a44a9f4..e075955f6c4 100644 --- a/application/src/test/java/org/opentripplanner/osm/wayproperty/specifier/WayTestData.java +++ b/application/src/test/java/org/opentripplanner/osm/wayproperty/specifier/WayTestData.java @@ -219,8 +219,8 @@ public static OsmWithTags zooPlatform() { return way; } - public static OSMWithTags indoor(String value) { - var way = new OSMWithTags(); + public static OsmWithTags indoor(String value) { + var way = new OsmWithTags(); way.addTag("indoor", value); return way; } From 5cc750a9e67580435866d9b70eb6cae9a46f0231 Mon Sep 17 00:00:00 2001 From: Michael Tsang Date: Tue, 15 Oct 2024 15:14:19 +0100 Subject: [PATCH 022/110] remove unused imports --- .../org/opentripplanner/osm/tagmapping/DefaultMapperTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/application/src/test/java/org/opentripplanner/osm/tagmapping/DefaultMapperTest.java b/application/src/test/java/org/opentripplanner/osm/tagmapping/DefaultMapperTest.java index 7837c216c31..31073f87e92 100644 --- a/application/src/test/java/org/opentripplanner/osm/tagmapping/DefaultMapperTest.java +++ b/application/src/test/java/org/opentripplanner/osm/tagmapping/DefaultMapperTest.java @@ -4,7 +4,6 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.opentripplanner.street.model.StreetTraversalPermission.ALL; -import static org.opentripplanner.street.model.StreetTraversalPermission.NONE; import static org.opentripplanner.street.model.StreetTraversalPermission.PEDESTRIAN; import static org.opentripplanner.street.model.StreetTraversalPermission.PEDESTRIAN_AND_BICYCLE; From 9958ffc98ca2a7877610d81611fdfe3471d6f3c9 Mon Sep 17 00:00:00 2001 From: Ville Pihlava Date: Thu, 17 Oct 2024 12:18:23 +0300 Subject: [PATCH 023/110] Rename transitModel to timetableRepository. --- .../graph_builder/module/StreetLinkerModule.java | 10 ++++++---- .../graph_builder/module/StreetLinkerModuleTest.java | 10 +++++----- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java b/application/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java index a0f37c392ce..dce445d381a 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java @@ -89,10 +89,10 @@ public void linkTransitStops(Graph graph, TimetableRepository timetableRepositor Set stopLocationsUsedForFlexTrips = Set.of(); if (OTPFeature.FlexRouting.isOn()) { - stopLocationsUsedForFlexTrips = getStopLocationsUsedForFlexTrips(transitModel); + stopLocationsUsedForFlexTrips = getStopLocationsUsedForFlexTrips(timetableRepository); } - Set stopLocationsUsedForCarsAllowedTrips = transitModel.getStopLocationsUsedForCarsAllowedTrips(); + Set stopLocationsUsedForCarsAllowedTrips = timetableRepository.getStopLocationsUsedForCarsAllowedTrips(); for (TransitStopVertex tStop : vertices) { // Stops with pathways do not need to be connected to the street network, since there are explicit entrances defined for that @@ -357,8 +357,10 @@ private VehicleParking removeVehicleParkingEntranceVertexFromGraph( } } - private Set getStopLocationsUsedForFlexTrips(TransitModel transitModel) { - Set stopLocations = transitModel + private Set getStopLocationsUsedForFlexTrips( + TimetableRepository timetableRepository + ) { + Set stopLocations = timetableRepository .getAllFlexTrips() .stream() .flatMap(t -> t.getStops().stream()) diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/StreetLinkerModuleTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/StreetLinkerModuleTest.java index 359ed3e938f..3973a7e506a 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/StreetLinkerModuleTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/StreetLinkerModuleTest.java @@ -105,7 +105,7 @@ void linkFlexStop() { @Test void linkCarsAllowedStop() { var model = new TestModel(); - var carsAllowedTrip = TransitModelForTest + var carsAllowedTrip = TimetableRepositoryForTest .of() .trip("carsAllowedTrip") .withCarsAllowed(CarAccess.ALLOWED) @@ -198,7 +198,7 @@ public void withFlexTrip(UnscheduledTrip flexTrip) { } public void withCarsAllowedTrip(Trip trip, StopLocation... stops) { - Route route = TransitModelForTest.route("carsAllowedRoute").build(); + Route route = TimetableRepositoryForTest.route("carsAllowedRoute").build(); var stopTimes = Arrays .stream(stops) .map(s -> { @@ -214,15 +214,15 @@ public void withCarsAllowedTrip(Trip trip, StopLocation... stops) { RealTimeTripTimes tripTimes = TripTimesFactory.tripTimes( trip, stopTimes, - transitModel.getDeduplicator() + timetableRepository.getDeduplicator() ); - TripPattern tripPattern = TransitModelForTest + TripPattern tripPattern = TimetableRepositoryForTest .tripPattern("carsAllowedTripPattern", route) .withStopPattern(stopPattern) .withScheduledTimeTableBuilder(builder -> builder.addTripTimes(tripTimes)) .build(); - transitModel.addTripPattern(tripPattern.getId(), tripPattern); + timetableRepository.addTripPattern(tripPattern.getId(), tripPattern); } } } From 0e8937d21d8adc2b61b595f229ec7aec508d8bdd Mon Sep 17 00:00:00 2001 From: Michael Tsang Date: Mon, 23 Sep 2024 14:59:44 +0100 Subject: [PATCH 024/110] fix GTFS trolleybus service --- .../opentripplanner/gtfs/mapping/TransitModeMapper.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/application/src/main/java/org/opentripplanner/gtfs/mapping/TransitModeMapper.java b/application/src/main/java/org/opentripplanner/gtfs/mapping/TransitModeMapper.java index 608ff6ba2d3..b893f2d63a7 100644 --- a/application/src/main/java/org/opentripplanner/gtfs/mapping/TransitModeMapper.java +++ b/application/src/main/java/org/opentripplanner/gtfs/mapping/TransitModeMapper.java @@ -30,11 +30,10 @@ public static TransitMode mapMode(int routeType) { return TransitMode.RAIL; } else if (routeType >= 500 && routeType < 700) { //Metro Service and Underground Service return TransitMode.SUBWAY; - } else if (routeType >= 700 && routeType < 900) { //Bus Service and Trolleybus service - if (routeType == 800) { - return TransitMode.TROLLEYBUS; - } + } else if (routeType >= 700 && routeType < 800) { //Bus Service return TransitMode.BUS; + } else if (routeType >= 800 && routeType < 900) { //Trolleybus Service + return TransitMode.TROLLEYBUS; } else if (routeType >= 900 && routeType < 1000) { //Tram service return TransitMode.TRAM; } else if (routeType >= 1000 && routeType < 1100) { //Water Transport Service From 8c537f326e9ad731e12fb5c53565504fbddb87b7 Mon Sep 17 00:00:00 2001 From: Michael Tsang Date: Wed, 25 Sep 2024 12:05:34 +0100 Subject: [PATCH 025/110] Add tests for existing GTFS to OTP modes --- .../gtfs/mapping/TransitModeMapperTest.java | 46 ++++++++++++++++++- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/application/src/test/java/org/opentripplanner/gtfs/mapping/TransitModeMapperTest.java b/application/src/test/java/org/opentripplanner/gtfs/mapping/TransitModeMapperTest.java index b2e5b1a8a4d..86c98b02be4 100644 --- a/application/src/test/java/org/opentripplanner/gtfs/mapping/TransitModeMapperTest.java +++ b/application/src/test/java/org/opentripplanner/gtfs/mapping/TransitModeMapperTest.java @@ -1,8 +1,7 @@ package org.opentripplanner.gtfs.mapping; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.opentripplanner.transit.model.basic.TransitMode.CARPOOL; -import static org.opentripplanner.transit.model.basic.TransitMode.TAXI; +import static org.opentripplanner.transit.model.basic.TransitMode.*; import java.util.stream.Stream; import org.junit.jupiter.params.ParameterizedTest; @@ -14,6 +13,49 @@ class TransitModeMapperTest { static Stream testCases() { return Stream.of( + // base GTFS route types + // https://gtfs.org/documentation/schedule/reference/#routestxt + Arguments.of(0, TRAM), + Arguments.of(1, SUBWAY), + Arguments.of(2, RAIL), + Arguments.of(3, BUS), + Arguments.of(4, FERRY), + Arguments.of(5, CABLE_CAR), + Arguments.of(6, GONDOLA), + Arguments.of(7, FUNICULAR), + Arguments.of(11, TROLLEYBUS), + Arguments.of(12, MONORAIL), + // extended route types + // https://developers.google.com/transit/gtfs/reference/extended-route-types + // https://groups.google.com/g/gtfs-changes/c/keT5rTPS7Y0/m/71uMz2l6ke0J?pli=1 + Arguments.of(100, RAIL), + Arguments.of(199, RAIL), + Arguments.of(400, RAIL), + Arguments.of(401, SUBWAY), + Arguments.of(402, SUBWAY), + Arguments.of(403, RAIL), + Arguments.of(404, RAIL), + Arguments.of(405, MONORAIL), + Arguments.of(500, SUBWAY), + Arguments.of(599, SUBWAY), + Arguments.of(600, SUBWAY), + Arguments.of(699, SUBWAY), + Arguments.of(700, BUS), + Arguments.of(799, BUS), + Arguments.of(800, TROLLEYBUS), + Arguments.of(899, TROLLEYBUS), + Arguments.of(900, TRAM), + Arguments.of(999, TRAM), + Arguments.of(1000, FERRY), + Arguments.of(1099, FERRY), + Arguments.of(1100, AIRPLANE), + Arguments.of(1199, AIRPLANE), + Arguments.of(1200, FERRY), + Arguments.of(1299, FERRY), + Arguments.of(1300, GONDOLA), + Arguments.of(1399, GONDOLA), + Arguments.of(1400, FUNICULAR), + Arguments.of(1499, FUNICULAR), Arguments.of(1500, TAXI), Arguments.of(1510, TAXI), Arguments.of(1551, CARPOOL), From e6a9b035465572efedfa75a3d7449866c6c685ed Mon Sep 17 00:00:00 2001 From: Michael Tsang Date: Wed, 25 Sep 2024 12:47:16 +0100 Subject: [PATCH 026/110] move line comments to separate lines --- .../gtfs/mapping/TransitModeMapper.java | 38 ++++++++++++------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/application/src/main/java/org/opentripplanner/gtfs/mapping/TransitModeMapper.java b/application/src/main/java/org/opentripplanner/gtfs/mapping/TransitModeMapper.java index b893f2d63a7..0640011bb3b 100644 --- a/application/src/main/java/org/opentripplanner/gtfs/mapping/TransitModeMapper.java +++ b/application/src/main/java/org/opentripplanner/gtfs/mapping/TransitModeMapper.java @@ -16,7 +16,8 @@ public static TransitMode mapMode(int routeType) { } /* TPEG Extension https://groups.google.com/d/msg/gtfs-changes/keT5rTPS7Y0/71uMz2l6ke0J */ - if (routeType >= 100 && routeType < 200) { // Railway Service + if (routeType >= 100 && routeType < 200) { + // Railway Service return TransitMode.RAIL; } else if (routeType >= 200 && routeType < 300) { //Coach Service return TransitMode.BUS; @@ -28,23 +29,32 @@ public static TransitMode mapMode(int routeType) { return TransitMode.MONORAIL; } return TransitMode.RAIL; - } else if (routeType >= 500 && routeType < 700) { //Metro Service and Underground Service + } else if (routeType >= 500 && routeType < 700) { + // Metro Service and Underground Service return TransitMode.SUBWAY; - } else if (routeType >= 700 && routeType < 800) { //Bus Service + } else if (routeType >= 700 && routeType < 800) { + // Bus Service return TransitMode.BUS; - } else if (routeType >= 800 && routeType < 900) { //Trolleybus Service + } else if (routeType >= 800 && routeType < 900) { + // Trolleybus Service return TransitMode.TROLLEYBUS; - } else if (routeType >= 900 && routeType < 1000) { //Tram service + } else if (routeType >= 900 && routeType < 1000) { + // Tram service return TransitMode.TRAM; - } else if (routeType >= 1000 && routeType < 1100) { //Water Transport Service + } else if (routeType >= 1000 && routeType < 1100) { + // Water Transport Service return TransitMode.FERRY; - } else if (routeType >= 1100 && routeType < 1200) { //Air Service + } else if (routeType >= 1100 && routeType < 1200) { + // Air Service return TransitMode.AIRPLANE; - } else if (routeType >= 1200 && routeType < 1300) { //Ferry Service + } else if (routeType >= 1200 && routeType < 1300) { + // Ferry Service return TransitMode.FERRY; - } else if (routeType >= 1300 && routeType < 1400) { //Telecabin Service + } else if (routeType >= 1300 && routeType < 1400) { + // Telecabin Service return TransitMode.GONDOLA; - } else if (routeType >= 1400 && routeType < 1500) { //Funicular Service + } else if (routeType >= 1400 && routeType < 1500) { + // Funicular Service return TransitMode.FUNICULAR; } else if (routeType >= 1551 && routeType < 1561) { // Carpooling, not defined anywhere, so we've chosen this number space @@ -52,11 +62,13 @@ public static TransitMode mapMode(int routeType) { // standardise return TransitMode.CARPOOL; } else if (routeType >= 1500 && routeType < 1599) { - //Taxi Service + // Taxi Service return TransitMode.TAXI; - } else if (routeType >= 1600 && routeType < 1700) { //Self drive + } else if (routeType >= 1600 && routeType < 1700) { + // Self drive return TransitMode.BUS; - } else if (routeType >= 1700 && routeType < 1800) { //Miscellaneous Service + } else if (routeType >= 1700 && routeType < 1800) { + // Miscellaneous Service return null; } /* Original GTFS route types. Should these be checked before TPEG types? */ From 4c10b030e28bc35f576456d3097aaff2c32b4594 Mon Sep 17 00:00:00 2001 From: Michael Tsang Date: Wed, 25 Sep 2024 12:25:45 +0100 Subject: [PATCH 027/110] update the description of "CABLE_CAR" mode to cable tram. --- application/src/client/classic-debug/i18n/ca_ES.po | 2 +- application/src/client/classic-debug/i18n/de.po | 2 +- application/src/client/classic-debug/i18n/en.po | 4 ++-- application/src/client/classic-debug/i18n/es.po | 2 +- application/src/client/classic-debug/i18n/fr.po | 2 +- application/src/client/classic-debug/i18n/hu.po | 2 +- application/src/client/classic-debug/i18n/it.po | 2 +- application/src/client/classic-debug/i18n/messages.pot | 2 +- application/src/client/classic-debug/i18n/no.po | 2 +- application/src/client/classic-debug/i18n/pl.po | 2 +- application/src/client/classic-debug/i18n/pt.po | 2 +- application/src/client/classic-debug/i18n/sl.po | 2 +- .../src/client/classic-debug/js/otp/locale/ca_ES.json | 2 +- application/src/client/classic-debug/js/otp/locale/de.json | 2 +- application/src/client/classic-debug/js/otp/locale/en.json | 2 +- application/src/client/classic-debug/js/otp/locale/es.json | 2 +- application/src/client/classic-debug/js/otp/locale/fr.json | 2 +- application/src/client/classic-debug/js/otp/locale/hu.json | 2 +- application/src/client/classic-debug/js/otp/locale/it.json | 2 +- application/src/client/classic-debug/js/otp/locale/no.json | 2 +- application/src/client/classic-debug/js/otp/locale/pl.json | 2 +- application/src/client/classic-debug/js/otp/locale/pt.json | 2 +- application/src/client/classic-debug/js/otp/locale/sl.json | 2 +- application/src/client/classic-debug/js/otp/util/Itin.js | 5 ++--- .../java/org/opentripplanner/ext/restapi/model/ApiLeg.java | 2 +- .../src/main/java/org/opentripplanner/model/plan/Leg.java | 2 +- .../org/opentripplanner/transit/model/basic/TransitMode.java | 2 +- doc/user/RoutingModes.md | 2 +- 28 files changed, 30 insertions(+), 31 deletions(-) diff --git a/application/src/client/classic-debug/i18n/ca_ES.po b/application/src/client/classic-debug/i18n/ca_ES.po index 8dd8b1db1eb..8c31603fba4 100644 --- a/application/src/client/classic-debug/i18n/ca_ES.po +++ b/application/src/client/classic-debug/i18n/ca_ES.po @@ -931,7 +931,7 @@ msgstr "" #. beneath the car. #: src/client/js/otp/util/Itin.js:226 #, fuzzy -msgid "Cable Car" +msgid "Cable Tram" msgstr "PONT PENJANT" #. Any rail system designed for steep inclines. diff --git a/application/src/client/classic-debug/i18n/de.po b/application/src/client/classic-debug/i18n/de.po index 0585855e247..49ac31f1777 100644 --- a/application/src/client/classic-debug/i18n/de.po +++ b/application/src/client/classic-debug/i18n/de.po @@ -919,7 +919,7 @@ msgstr "" #. Used for street-level cable cars where the cable runs #. beneath the car. #: src/client/js/otp/util/Itin.js:226 -msgid "Cable Car" +msgid "Cable Tram" msgstr "Standseilbahn" #. Any rail system designed for steep inclines. diff --git a/application/src/client/classic-debug/i18n/en.po b/application/src/client/classic-debug/i18n/en.po index 4727ffef677..94ae67f6431 100644 --- a/application/src/client/classic-debug/i18n/en.po +++ b/application/src/client/classic-debug/i18n/en.po @@ -930,8 +930,8 @@ msgstr "Light Rail" #. Used for street-level cable cars where the cable runs #. beneath the car. #: src/client/js/otp/util/Itin.js:226 -msgid "Cable Car" -msgstr "Cable Car" +msgid "Cable Tram" +msgstr "Cable Tram" #. Any rail system designed for steep inclines. #: src/client/js/otp/util/Itin.js:228 diff --git a/application/src/client/classic-debug/i18n/es.po b/application/src/client/classic-debug/i18n/es.po index b54e2510417..0799258ab92 100644 --- a/application/src/client/classic-debug/i18n/es.po +++ b/application/src/client/classic-debug/i18n/es.po @@ -924,7 +924,7 @@ msgstr "Tranvía" #. Used for street-level cable cars where the cable runs #. beneath the car. #: src/client/js/otp/util/Itin.js:226 -msgid "Cable Car" +msgid "Cable Tram" msgstr "Bus Tranvía" #. Any rail system designed for steep inclines. diff --git a/application/src/client/classic-debug/i18n/fr.po b/application/src/client/classic-debug/i18n/fr.po index 705b313786c..1c5e0f69b18 100644 --- a/application/src/client/classic-debug/i18n/fr.po +++ b/application/src/client/classic-debug/i18n/fr.po @@ -932,7 +932,7 @@ msgstr "Tram ou Trolley" #. Used for street-level cable cars where the cable runs #. beneath the car. #: src/client/js/otp/util/Itin.js:226 -msgid "Cable Car" +msgid "Cable Tram" msgstr "Tramway funiculaire" #. Any rail system designed for steep inclines. diff --git a/application/src/client/classic-debug/i18n/hu.po b/application/src/client/classic-debug/i18n/hu.po index 25411b79e58..02242925841 100644 --- a/application/src/client/classic-debug/i18n/hu.po +++ b/application/src/client/classic-debug/i18n/hu.po @@ -937,7 +937,7 @@ msgstr "Villamos, könnyűvasút" #. Used for street-level cable cars where the cable runs #. beneath the car. #: src/client/js/otp/util/Itin.js:226 -msgid "Cable Car" +msgid "Cable Tram" msgstr "" #. Any rail system designed for steep inclines. diff --git a/application/src/client/classic-debug/i18n/it.po b/application/src/client/classic-debug/i18n/it.po index 4d0abe553f3..eeb4442ef7c 100644 --- a/application/src/client/classic-debug/i18n/it.po +++ b/application/src/client/classic-debug/i18n/it.po @@ -976,7 +976,7 @@ msgstr "tram" #. beneath the car. #: src/client/js/otp/util/Itin.js:226 #, fuzzy -msgid "Cable Car" +msgid "Cable Tram" msgstr "tram" #. Any rail system designed for steep inclines. diff --git a/application/src/client/classic-debug/i18n/messages.pot b/application/src/client/classic-debug/i18n/messages.pot index ca5d59b1cc3..425b5c9bb43 100644 --- a/application/src/client/classic-debug/i18n/messages.pot +++ b/application/src/client/classic-debug/i18n/messages.pot @@ -896,7 +896,7 @@ msgstr "" #. Used for street-level cable cars where the cable runs #. beneath the car. #: src/client/js/otp/util/Itin.js:226 -msgid "Cable Car" +msgid "Cable Tram" msgstr "" #. Any rail system designed for steep inclines. diff --git a/application/src/client/classic-debug/i18n/no.po b/application/src/client/classic-debug/i18n/no.po index 9a1d5c9103d..8963f038601 100644 --- a/application/src/client/classic-debug/i18n/no.po +++ b/application/src/client/classic-debug/i18n/no.po @@ -926,7 +926,7 @@ msgstr "Trikk" #. Used for street-level cable cars where the cable runs #. beneath the car. #: src/client/js/otp/util/Itin.js:226 -msgid "Cable Car" +msgid "Cable Tram" msgstr "Cable Car" #. Any rail system designed for steep inclines. diff --git a/application/src/client/classic-debug/i18n/pl.po b/application/src/client/classic-debug/i18n/pl.po index b8a728e9495..8f08e8de7de 100644 --- a/application/src/client/classic-debug/i18n/pl.po +++ b/application/src/client/classic-debug/i18n/pl.po @@ -947,7 +947,7 @@ msgstr "Light Rail" #. Used for street-level cable cars where the cable runs #. beneath the car. #: src/client/js/otp/util/Itin.js:226 -msgid "Cable Car" +msgid "Cable Tram" msgstr "Kolejka linowa" #. Any rail system designed for steep inclines. diff --git a/application/src/client/classic-debug/i18n/pt.po b/application/src/client/classic-debug/i18n/pt.po index 83ed08f3df1..42fa0d978aa 100644 --- a/application/src/client/classic-debug/i18n/pt.po +++ b/application/src/client/classic-debug/i18n/pt.po @@ -925,7 +925,7 @@ msgstr "Ferroviário leve" #. Used for street-level cable cars where the cable runs #. beneath the car. #: src/client/js/otp/util/Itin.js:226 -msgid "Cable Car" +msgid "Cable Tram" msgstr "Eléctrico" #. Any rail system designed for steep inclines. diff --git a/application/src/client/classic-debug/i18n/sl.po b/application/src/client/classic-debug/i18n/sl.po index 93839344f76..23066db159c 100644 --- a/application/src/client/classic-debug/i18n/sl.po +++ b/application/src/client/classic-debug/i18n/sl.po @@ -931,7 +931,7 @@ msgstr "Tramvaj" #. Used for street-level cable cars where the cable runs #. beneath the car. #: src/client/js/otp/util/Itin.js:226 -msgid "Cable Car" +msgid "Cable Tram" msgstr "" #. Any rail system designed for steep inclines. diff --git a/application/src/client/classic-debug/js/otp/locale/ca_ES.json b/application/src/client/classic-debug/js/otp/locale/ca_ES.json index e0bc0c5e3ba..4ba89dde02d 100644 --- a/application/src/client/classic-debug/js/otp/locale/ca_ES.json +++ b/application/src/client/classic-debug/js/otp/locale/ca_ES.json @@ -155,7 +155,7 @@ "Train": "Tren", "Ferry": "BOT", "Light Rail": "", - "Cable Car": "PONT PENJANT", + "Cable Tram": "PONT PENJANT", "Funicular": "FUNICULAR", "Aerial Tram": "", "Airplane": "", diff --git a/application/src/client/classic-debug/js/otp/locale/de.json b/application/src/client/classic-debug/js/otp/locale/de.json index 5a0aa5316f4..79514b84b1a 100644 --- a/application/src/client/classic-debug/js/otp/locale/de.json +++ b/application/src/client/classic-debug/js/otp/locale/de.json @@ -155,7 +155,7 @@ "Train": "Bahn", "Ferry": "Fähre", "Light Rail": "", - "Cable Car": "Standseilbahn", + "Cable Tram": "Standseilbahn", "Funicular": "Seilbahn", "Aerial Tram": "", "Airplane": "", diff --git a/application/src/client/classic-debug/js/otp/locale/en.json b/application/src/client/classic-debug/js/otp/locale/en.json index 51e5565997c..f7ae611e458 100644 --- a/application/src/client/classic-debug/js/otp/locale/en.json +++ b/application/src/client/classic-debug/js/otp/locale/en.json @@ -155,7 +155,7 @@ "Train": "Train", "Ferry": "Ferry", "Light Rail": "Light Rail", - "Cable Car": "Cable Car", + "Cable Tram": "Cable Tram", "Funicular": "Funicular", "Aerial Tram": "Aerial Tram", "Airplane": "", diff --git a/application/src/client/classic-debug/js/otp/locale/es.json b/application/src/client/classic-debug/js/otp/locale/es.json index fca9c112411..67db91d87b9 100644 --- a/application/src/client/classic-debug/js/otp/locale/es.json +++ b/application/src/client/classic-debug/js/otp/locale/es.json @@ -155,7 +155,7 @@ "Train": "Tren", "Ferry": "Barco", "Light Rail": "Tranvía", - "Cable Car": "Bus Tranvía", + "Cable Tram": "Bus Tranvía", "Funicular": "Funicular", "Aerial Tram": "Funicular", "Airplane": "", diff --git a/application/src/client/classic-debug/js/otp/locale/fr.json b/application/src/client/classic-debug/js/otp/locale/fr.json index 53b4d78be17..76306ba7fe1 100644 --- a/application/src/client/classic-debug/js/otp/locale/fr.json +++ b/application/src/client/classic-debug/js/otp/locale/fr.json @@ -155,7 +155,7 @@ "Train": "Train", "Ferry": "Ferry", "Light Rail": "Tram ou Trolley", - "Cable Car": "Tramway funiculaire", + "Cable Tram": "Tramway funiculaire", "Funicular": "Funiculaire", "Aerial Tram": "Téléphérique", "Airplane": "", diff --git a/application/src/client/classic-debug/js/otp/locale/hu.json b/application/src/client/classic-debug/js/otp/locale/hu.json index 1e1e666e19e..022666bc938 100644 --- a/application/src/client/classic-debug/js/otp/locale/hu.json +++ b/application/src/client/classic-debug/js/otp/locale/hu.json @@ -155,7 +155,7 @@ "Train": "Vonat", "Ferry": "Komp", "Light Rail": "Villamos, könnyűvasút", - "Cable Car": "", + "Cable Tram": "", "Funicular": "Sikló", "Aerial Tram": "Libegő", "Airplane": "Repülőgép", diff --git a/application/src/client/classic-debug/js/otp/locale/it.json b/application/src/client/classic-debug/js/otp/locale/it.json index 0876aba1ef8..f1de09c1985 100644 --- a/application/src/client/classic-debug/js/otp/locale/it.json +++ b/application/src/client/classic-debug/js/otp/locale/it.json @@ -155,7 +155,7 @@ "Train": "treno", "Ferry": "Ferry", "Light Rail": "tram", - "Cable Car": "tram", + "Cable Tram": "tram", "Funicular": "funivia", "Aerial Tram": "tram", "Airplane": "", diff --git a/application/src/client/classic-debug/js/otp/locale/no.json b/application/src/client/classic-debug/js/otp/locale/no.json index 5a64e60d2a6..91013646c2c 100644 --- a/application/src/client/classic-debug/js/otp/locale/no.json +++ b/application/src/client/classic-debug/js/otp/locale/no.json @@ -155,7 +155,7 @@ "Train": "Tog", "Ferry": "Ferje", "Light Rail": "Trikk", - "Cable Car": "Cable Car", + "Cable Tram": "Cable Car", "Funicular": "Kabelbane", "Aerial Tram": "Tau bane", "Airplane": "Fly", diff --git a/application/src/client/classic-debug/js/otp/locale/pl.json b/application/src/client/classic-debug/js/otp/locale/pl.json index 5cf5a9c71b5..a8bbd03a0b9 100644 --- a/application/src/client/classic-debug/js/otp/locale/pl.json +++ b/application/src/client/classic-debug/js/otp/locale/pl.json @@ -161,7 +161,7 @@ "Train": "Pociąg", "Ferry": "Prom", "Light Rail": "Light Rail", - "Cable Car": "Kolejka linowa", + "Cable Tram": "Kolejka linowa", "Funicular": "Kolej linowo-terenowa", "Aerial Tram": "Kolej linowa", "Airplane": "", diff --git a/application/src/client/classic-debug/js/otp/locale/pt.json b/application/src/client/classic-debug/js/otp/locale/pt.json index 9d15e4afe1a..a4a5e9f6599 100644 --- a/application/src/client/classic-debug/js/otp/locale/pt.json +++ b/application/src/client/classic-debug/js/otp/locale/pt.json @@ -155,7 +155,7 @@ "Train": "Comboio", "Ferry": "Ferry", "Light Rail": "Ferroviário leve", - "Cable Car": "Eléctrico", + "Cable Tram": "Eléctrico", "Funicular": "Teleférico", "Aerial Tram": "Teleférico", "Airplane": "", diff --git a/application/src/client/classic-debug/js/otp/locale/sl.json b/application/src/client/classic-debug/js/otp/locale/sl.json index c99ad81f704..6019f19e228 100644 --- a/application/src/client/classic-debug/js/otp/locale/sl.json +++ b/application/src/client/classic-debug/js/otp/locale/sl.json @@ -167,7 +167,7 @@ "Train": "Vlak", "Ferry": "", "Light Rail": "Tramvaj", - "Cable Car": "", + "Cable Tram": "", "Funicular": "", "Aerial Tram": "Gondola", "Airplane": "", diff --git a/application/src/client/classic-debug/js/otp/util/Itin.js b/application/src/client/classic-debug/js/otp/util/Itin.js index 03555b1b3df..af8ce3a162b 100644 --- a/application/src/client/classic-debug/js/otp/util/Itin.js +++ b/application/src/client/classic-debug/js/otp/util/Itin.js @@ -221,9 +221,8 @@ otp.util.Itin = { //TRANSLATORS: Tram, Streetcar, Light rail. Any light rail or street //level system within a metropolitan area. 'TRAM' : _tr('Light Rail'), - //TRANSLATORS: Used for street-level cable cars where the cable runs - //beneath the car. - 'CABLE_CAR': _tr('Cable Car'), + //TRANSLATORS: Used for street-level rail cars where the cable runs beneath the vehicle. + 'CABLE_CAR': _tr('Cable Tram'), //TRANSLATORS: Any rail system designed for steep inclines. 'FUNICULAR': _tr('Funicular'), //TRANSLATORS: Gondola, Suspended cable car. Typically used for aerial diff --git a/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiLeg.java b/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiLeg.java index 7bbd83f7c2d..075038d441e 100644 --- a/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiLeg.java +++ b/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiLeg.java @@ -98,7 +98,7 @@ public class ApiLeg { /** * For transit legs, the type of the route. Non transit -1 When 0-7: 0 Tram, 1 Subway, 2 Train, 3 - * Bus, 4 Ferry, 5 Cable Car, 6 Gondola, 7 Funicular When equal or highter than 100, it is coded + * Bus, 4 Ferry, 5 Cable Tram, 6 Gondola, 7 Funicular When equal or highter than 100, it is coded * using the Hierarchical Vehicle Type (HVT) codes from the European TPEG standard Also see * http://groups.google.com/group/gtfs-changes/msg/ed917a69cf8c5bef */ diff --git a/application/src/main/java/org/opentripplanner/model/plan/Leg.java b/application/src/main/java/org/opentripplanner/model/plan/Leg.java index d9e3a4589d8..81a9a6af10c 100644 --- a/application/src/main/java/org/opentripplanner/model/plan/Leg.java +++ b/application/src/main/java/org/opentripplanner/model/plan/Leg.java @@ -289,7 +289,7 @@ default int getAgencyTimeZoneOffset() { /** * For transit legs, the type of the route. Non transit -1 When 0-7: 0 Tram, 1 Subway, 2 Train, 3 - * Bus, 4 Ferry, 5 Cable Car, 6 Gondola, 7 Funicular When equal or highter than 100, it is coded + * Bus, 4 Ferry, 5 Cable Tram, 6 Gondola, 7 Funicular When equal or highter than 100, it is coded * using the Hierarchical Vehicle Type (HVT) codes from the European TPEG standard Also see * http://groups.google.com/group/gtfs-changes/msg/ed917a69cf8c5bef */ diff --git a/application/src/main/java/org/opentripplanner/transit/model/basic/TransitMode.java b/application/src/main/java/org/opentripplanner/transit/model/basic/TransitMode.java index e25cb435887..507b033f645 100644 --- a/application/src/main/java/org/opentripplanner/transit/model/basic/TransitMode.java +++ b/application/src/main/java/org/opentripplanner/transit/model/basic/TransitMode.java @@ -69,7 +69,7 @@ public String enumValueDescription() { case TRAM -> "Tram, streetcar or light rail. Used for any light rail or street level system within a metropolitan area."; case FERRY -> "Used for short- and long-distance boat service."; case AIRPLANE -> "Taking an airplane"; - case CABLE_CAR -> "Used for street-level cable cars where the cable runs beneath the car."; + case CABLE_CAR -> "Used for street-level rail cars where the cable runs beneath the vehicle."; case GONDOLA -> "Gondola or suspended cable car. Typically used for aerial cable cars where the car is suspended from the cable."; case FUNICULAR -> "Used for any rail system that moves on steep inclines with a cable traction system."; case TROLLEYBUS -> "Used for trolleybus systems which draw power from overhead wires using poles on the roof of the vehicle."; diff --git a/doc/user/RoutingModes.md b/doc/user/RoutingModes.md index 0895e019716..c9b61712498 100644 --- a/doc/user/RoutingModes.md +++ b/doc/user/RoutingModes.md @@ -104,7 +104,7 @@ Used for short- and long-distance bus routes.

CABLE_CAR

-Used for street-level cable cars where the cable runs beneath the car. +Used for street-level rail cars where the cable runs beneath the vehicle.

CARPOOL

From 52baf4dedbe093b50d1238ce9ec4d6029c54194a Mon Sep 17 00:00:00 2001 From: Michael Tsang Date: Thu, 17 Oct 2024 15:52:53 +0100 Subject: [PATCH 028/110] revert changes to the classic debug client it is no longer maintained --- application/src/client/classic-debug/i18n/ca_ES.po | 2 +- application/src/client/classic-debug/i18n/de.po | 2 +- application/src/client/classic-debug/i18n/en.po | 4 ++-- application/src/client/classic-debug/i18n/es.po | 2 +- application/src/client/classic-debug/i18n/fr.po | 2 +- application/src/client/classic-debug/i18n/hu.po | 2 +- application/src/client/classic-debug/i18n/it.po | 2 +- application/src/client/classic-debug/i18n/messages.pot | 2 +- application/src/client/classic-debug/i18n/no.po | 2 +- application/src/client/classic-debug/i18n/pl.po | 2 +- application/src/client/classic-debug/i18n/pt.po | 2 +- application/src/client/classic-debug/i18n/sl.po | 2 +- .../src/client/classic-debug/js/otp/locale/ca_ES.json | 2 +- application/src/client/classic-debug/js/otp/locale/de.json | 2 +- application/src/client/classic-debug/js/otp/locale/en.json | 2 +- application/src/client/classic-debug/js/otp/locale/es.json | 2 +- application/src/client/classic-debug/js/otp/locale/fr.json | 2 +- application/src/client/classic-debug/js/otp/locale/hu.json | 2 +- application/src/client/classic-debug/js/otp/locale/it.json | 2 +- application/src/client/classic-debug/js/otp/locale/no.json | 2 +- application/src/client/classic-debug/js/otp/locale/pl.json | 2 +- application/src/client/classic-debug/js/otp/locale/pt.json | 2 +- application/src/client/classic-debug/js/otp/locale/sl.json | 2 +- application/src/client/classic-debug/js/otp/util/Itin.js | 5 +++-- 24 files changed, 27 insertions(+), 26 deletions(-) diff --git a/application/src/client/classic-debug/i18n/ca_ES.po b/application/src/client/classic-debug/i18n/ca_ES.po index 8c31603fba4..8dd8b1db1eb 100644 --- a/application/src/client/classic-debug/i18n/ca_ES.po +++ b/application/src/client/classic-debug/i18n/ca_ES.po @@ -931,7 +931,7 @@ msgstr "" #. beneath the car. #: src/client/js/otp/util/Itin.js:226 #, fuzzy -msgid "Cable Tram" +msgid "Cable Car" msgstr "PONT PENJANT" #. Any rail system designed for steep inclines. diff --git a/application/src/client/classic-debug/i18n/de.po b/application/src/client/classic-debug/i18n/de.po index 49ac31f1777..0585855e247 100644 --- a/application/src/client/classic-debug/i18n/de.po +++ b/application/src/client/classic-debug/i18n/de.po @@ -919,7 +919,7 @@ msgstr "" #. Used for street-level cable cars where the cable runs #. beneath the car. #: src/client/js/otp/util/Itin.js:226 -msgid "Cable Tram" +msgid "Cable Car" msgstr "Standseilbahn" #. Any rail system designed for steep inclines. diff --git a/application/src/client/classic-debug/i18n/en.po b/application/src/client/classic-debug/i18n/en.po index 94ae67f6431..4727ffef677 100644 --- a/application/src/client/classic-debug/i18n/en.po +++ b/application/src/client/classic-debug/i18n/en.po @@ -930,8 +930,8 @@ msgstr "Light Rail" #. Used for street-level cable cars where the cable runs #. beneath the car. #: src/client/js/otp/util/Itin.js:226 -msgid "Cable Tram" -msgstr "Cable Tram" +msgid "Cable Car" +msgstr "Cable Car" #. Any rail system designed for steep inclines. #: src/client/js/otp/util/Itin.js:228 diff --git a/application/src/client/classic-debug/i18n/es.po b/application/src/client/classic-debug/i18n/es.po index 0799258ab92..b54e2510417 100644 --- a/application/src/client/classic-debug/i18n/es.po +++ b/application/src/client/classic-debug/i18n/es.po @@ -924,7 +924,7 @@ msgstr "Tranvía" #. Used for street-level cable cars where the cable runs #. beneath the car. #: src/client/js/otp/util/Itin.js:226 -msgid "Cable Tram" +msgid "Cable Car" msgstr "Bus Tranvía" #. Any rail system designed for steep inclines. diff --git a/application/src/client/classic-debug/i18n/fr.po b/application/src/client/classic-debug/i18n/fr.po index 1c5e0f69b18..705b313786c 100644 --- a/application/src/client/classic-debug/i18n/fr.po +++ b/application/src/client/classic-debug/i18n/fr.po @@ -932,7 +932,7 @@ msgstr "Tram ou Trolley" #. Used for street-level cable cars where the cable runs #. beneath the car. #: src/client/js/otp/util/Itin.js:226 -msgid "Cable Tram" +msgid "Cable Car" msgstr "Tramway funiculaire" #. Any rail system designed for steep inclines. diff --git a/application/src/client/classic-debug/i18n/hu.po b/application/src/client/classic-debug/i18n/hu.po index 02242925841..25411b79e58 100644 --- a/application/src/client/classic-debug/i18n/hu.po +++ b/application/src/client/classic-debug/i18n/hu.po @@ -937,7 +937,7 @@ msgstr "Villamos, könnyűvasút" #. Used for street-level cable cars where the cable runs #. beneath the car. #: src/client/js/otp/util/Itin.js:226 -msgid "Cable Tram" +msgid "Cable Car" msgstr "" #. Any rail system designed for steep inclines. diff --git a/application/src/client/classic-debug/i18n/it.po b/application/src/client/classic-debug/i18n/it.po index eeb4442ef7c..4d0abe553f3 100644 --- a/application/src/client/classic-debug/i18n/it.po +++ b/application/src/client/classic-debug/i18n/it.po @@ -976,7 +976,7 @@ msgstr "tram" #. beneath the car. #: src/client/js/otp/util/Itin.js:226 #, fuzzy -msgid "Cable Tram" +msgid "Cable Car" msgstr "tram" #. Any rail system designed for steep inclines. diff --git a/application/src/client/classic-debug/i18n/messages.pot b/application/src/client/classic-debug/i18n/messages.pot index 425b5c9bb43..ca5d59b1cc3 100644 --- a/application/src/client/classic-debug/i18n/messages.pot +++ b/application/src/client/classic-debug/i18n/messages.pot @@ -896,7 +896,7 @@ msgstr "" #. Used for street-level cable cars where the cable runs #. beneath the car. #: src/client/js/otp/util/Itin.js:226 -msgid "Cable Tram" +msgid "Cable Car" msgstr "" #. Any rail system designed for steep inclines. diff --git a/application/src/client/classic-debug/i18n/no.po b/application/src/client/classic-debug/i18n/no.po index 8963f038601..9a1d5c9103d 100644 --- a/application/src/client/classic-debug/i18n/no.po +++ b/application/src/client/classic-debug/i18n/no.po @@ -926,7 +926,7 @@ msgstr "Trikk" #. Used for street-level cable cars where the cable runs #. beneath the car. #: src/client/js/otp/util/Itin.js:226 -msgid "Cable Tram" +msgid "Cable Car" msgstr "Cable Car" #. Any rail system designed for steep inclines. diff --git a/application/src/client/classic-debug/i18n/pl.po b/application/src/client/classic-debug/i18n/pl.po index 8f08e8de7de..b8a728e9495 100644 --- a/application/src/client/classic-debug/i18n/pl.po +++ b/application/src/client/classic-debug/i18n/pl.po @@ -947,7 +947,7 @@ msgstr "Light Rail" #. Used for street-level cable cars where the cable runs #. beneath the car. #: src/client/js/otp/util/Itin.js:226 -msgid "Cable Tram" +msgid "Cable Car" msgstr "Kolejka linowa" #. Any rail system designed for steep inclines. diff --git a/application/src/client/classic-debug/i18n/pt.po b/application/src/client/classic-debug/i18n/pt.po index 42fa0d978aa..83ed08f3df1 100644 --- a/application/src/client/classic-debug/i18n/pt.po +++ b/application/src/client/classic-debug/i18n/pt.po @@ -925,7 +925,7 @@ msgstr "Ferroviário leve" #. Used for street-level cable cars where the cable runs #. beneath the car. #: src/client/js/otp/util/Itin.js:226 -msgid "Cable Tram" +msgid "Cable Car" msgstr "Eléctrico" #. Any rail system designed for steep inclines. diff --git a/application/src/client/classic-debug/i18n/sl.po b/application/src/client/classic-debug/i18n/sl.po index 23066db159c..93839344f76 100644 --- a/application/src/client/classic-debug/i18n/sl.po +++ b/application/src/client/classic-debug/i18n/sl.po @@ -931,7 +931,7 @@ msgstr "Tramvaj" #. Used for street-level cable cars where the cable runs #. beneath the car. #: src/client/js/otp/util/Itin.js:226 -msgid "Cable Tram" +msgid "Cable Car" msgstr "" #. Any rail system designed for steep inclines. diff --git a/application/src/client/classic-debug/js/otp/locale/ca_ES.json b/application/src/client/classic-debug/js/otp/locale/ca_ES.json index 4ba89dde02d..e0bc0c5e3ba 100644 --- a/application/src/client/classic-debug/js/otp/locale/ca_ES.json +++ b/application/src/client/classic-debug/js/otp/locale/ca_ES.json @@ -155,7 +155,7 @@ "Train": "Tren", "Ferry": "BOT", "Light Rail": "", - "Cable Tram": "PONT PENJANT", + "Cable Car": "PONT PENJANT", "Funicular": "FUNICULAR", "Aerial Tram": "", "Airplane": "", diff --git a/application/src/client/classic-debug/js/otp/locale/de.json b/application/src/client/classic-debug/js/otp/locale/de.json index 79514b84b1a..5a0aa5316f4 100644 --- a/application/src/client/classic-debug/js/otp/locale/de.json +++ b/application/src/client/classic-debug/js/otp/locale/de.json @@ -155,7 +155,7 @@ "Train": "Bahn", "Ferry": "Fähre", "Light Rail": "", - "Cable Tram": "Standseilbahn", + "Cable Car": "Standseilbahn", "Funicular": "Seilbahn", "Aerial Tram": "", "Airplane": "", diff --git a/application/src/client/classic-debug/js/otp/locale/en.json b/application/src/client/classic-debug/js/otp/locale/en.json index f7ae611e458..51e5565997c 100644 --- a/application/src/client/classic-debug/js/otp/locale/en.json +++ b/application/src/client/classic-debug/js/otp/locale/en.json @@ -155,7 +155,7 @@ "Train": "Train", "Ferry": "Ferry", "Light Rail": "Light Rail", - "Cable Tram": "Cable Tram", + "Cable Car": "Cable Car", "Funicular": "Funicular", "Aerial Tram": "Aerial Tram", "Airplane": "", diff --git a/application/src/client/classic-debug/js/otp/locale/es.json b/application/src/client/classic-debug/js/otp/locale/es.json index 67db91d87b9..fca9c112411 100644 --- a/application/src/client/classic-debug/js/otp/locale/es.json +++ b/application/src/client/classic-debug/js/otp/locale/es.json @@ -155,7 +155,7 @@ "Train": "Tren", "Ferry": "Barco", "Light Rail": "Tranvía", - "Cable Tram": "Bus Tranvía", + "Cable Car": "Bus Tranvía", "Funicular": "Funicular", "Aerial Tram": "Funicular", "Airplane": "", diff --git a/application/src/client/classic-debug/js/otp/locale/fr.json b/application/src/client/classic-debug/js/otp/locale/fr.json index 76306ba7fe1..53b4d78be17 100644 --- a/application/src/client/classic-debug/js/otp/locale/fr.json +++ b/application/src/client/classic-debug/js/otp/locale/fr.json @@ -155,7 +155,7 @@ "Train": "Train", "Ferry": "Ferry", "Light Rail": "Tram ou Trolley", - "Cable Tram": "Tramway funiculaire", + "Cable Car": "Tramway funiculaire", "Funicular": "Funiculaire", "Aerial Tram": "Téléphérique", "Airplane": "", diff --git a/application/src/client/classic-debug/js/otp/locale/hu.json b/application/src/client/classic-debug/js/otp/locale/hu.json index 022666bc938..1e1e666e19e 100644 --- a/application/src/client/classic-debug/js/otp/locale/hu.json +++ b/application/src/client/classic-debug/js/otp/locale/hu.json @@ -155,7 +155,7 @@ "Train": "Vonat", "Ferry": "Komp", "Light Rail": "Villamos, könnyűvasút", - "Cable Tram": "", + "Cable Car": "", "Funicular": "Sikló", "Aerial Tram": "Libegő", "Airplane": "Repülőgép", diff --git a/application/src/client/classic-debug/js/otp/locale/it.json b/application/src/client/classic-debug/js/otp/locale/it.json index f1de09c1985..0876aba1ef8 100644 --- a/application/src/client/classic-debug/js/otp/locale/it.json +++ b/application/src/client/classic-debug/js/otp/locale/it.json @@ -155,7 +155,7 @@ "Train": "treno", "Ferry": "Ferry", "Light Rail": "tram", - "Cable Tram": "tram", + "Cable Car": "tram", "Funicular": "funivia", "Aerial Tram": "tram", "Airplane": "", diff --git a/application/src/client/classic-debug/js/otp/locale/no.json b/application/src/client/classic-debug/js/otp/locale/no.json index 91013646c2c..5a64e60d2a6 100644 --- a/application/src/client/classic-debug/js/otp/locale/no.json +++ b/application/src/client/classic-debug/js/otp/locale/no.json @@ -155,7 +155,7 @@ "Train": "Tog", "Ferry": "Ferje", "Light Rail": "Trikk", - "Cable Tram": "Cable Car", + "Cable Car": "Cable Car", "Funicular": "Kabelbane", "Aerial Tram": "Tau bane", "Airplane": "Fly", diff --git a/application/src/client/classic-debug/js/otp/locale/pl.json b/application/src/client/classic-debug/js/otp/locale/pl.json index a8bbd03a0b9..5cf5a9c71b5 100644 --- a/application/src/client/classic-debug/js/otp/locale/pl.json +++ b/application/src/client/classic-debug/js/otp/locale/pl.json @@ -161,7 +161,7 @@ "Train": "Pociąg", "Ferry": "Prom", "Light Rail": "Light Rail", - "Cable Tram": "Kolejka linowa", + "Cable Car": "Kolejka linowa", "Funicular": "Kolej linowo-terenowa", "Aerial Tram": "Kolej linowa", "Airplane": "", diff --git a/application/src/client/classic-debug/js/otp/locale/pt.json b/application/src/client/classic-debug/js/otp/locale/pt.json index a4a5e9f6599..9d15e4afe1a 100644 --- a/application/src/client/classic-debug/js/otp/locale/pt.json +++ b/application/src/client/classic-debug/js/otp/locale/pt.json @@ -155,7 +155,7 @@ "Train": "Comboio", "Ferry": "Ferry", "Light Rail": "Ferroviário leve", - "Cable Tram": "Eléctrico", + "Cable Car": "Eléctrico", "Funicular": "Teleférico", "Aerial Tram": "Teleférico", "Airplane": "", diff --git a/application/src/client/classic-debug/js/otp/locale/sl.json b/application/src/client/classic-debug/js/otp/locale/sl.json index 6019f19e228..c99ad81f704 100644 --- a/application/src/client/classic-debug/js/otp/locale/sl.json +++ b/application/src/client/classic-debug/js/otp/locale/sl.json @@ -167,7 +167,7 @@ "Train": "Vlak", "Ferry": "", "Light Rail": "Tramvaj", - "Cable Tram": "", + "Cable Car": "", "Funicular": "", "Aerial Tram": "Gondola", "Airplane": "", diff --git a/application/src/client/classic-debug/js/otp/util/Itin.js b/application/src/client/classic-debug/js/otp/util/Itin.js index af8ce3a162b..03555b1b3df 100644 --- a/application/src/client/classic-debug/js/otp/util/Itin.js +++ b/application/src/client/classic-debug/js/otp/util/Itin.js @@ -221,8 +221,9 @@ otp.util.Itin = { //TRANSLATORS: Tram, Streetcar, Light rail. Any light rail or street //level system within a metropolitan area. 'TRAM' : _tr('Light Rail'), - //TRANSLATORS: Used for street-level rail cars where the cable runs beneath the vehicle. - 'CABLE_CAR': _tr('Cable Tram'), + //TRANSLATORS: Used for street-level cable cars where the cable runs + //beneath the car. + 'CABLE_CAR': _tr('Cable Car'), //TRANSLATORS: Any rail system designed for steep inclines. 'FUNICULAR': _tr('Funicular'), //TRANSLATORS: Gondola, Suspended cable car. Typically used for aerial From 561be765445aefc35c0a337aadbf3a8c75704a77 Mon Sep 17 00:00:00 2001 From: Zsombor Welker Date: Mon, 21 Nov 2022 08:22:15 +0100 Subject: [PATCH 029/110] Allow bike walking through bicycle no thru traffic areas --- .../street/model/edge/StreetEdge.java | 15 ++++ .../street/integration/BikeWalkingTest.java | 69 +++++++++++++++++++ 2 files changed, 84 insertions(+) diff --git a/application/src/main/java/org/opentripplanner/street/model/edge/StreetEdge.java b/application/src/main/java/org/opentripplanner/street/model/edge/StreetEdge.java index 92244fe2af2..505d2a95a3a 100644 --- a/application/src/main/java/org/opentripplanner/street/model/edge/StreetEdge.java +++ b/application/src/main/java/org/opentripplanner/street/model/edge/StreetEdge.java @@ -381,6 +381,21 @@ else if (s0.currentMode() == TraverseMode.BICYCLE) { State state = editor != null ? editor.makeState() : null; + // Add an explicit bike-walking state for no-thru-traffic edges, so that dismounting and walking + // is an option to avoid the restriction + if ( + s0.getBackMode() == TraverseMode.BICYCLE && + canTraverse(TraverseMode.BICYCLE) && + isBicycleNoThruTraffic() && + !s0.hasEnteredNoThruTrafficArea() + ) { + var bikeWalk = doTraverse(s0, TraverseMode.WALK, true); + if (bikeWalk != null) { + State forkState = bikeWalk.makeState(); + return State.ofNullable(forkState, state); + } + } + // we are transitioning into a no-drop-off zone therefore we add a second state for dropping // off the vehicle and walking if (state != null && !fromv.rentalDropOffBanned(s0) && tov.rentalDropOffBanned(s0)) { diff --git a/application/src/test/java/org/opentripplanner/street/integration/BikeWalkingTest.java b/application/src/test/java/org/opentripplanner/street/integration/BikeWalkingTest.java index 41ec677b3bb..1d4ec2f3f79 100644 --- a/application/src/test/java/org/opentripplanner/street/integration/BikeWalkingTest.java +++ b/application/src/test/java/org/opentripplanner/street/integration/BikeWalkingTest.java @@ -295,6 +295,75 @@ public void testElevatorBiking() { ); } + @Test + public void testBicycleBicycleNoThruTrafficStart() { + CD.setBicycleNoThruTraffic(true); + + assertPath( + C, + F, + StreetMode.BIKE, + List.of( + "null - 0 / 0.0 - null", + "BICYCLE - 5 / 10.0 - CD street", + "BICYCLE - 5 / 10.0 - DE street", + "BICYCLE - 5 / 10.0 - EF street" + ), + List.of( + "null - 0 / 0.0 - null", + "BICYCLE - 5 / 10.0 - CD street", + "BICYCLE - 5 / 10.0 - DE street", + "BICYCLE - 5 / 10.0 - EF street" + ) + ); + } + + @Test + public void testBicycleBicycleNoThruTrafficMiddle() { + DE.setBicycleNoThruTraffic(true); + + assertPath( + C, + F, + StreetMode.BIKE, + List.of( + "null - 0 / 0.0 - null", + "BICYCLE - 5 / 10.0 - CD street", + "🚲WALK - 120 / 1100.0 - DE street", + "BICYCLE - 105 / 1010.0 - EF street" + ), + List.of( + "null - 0 / 0.0 - null", + "BICYCLE - 105 / 1010.0 - CD street", + "🚲WALK - 120 / 1100.0 - DE street", + "BICYCLE - 5 / 10.0 - EF street" + ) + ); + } + + @Test + public void testBicycleBicycleNoThruTrafficEnd() { + EF.setBicycleNoThruTraffic(true); + + assertPath( + C, + F, + StreetMode.BIKE, + List.of( + "null - 0 / 0.0 - null", + "BICYCLE - 5 / 10.0 - CD street", + "BICYCLE - 5 / 10.0 - DE street", + "BICYCLE - 5 / 10.0 - EF street" + ), + List.of( + "null - 0 / 0.0 - null", + "BICYCLE - 5 / 10.0 - CD street", + "BICYCLE - 5 / 10.0 - DE street", + "BICYCLE - 5 / 10.0 - EF street" + ) + ); + } + @BeforeEach protected void setUp() throws Exception { // Generate a very simple graph From 5f980acc9f6ba5724bf16f8460201c03b65056c5 Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Sun, 20 Oct 2024 18:50:16 +0200 Subject: [PATCH 030/110] refactor:Rename 'transit' to 'transitData' in SearchContext (Raptor) --- .../raptor/configure/RaptorConfig.java | 4 ++-- .../rangeraptor/context/SearchContext.java | 20 +++++++++---------- .../path/configure/PathConfig.java | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/application/src/main/java/org/opentripplanner/raptor/configure/RaptorConfig.java b/application/src/main/java/org/opentripplanner/raptor/configure/RaptorConfig.java index cc488448304..e5c9d90a586 100644 --- a/application/src/main/java/org/opentripplanner/raptor/configure/RaptorConfig.java +++ b/application/src/main/java/org/opentripplanner/raptor/configure/RaptorConfig.java @@ -146,7 +146,7 @@ private RangeRaptorWorker createWorker( return new DefaultRangeRaptorWorker<>( workerState, routingStrategy, - ctx.transit(), + ctx.transitData(), ctx.slackProvider(), ctxLeg.accessPaths(), ctx.calculator(), @@ -159,7 +159,7 @@ private RangeRaptorWorker createWorker( private RangeRaptor createRangeRaptor(SearchContext ctx, RangeRaptorWorker worker) { return new RangeRaptor<>( worker, - ctx.transit(), + ctx.transitData(), ctx.legs().getFirst().accessPaths(), ctx.roundTracker(), ctx.calculator(), diff --git a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/context/SearchContext.java b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/context/SearchContext.java index e322881d786..e197bad8461 100644 --- a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/context/SearchContext.java +++ b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/context/SearchContext.java @@ -59,7 +59,7 @@ public class SearchContext { /** * the transit data role needed for routing */ - protected final RaptorTransitDataProvider transit; + protected final RaptorTransitDataProvider transitData; private final RaptorTransitCalculator calculator; private final RaptorTuningParameters tuningParameters; @@ -75,10 +75,10 @@ public class SearchContext { /** Lazy initialized */ private RaptorCostCalculator costCalculator = null; - public SearchContext( + SearchContext( RaptorRequest request, RaptorTuningParameters tuningParameters, - RaptorTransitDataProvider transit, + RaptorTransitDataProvider transitData, AccessPaths accessPaths, List viaConnections, EgressPaths egressPaths, @@ -86,7 +86,7 @@ public SearchContext( ) { this.request = request; this.tuningParameters = tuningParameters; - this.transit = transit; + this.transitData = transitData; this.calculator = createCalculator(request, tuningParameters); this.roundTracker = @@ -133,8 +133,8 @@ public MultiCriteriaRequest multiCriteria() { return request.multiCriteria(); } - public RaptorTransitDataProvider transit() { - return transit; + public RaptorTransitDataProvider transitData() { + return transitData; } public RaptorTransitCalculator calculator() { @@ -150,7 +150,7 @@ public SlackProvider slackProvider() { } public RaptorSlackProvider raptorSlackProvider() { - return transit.slackProvider(); + return transitData.slackProvider(); } /** @@ -167,7 +167,7 @@ public ToIntFunction boardSlackProvider() { @Nullable public RaptorCostCalculator costCalculator() { if (costCalculator == null) { - this.costCalculator = transit.multiCriteriaCostCalculator(); + this.costCalculator = transitData.multiCriteriaCostCalculator(); } return costCalculator; } @@ -187,7 +187,7 @@ public IntPredicate acceptC2AtDestination() { /** Number of stops in transit graph. */ public int nStops() { - return transit.numberOfStops(); + return transitData.numberOfStops(); } /** Calculate the maximum number of rounds to perform. */ @@ -224,7 +224,7 @@ public boolean useConstrainedTransfers() { /* private methods */ public RaptorStopNameResolver stopNameResolver() { - return transit.stopNameResolver(); + return transitData.stopNameResolver(); } public TimeBasedBoardingSupport createTimeBasedBoardingSupport() { diff --git a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/path/configure/PathConfig.java b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/path/configure/PathConfig.java index 43d504ced7d..24c4d8a3bed 100644 --- a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/path/configure/PathConfig.java +++ b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/path/configure/PathConfig.java @@ -102,7 +102,7 @@ private PathMapper createPathMapper(boolean includeCost) { ctx.raptorSlackProvider(), includeCost ? ctx.costCalculator() : null, ctx.stopNameResolver(), - ctx.transit().transferConstraintsSearch(), + ctx.transitData().transferConstraintsSearch(), ctx.lifeCycle() ); } From 191aec2a91d703a16999875913d1dfc9208ae600 Mon Sep 17 00:00:00 2001 From: Michael Tsang Date: Mon, 21 Oct 2024 09:46:23 +0100 Subject: [PATCH 031/110] do not use wildcard import --- .../gtfs/mapping/TransitModeMapperTest.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/application/src/test/java/org/opentripplanner/gtfs/mapping/TransitModeMapperTest.java b/application/src/test/java/org/opentripplanner/gtfs/mapping/TransitModeMapperTest.java index 86c98b02be4..a872b1456f4 100644 --- a/application/src/test/java/org/opentripplanner/gtfs/mapping/TransitModeMapperTest.java +++ b/application/src/test/java/org/opentripplanner/gtfs/mapping/TransitModeMapperTest.java @@ -1,7 +1,19 @@ package org.opentripplanner.gtfs.mapping; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.opentripplanner.transit.model.basic.TransitMode.*; +import static org.opentripplanner.transit.model.basic.TransitMode.AIRPLANE; +import static org.opentripplanner.transit.model.basic.TransitMode.BUS; +import static org.opentripplanner.transit.model.basic.TransitMode.CABLE_CAR; +import static org.opentripplanner.transit.model.basic.TransitMode.CARPOOL; +import static org.opentripplanner.transit.model.basic.TransitMode.FERRY; +import static org.opentripplanner.transit.model.basic.TransitMode.FUNICULAR; +import static org.opentripplanner.transit.model.basic.TransitMode.GONDOLA; +import static org.opentripplanner.transit.model.basic.TransitMode.MONORAIL; +import static org.opentripplanner.transit.model.basic.TransitMode.RAIL; +import static org.opentripplanner.transit.model.basic.TransitMode.SUBWAY; +import static org.opentripplanner.transit.model.basic.TransitMode.TAXI; +import static org.opentripplanner.transit.model.basic.TransitMode.TRAM; +import static org.opentripplanner.transit.model.basic.TransitMode.TROLLEYBUS; import java.util.stream.Stream; import org.junit.jupiter.params.ParameterizedTest; From ff070c2b48db95f5d785441f34c07973de587a06 Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Mon, 21 Oct 2024 11:44:18 +0200 Subject: [PATCH 032/110] refactor: Delete unused class ViaRangeRaptorDynamicSearch --- .../service/ViaRangeRaptorDynamicSearch.java | 298 ------------------ 1 file changed, 298 deletions(-) delete mode 100644 application/src/main/java/org/opentripplanner/raptor/service/ViaRangeRaptorDynamicSearch.java diff --git a/application/src/main/java/org/opentripplanner/raptor/service/ViaRangeRaptorDynamicSearch.java b/application/src/main/java/org/opentripplanner/raptor/service/ViaRangeRaptorDynamicSearch.java deleted file mode 100644 index 4476e40464f..00000000000 --- a/application/src/main/java/org/opentripplanner/raptor/service/ViaRangeRaptorDynamicSearch.java +++ /dev/null @@ -1,298 +0,0 @@ -package org.opentripplanner.raptor.service; - -import static org.opentripplanner.raptor.api.model.SearchDirection.FORWARD; -import static org.opentripplanner.raptor.api.model.SearchDirection.REVERSE; -import static org.opentripplanner.raptor.api.request.RaptorProfile.MULTI_CRITERIA; -import static org.opentripplanner.raptor.service.HeuristicToRunResolver.resolveHeuristicToRunBasedOnOptimizationsAndSearchParameters; - -import java.util.Collections; -import java.util.List; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; -import java.util.stream.Collectors; -import javax.annotation.Nullable; -import org.opentripplanner.framework.application.OTPRequestTimeoutException; -import org.opentripplanner.raptor.RaptorService; -import org.opentripplanner.raptor.api.model.RaptorTripSchedule; -import org.opentripplanner.raptor.api.request.RaptorRequest; -import org.opentripplanner.raptor.api.request.SearchParams; -import org.opentripplanner.raptor.api.request.SearchParamsBuilder; -import org.opentripplanner.raptor.api.response.RaptorResponse; -import org.opentripplanner.raptor.configure.RaptorConfig; -import org.opentripplanner.raptor.rangeraptor.RangeRaptor; -import org.opentripplanner.raptor.rangeraptor.internalapi.Heuristics; -import org.opentripplanner.raptor.rangeraptor.transit.RaptorSearchWindowCalculator; -import org.opentripplanner.raptor.spi.RaptorTransitDataProvider; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * This search helps the {@link RaptorService} to configure - * heuristics and set dynamic search parameters like EDT, LAT and raptor-search-window. - *

- * If possible the forward and reverse heuristics will be run in parallel. - *

- * Depending on which optimization is enabled and which search parameters are set a forward and/or a - * reverse "single-iteration" raptor search is performed and heuristics are collected. This is used - * to configure the "main" multi-iteration RangeRaptor search. - */ -public class ViaRangeRaptorDynamicSearch { - - private static final Logger LOG = LoggerFactory.getLogger(ViaRangeRaptorDynamicSearch.class); - - private final RaptorConfig config; - private final RaptorTransitDataProvider transitData; - private final RaptorRequest originalRequest; - private final RaptorSearchWindowCalculator dynamicSearchWindowCalculator; - - private final HeuristicSearchTask fwdHeuristics; - private final HeuristicSearchTask revHeuristics; - - public ViaRangeRaptorDynamicSearch( - RaptorConfig config, - RaptorTransitDataProvider transitData, - RaptorRequest originalRequest - ) { - this.config = config; - this.transitData = transitData; - this.originalRequest = originalRequest; - this.dynamicSearchWindowCalculator = - config.searchWindowCalculator().withSearchParams(originalRequest.searchParams()); - - this.fwdHeuristics = new HeuristicSearchTask<>(FORWARD, "Forward", config, transitData); - this.revHeuristics = new HeuristicSearchTask<>(REVERSE, "Reverse", config, transitData); - } - - public RaptorResponse route() { - try { - enableHeuristicSearchBasedOnOptimizationsAndSearchParameters(); - - // Run heuristics, if no destination is reached - runHeuristics(); - - // Set search-window and other dynamic calculated parameters - var dynamicRequest = requestWithDynamicSearchParams(originalRequest); - - return createAndRunDynamicRRWorker(dynamicRequest); - } catch (DestinationNotReachedException e) { - return new RaptorResponse<>( - Collections.emptyList(), - null, - // If a trip exists(forward heuristics succeed), but is outside the calculated - // search-window, then set the search-window params as if the request was - // performed. This enables the client to page to the next window - requestWithDynamicSearchParams(originalRequest), - false - ); - } - } - - /** - * Only exposed for testing purposes - */ - @Nullable - public Heuristics getDestinationHeuristics() { - if (!originalRequest.useDestinationPruning()) { - return null; - } - LOG.debug("RangeRaptor - Destination pruning enabled."); - return revHeuristics.result(); - } - - /** - * Create and prepare heuristic search (both FORWARD and REVERSE) based on optimizations and input - * search parameters. This is done for Standard and Multi-criteria profiles only. - */ - private void enableHeuristicSearchBasedOnOptimizationsAndSearchParameters() { - // We delegate this to a static method to be able to write unit test on this logic - resolveHeuristicToRunBasedOnOptimizationsAndSearchParameters( - originalRequest, - fwdHeuristics::enable, - revHeuristics::enable - ); - } - - /** - * Run standard "singe-iteration" raptor search to calculate heuristics - this should be really - * fast to run compared with a (multi-criteria) range-raptor search. - * - * @throws DestinationNotReachedException if destination is not reached. - */ - private void runHeuristics() { - if (isItPossibleToRunHeuristicsInParallel()) { - runHeuristicsInParallel(); - } else { - runHeuristicsSequentially(); - } - fwdHeuristics.debugCompareResult(revHeuristics); - } - - private RaptorResponse createAndRunDynamicRRWorker(RaptorRequest request) { - LOG.debug("Main request: {}", request); - RangeRaptor rangeRaptorRouter; - - // Create worker - if (request.profile().is(MULTI_CRITERIA)) { - rangeRaptorRouter = - config.createRangeRaptorWithMcWorker(transitData, request, getDestinationHeuristics()); - } else { - rangeRaptorRouter = config.createRangeRaptorWithStdWorker(transitData, request); - } - - // Route - var result = rangeRaptorRouter.route(); - - // create and return response - return new RaptorResponse<>( - result.extractPaths(), - new DefaultStopArrivals(result), - request, - // This method is not run unless the heuristic reached the destination - true - ); - } - - private boolean isItPossibleToRunHeuristicsInParallel() { - SearchParams s = originalRequest.searchParams(); - return ( - config.isMultiThreaded() && - originalRequest.runInParallel() && - s.isEarliestDepartureTimeSet() && - s.isLatestArrivalTimeSet() && - fwdHeuristics.isEnabled() && - revHeuristics.isEnabled() - ); - } - - /** - * @throws DestinationNotReachedException if destination is not reached - */ - private void runHeuristicsInParallel() { - fwdHeuristics.withRequest(originalRequest); - revHeuristics.withRequest(originalRequest); - Future asyncResult = null; - try { - asyncResult = config.threadPool().submit(fwdHeuristics::run); - revHeuristics.run(); - asyncResult.get(); - LOG.debug( - "Route using RangeRaptor - " + "REVERSE and FORWARD heuristic search performed in parallel." - ); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - // propagate interruption to the running task. - asyncResult.cancel(true); - throw new OTPRequestTimeoutException(); - } catch (ExecutionException e) { - if (e.getCause() instanceof DestinationNotReachedException) { - throw new DestinationNotReachedException(); - } - LOG.error(e.getMessage() + ". Request: " + originalRequest, e); - throw new IllegalStateException( - "Failed to run FORWARD/REVERSE heuristic search in parallel. Details: " + e.getMessage() - ); - } - } - - /** - * @throws DestinationNotReachedException if destination is not reached - */ - private void runHeuristicsSequentially() { - List> tasks = listTasksInOrder(); - - if (tasks.isEmpty()) { - return; - } - - // Run the first heuristic search - Heuristics result = runHeuristicSearchTask(tasks.get(0)); - calculateDynamicSearchParametersFromHeuristics(result); - - if (tasks.size() == 1) { - return; - } - - // Run the second heuristic search - runHeuristicSearchTask(tasks.get(1)); - } - - private Heuristics runHeuristicSearchTask(HeuristicSearchTask task) { - RaptorRequest request = task.getDirection().isForward() - ? requestForForwardHeurSearchWithDynamicSearchParams() - : requestForReverseHeurSearchWithDynamicSearchParams(); - - task.withRequest(request).run(); - - return task.result(); - } - - /** - * If the earliest-departure-time(EDT) is set, the task order should be: - *

    - *
  1. {@code FORWARD}
  2. - *
  3. {@code REVERSE}
  4. - *
- * If no EDT is set, the latest-arrival-time is set, and the order should be the opposite, - * with {@code REVERSE} first - */ - private List> listTasksInOrder() { - boolean performForwardFirst = originalRequest.searchParams().isEarliestDepartureTimeSet(); - - List> list = performForwardFirst - ? List.of(fwdHeuristics, revHeuristics) - : List.of(revHeuristics, fwdHeuristics); - - return list.stream().filter(HeuristicSearchTask::isEnabled).collect(Collectors.toList()); - } - - private RaptorRequest requestForForwardHeurSearchWithDynamicSearchParams() { - if (originalRequest.searchParams().isEarliestDepartureTimeSet()) { - return originalRequest; - } - return originalRequest - .mutate() - .searchParams() - .earliestDepartureTime(transitData.getValidTransitDataStartTime()) - .build(); - } - - private RaptorRequest requestForReverseHeurSearchWithDynamicSearchParams() { - if (originalRequest.searchParams().isLatestArrivalTimeSet()) { - return originalRequest; - } - return originalRequest - .mutate() - .searchParams() - .latestArrivalTime( - transitData.getValidTransitDataEndTime() + - originalRequest.searchParams().accessEgressMaxDurationSeconds() - ) - .build(); - } - - private RaptorRequest requestWithDynamicSearchParams(RaptorRequest request) { - SearchParamsBuilder builder = request.mutate().searchParams(); - - if (!request.searchParams().isEarliestDepartureTimeSet()) { - builder.earliestDepartureTime(dynamicSearchWindowCalculator.getEarliestDepartureTime()); - } - if (!request.searchParams().isSearchWindowSet()) { - builder.searchWindowInSeconds(dynamicSearchWindowCalculator.getSearchWindowSeconds()); - } - // We do not set the latest-arrival-time, because we do not want to limit the forward - // multi-criteria search, it does not have much effect on the performance - we only risk - // losing optimal results. - return builder.build(); - } - - private void calculateDynamicSearchParametersFromHeuristics(@Nullable Heuristics heuristics) { - if (heuristics != null) { - dynamicSearchWindowCalculator - .withHeuristics( - heuristics.bestOverallJourneyTravelDuration(), - heuristics.minWaitTimeForJourneysReachingDestination() - ) - .calculate(); - } - } -} From a00003b225daf972a3875205bf2262ce59398ed6 Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Mon, 21 Oct 2024 11:46:10 +0200 Subject: [PATCH 033/110] refactor: Small cleanup in Raptor --- .../raptor/configure/RaptorConfig.java | 17 ++++++++++------- .../raptor/service/HeuristicSearchTask.java | 3 ++- .../service/RangeRaptorDynamicSearch.java | 10 +++++----- .../raptor/RaptorArchitectureTest.java | 2 +- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/application/src/main/java/org/opentripplanner/raptor/configure/RaptorConfig.java b/application/src/main/java/org/opentripplanner/raptor/configure/RaptorConfig.java index e5c9d90a586..84ab67e4959 100644 --- a/application/src/main/java/org/opentripplanner/raptor/configure/RaptorConfig.java +++ b/application/src/main/java/org/opentripplanner/raptor/configure/RaptorConfig.java @@ -15,6 +15,7 @@ import org.opentripplanner.raptor.rangeraptor.internalapi.Heuristics; import org.opentripplanner.raptor.rangeraptor.internalapi.PassThroughPointsService; import org.opentripplanner.raptor.rangeraptor.internalapi.RangeRaptorWorker; +import org.opentripplanner.raptor.rangeraptor.internalapi.RaptorRouter; import org.opentripplanner.raptor.rangeraptor.internalapi.RaptorRouterResult; import org.opentripplanner.raptor.rangeraptor.internalapi.RaptorWorkerState; import org.opentripplanner.raptor.rangeraptor.internalapi.RoutingStrategy; @@ -27,14 +28,16 @@ /** * This class is responsible for creating a new search and holding application scoped Raptor state. *

- * This class should have APPLICATION scope. It manage a threadPool, and hold a reference to the - * application tuning parameters. + * This class should have APPLICATION scope. It keep a reference to the threadPool used by Raptor, + * and holds a reference to the application tuning parameters. * * @param The TripSchedule type defined by the user of the raptor API. */ public class RaptorConfig { + @Nullable private final ExecutorService threadPool; + private final RaptorTuningParameters tuningParameters; /** The service is not final, because it depends on the request. */ @@ -58,7 +61,7 @@ public SearchContext context(RaptorTransitDataProvider transit, RaptorRequ return SearchContext.of(request, tuningParameters, transit, acceptC2AtDestination).build(); } - public RangeRaptor createRangeRaptorWithStdWorker( + public RaptorRouter createRangeRaptorWithStdWorker( RaptorTransitDataProvider transitData, RaptorRequest request ) { @@ -70,7 +73,7 @@ public RangeRaptor createRangeRaptorWithStdWorker( ); } - public RangeRaptor createRangeRaptorWithMcWorker( + public RaptorRouter createRangeRaptorWithMcWorker( RaptorTransitDataProvider transitData, RaptorRequest request, Heuristics heuristics @@ -93,11 +96,10 @@ public RangeRaptor createRangeRaptorWithMcWorker( var c = new McRangeRaptorConfig<>(leg, passThroughPointsService).withHeuristics(heuristics); worker = createWorker(leg, c.state(), c.strategy()); } - return createRangeRaptor(context, worker); } - public RangeRaptor createRangeRaptorWithHeuristicSearch( + public RaptorRouter createRangeRaptorWithHeuristicSearch( RaptorTransitDataProvider transitData, RaptorRequest request ) { @@ -117,6 +119,7 @@ public boolean isMultiThreaded() { return threadPool != null; } + @Nullable public ExecutorService threadPool() { return threadPool; } @@ -156,7 +159,7 @@ private RangeRaptorWorker createWorker( ); } - private RangeRaptor createRangeRaptor(SearchContext ctx, RangeRaptorWorker worker) { + private RaptorRouter createRangeRaptor(SearchContext ctx, RangeRaptorWorker worker) { return new RangeRaptor<>( worker, ctx.transitData(), diff --git a/application/src/main/java/org/opentripplanner/raptor/service/HeuristicSearchTask.java b/application/src/main/java/org/opentripplanner/raptor/service/HeuristicSearchTask.java index 7c0158d2192..0de84283af8 100644 --- a/application/src/main/java/org/opentripplanner/raptor/service/HeuristicSearchTask.java +++ b/application/src/main/java/org/opentripplanner/raptor/service/HeuristicSearchTask.java @@ -10,6 +10,7 @@ import org.opentripplanner.raptor.configure.RaptorConfig; import org.opentripplanner.raptor.rangeraptor.RangeRaptor; import org.opentripplanner.raptor.rangeraptor.internalapi.Heuristics; +import org.opentripplanner.raptor.rangeraptor.internalapi.RaptorRouter; import org.opentripplanner.raptor.rangeraptor.internalapi.RaptorRouterResult; import org.opentripplanner.raptor.spi.RaptorTransitDataProvider; import org.slf4j.Logger; @@ -33,7 +34,7 @@ public class HeuristicSearchTask { private final RaptorTransitDataProvider transitData; private boolean run = false; - private RangeRaptor search = null; + private RaptorRouter search = null; private RaptorRequest originalRequest; private RaptorRequest heuristicRequest; private RaptorRouterResult result = null; diff --git a/application/src/main/java/org/opentripplanner/raptor/service/RangeRaptorDynamicSearch.java b/application/src/main/java/org/opentripplanner/raptor/service/RangeRaptorDynamicSearch.java index 5353804f414..3af049a55ec 100644 --- a/application/src/main/java/org/opentripplanner/raptor/service/RangeRaptorDynamicSearch.java +++ b/application/src/main/java/org/opentripplanner/raptor/service/RangeRaptorDynamicSearch.java @@ -19,8 +19,8 @@ import org.opentripplanner.raptor.api.request.SearchParamsBuilder; import org.opentripplanner.raptor.api.response.RaptorResponse; import org.opentripplanner.raptor.configure.RaptorConfig; -import org.opentripplanner.raptor.rangeraptor.RangeRaptor; import org.opentripplanner.raptor.rangeraptor.internalapi.Heuristics; +import org.opentripplanner.raptor.rangeraptor.internalapi.RaptorRouter; import org.opentripplanner.raptor.rangeraptor.transit.RaptorSearchWindowCalculator; import org.opentripplanner.raptor.spi.RaptorTransitDataProvider; import org.slf4j.Logger; @@ -129,18 +129,18 @@ private void runHeuristics() { private RaptorResponse createAndRunDynamicRRWorker(RaptorRequest request) { LOG.debug("Main request: {}", request); - RangeRaptor rangeRaptorRouter; + RaptorRouter raptorRouter; // Create worker if (request.profile().is(MULTI_CRITERIA)) { - rangeRaptorRouter = + raptorRouter = config.createRangeRaptorWithMcWorker(transitData, request, getDestinationHeuristics()); } else { - rangeRaptorRouter = config.createRangeRaptorWithStdWorker(transitData, request); + raptorRouter = config.createRangeRaptorWithStdWorker(transitData, request); } // Route - var result = rangeRaptorRouter.route(); + var result = raptorRouter.route(); // create and return response return new RaptorResponse<>( diff --git a/application/src/test/java/org/opentripplanner/raptor/RaptorArchitectureTest.java b/application/src/test/java/org/opentripplanner/raptor/RaptorArchitectureTest.java index 657e060c30b..13f341279f7 100644 --- a/application/src/test/java/org/opentripplanner/raptor/RaptorArchitectureTest.java +++ b/application/src/test/java/org/opentripplanner/raptor/RaptorArchitectureTest.java @@ -77,7 +77,7 @@ void enforcePackageDependenciesRaptorAPI() { @Test void enforcePackageDependenciesRaptorSPI() { - RAPTOR.subPackage("spi").dependsOn(FRAMEWORK_UTILS, API_MODEL, API_PATH).verify(); + RAPTOR_SPI.dependsOn(FRAMEWORK_UTILS, API_MODEL, API_PATH).verify(); } @Test From fc5e85b164ca0b3fa61ac7fbf042a6d9069108e2 Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Mon, 21 Oct 2024 11:54:52 +0200 Subject: [PATCH 034/110] feature: Extend Raptor with the possibility to run an extra multi-criteria search. --- .../opentripplanner/raptor/RaptorService.java | 15 +++- .../raptor/configure/RaptorConfig.java | 32 +++++++-- .../raptor/rangeraptor/CompositeResult.java | 71 +++++++++++++++++++ .../ConcurrentCompositeRaptorRouter.java | 64 +++++++++++++++++ .../service/RangeRaptorDynamicSearch.java | 13 +++- .../raptor/spi/ExtraMcRouterSearch.java | 35 +++++++++ .../raptor/moduletests/I01_HeuristicTest.java | 4 +- 7 files changed, 225 insertions(+), 9 deletions(-) create mode 100644 application/src/main/java/org/opentripplanner/raptor/rangeraptor/CompositeResult.java create mode 100644 application/src/main/java/org/opentripplanner/raptor/rangeraptor/ConcurrentCompositeRaptorRouter.java create mode 100644 application/src/main/java/org/opentripplanner/raptor/spi/ExtraMcRouterSearch.java diff --git a/application/src/main/java/org/opentripplanner/raptor/RaptorService.java b/application/src/main/java/org/opentripplanner/raptor/RaptorService.java index 70156cbbfbe..599a4104414 100644 --- a/application/src/main/java/org/opentripplanner/raptor/RaptorService.java +++ b/application/src/main/java/org/opentripplanner/raptor/RaptorService.java @@ -1,6 +1,7 @@ package org.opentripplanner.raptor; import java.util.stream.Collectors; +import javax.annotation.Nullable; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; import org.opentripplanner.raptor.api.request.RaptorRequest; import org.opentripplanner.raptor.api.response.RaptorResponse; @@ -8,6 +9,7 @@ import org.opentripplanner.raptor.service.DefaultStopArrivals; import org.opentripplanner.raptor.service.HeuristicSearchTask; import org.opentripplanner.raptor.service.RangeRaptorDynamicSearch; +import org.opentripplanner.raptor.spi.ExtraMcRouterSearch; import org.opentripplanner.raptor.spi.RaptorTransitDataProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -23,8 +25,16 @@ public class RaptorService { private final RaptorConfig config; - public RaptorService(RaptorConfig config) { + @Nullable + private final ExtraMcRouterSearch extraMcSearch; + + public RaptorService(RaptorConfig config, @Nullable ExtraMcRouterSearch extraMcSearch) { this.config = config; + this.extraMcSearch = extraMcSearch; + } + + public RaptorService(RaptorConfig config) { + this(config, null); } public RaptorResponse route( @@ -35,7 +45,8 @@ public RaptorResponse route( RaptorResponse response; if (request.isDynamicSearch()) { - response = new RangeRaptorDynamicSearch<>(config, transitData, request).route(); + response = + new RangeRaptorDynamicSearch<>(config, transitData, extraMcSearch, request).route(); } else { response = routeUsingStdWorker(transitData, request); } diff --git a/application/src/main/java/org/opentripplanner/raptor/configure/RaptorConfig.java b/application/src/main/java/org/opentripplanner/raptor/configure/RaptorConfig.java index 84ab67e4959..6c86cfca4b0 100644 --- a/application/src/main/java/org/opentripplanner/raptor/configure/RaptorConfig.java +++ b/application/src/main/java/org/opentripplanner/raptor/configure/RaptorConfig.java @@ -7,6 +7,7 @@ import org.opentripplanner.raptor.api.model.RaptorTripSchedule; import org.opentripplanner.raptor.api.request.RaptorRequest; import org.opentripplanner.raptor.api.request.RaptorTuningParameters; +import org.opentripplanner.raptor.rangeraptor.ConcurrentCompositeRaptorRouter; import org.opentripplanner.raptor.rangeraptor.DefaultRangeRaptorWorker; import org.opentripplanner.raptor.rangeraptor.RangeRaptor; import org.opentripplanner.raptor.rangeraptor.RangeRaptorWorkerComposite; @@ -23,6 +24,7 @@ import org.opentripplanner.raptor.rangeraptor.multicriteria.configure.McRangeRaptorConfig; import org.opentripplanner.raptor.rangeraptor.standard.configure.StdRangeRaptorConfig; import org.opentripplanner.raptor.rangeraptor.transit.RaptorSearchWindowCalculator; +import org.opentripplanner.raptor.spi.ExtraMcRouterSearch; import org.opentripplanner.raptor.spi.RaptorTransitDataProvider; /** @@ -67,13 +69,35 @@ public RaptorRouter createRangeRaptorWithStdWorker( ) { var context = context(transitData, request); var stdConfig = new StdRangeRaptorConfig<>(context); - return createRangeRaptor( - context, - createWorker(context.legs().getFirst(), stdConfig.state(), stdConfig.strategy()) - ); + var worker = createWorker(context.legs().getFirst(), stdConfig.state(), stdConfig.strategy()); + return createRangeRaptor(context, worker); } public RaptorRouter createRangeRaptorWithMcWorker( + RaptorTransitDataProvider transitData, + RaptorRequest request, + Heuristics heuristics, + @Nullable ExtraMcRouterSearch extraMcSearch + ) { + var mainSearch = createRangeRaptorWithMcWorker(transitData, request, heuristics); + + if (extraMcSearch == null) { + return mainSearch; + } + var alternativeSearch = createRangeRaptorWithMcWorker( + extraMcSearch.createTransitDataAlternativeSearch(transitData), + request, + heuristics + ); + return new ConcurrentCompositeRaptorRouter<>( + mainSearch, + alternativeSearch, + extraMcSearch.merger(), + threadPool() + ); + } + + private RaptorRouter createRangeRaptorWithMcWorker( RaptorTransitDataProvider transitData, RaptorRequest request, Heuristics heuristics diff --git a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/CompositeResult.java b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/CompositeResult.java new file mode 100644 index 00000000000..d92f0df79bb --- /dev/null +++ b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/CompositeResult.java @@ -0,0 +1,71 @@ +package org.opentripplanner.raptor.rangeraptor; + +import java.util.Collection; +import java.util.function.BiFunction; +import org.opentripplanner.raptor.api.model.RaptorTripSchedule; +import org.opentripplanner.raptor.api.path.RaptorPath; +import org.opentripplanner.raptor.rangeraptor.internalapi.RaptorRouterResult; +import org.opentripplanner.raptor.rangeraptor.internalapi.SingleCriteriaStopArrivals; + +/** + * Join two results together. + *

    + *
  • Everything from the first result is added
  • + *
  • The result is merged with the injected merge strategy.
  • + *
  • Some of the methods ONLY return the result of the main search!
  • + *
+ */ +class CompositeResult implements RaptorRouterResult { + + private final RaptorRouterResult mainResult; + private final Collection> result; + + CompositeResult( + RaptorRouterResult mainResult, + RaptorRouterResult alternativeResult, + BiFunction>, Collection>, Collection>> merger + ) { + this.mainResult = mainResult; + this.result = merger.apply(mainResult.extractPaths(), alternativeResult.extractPaths()); + } + + /** + * Return the merged result. + */ + @Override + public Collection> extractPaths() { + return result; + } + + /** + * Return the main result only. + */ + @Override + public SingleCriteriaStopArrivals extractBestOverallArrivals() { + return mainResult.extractBestOverallArrivals(); + } + + /** + * Return the main result only. + */ + @Override + public SingleCriteriaStopArrivals extractBestTransitArrivals() { + return mainResult.extractBestTransitArrivals(); + } + + /** + * Return the main result only. + */ + @Override + public SingleCriteriaStopArrivals extractBestNumberOfTransfers() { + return mainResult.extractBestNumberOfTransfers(); + } + + /** + * Return true if either the main or the alternative search has reached the destination. + */ + @Override + public boolean isDestinationReached() { + return !result.isEmpty(); + } +} diff --git a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/ConcurrentCompositeRaptorRouter.java b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/ConcurrentCompositeRaptorRouter.java new file mode 100644 index 00000000000..dbf0c2d89c7 --- /dev/null +++ b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/ConcurrentCompositeRaptorRouter.java @@ -0,0 +1,64 @@ +package org.opentripplanner.raptor.rangeraptor; + +import java.util.Collection; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.function.BiFunction; +import org.opentripplanner.framework.application.OTPRequestTimeoutException; +import org.opentripplanner.raptor.api.model.RaptorTripSchedule; +import org.opentripplanner.raptor.api.path.RaptorPath; +import org.opentripplanner.raptor.rangeraptor.internalapi.RaptorRouter; +import org.opentripplanner.raptor.rangeraptor.internalapi.RaptorRouterResult; + +/** + * Run two Raptor routers and join the result. The two searches are run concurrent if an + * {@link ExecutorService} is provided. + * @see CompositeResult for joining results. + */ +public class ConcurrentCompositeRaptorRouter + implements RaptorRouter { + + private final RaptorRouter mainWorker; + private final RaptorRouter alternativeWorker; + private final BiFunction>, Collection>, Collection>> merger; + private final ExecutorService executorService; + + public ConcurrentCompositeRaptorRouter( + RaptorRouter mainWorker, + RaptorRouter alternativeWorker, + BiFunction>, Collection>, Collection>> merger, + ExecutorService executorService + ) { + this.mainWorker = mainWorker; + this.alternativeWorker = alternativeWorker; + this.merger = merger; + this.executorService = executorService; + } + + @Override + public RaptorRouterResult route() { + if (executorService == null) { + var mainResult = mainWorker.route(); + var alternativeResult = alternativeWorker.route(); + return new CompositeResult<>(mainResult, alternativeResult, merger); + } + + var mainResultFuture = executorService.submit(mainWorker::route); + var alternativeResultFuture = executorService.submit(alternativeWorker::route); + + try { + var mainResult = mainResultFuture.get(); + var alternativeResult = alternativeResultFuture.get(); + return new CompositeResult<>(mainResult, alternativeResult, merger); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + // propagate interruption to the running task. + + mainResultFuture.cancel(true); + alternativeResultFuture.cancel(true); + throw new OTPRequestTimeoutException(); + } catch (ExecutionException e) { + throw (e.getCause() instanceof RuntimeException re) ? re : new RuntimeException(e); + } + } +} diff --git a/application/src/main/java/org/opentripplanner/raptor/service/RangeRaptorDynamicSearch.java b/application/src/main/java/org/opentripplanner/raptor/service/RangeRaptorDynamicSearch.java index 3af049a55ec..cba79f3a115 100644 --- a/application/src/main/java/org/opentripplanner/raptor/service/RangeRaptorDynamicSearch.java +++ b/application/src/main/java/org/opentripplanner/raptor/service/RangeRaptorDynamicSearch.java @@ -22,6 +22,7 @@ import org.opentripplanner.raptor.rangeraptor.internalapi.Heuristics; import org.opentripplanner.raptor.rangeraptor.internalapi.RaptorRouter; import org.opentripplanner.raptor.rangeraptor.transit.RaptorSearchWindowCalculator; +import org.opentripplanner.raptor.spi.ExtraMcRouterSearch; import org.opentripplanner.raptor.spi.RaptorTransitDataProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -45,12 +46,16 @@ public class RangeRaptorDynamicSearch { private final RaptorRequest originalRequest; private final RaptorSearchWindowCalculator dynamicSearchWindowCalculator; + @Nullable + private final ExtraMcRouterSearch extraMcSearch; + private final HeuristicSearchTask fwdHeuristics; private final HeuristicSearchTask revHeuristics; public RangeRaptorDynamicSearch( RaptorConfig config, RaptorTransitDataProvider transitData, + @Nullable ExtraMcRouterSearch extraMcSearch, RaptorRequest originalRequest ) { this.config = config; @@ -58,6 +63,7 @@ public RangeRaptorDynamicSearch( this.originalRequest = originalRequest; this.dynamicSearchWindowCalculator = config.searchWindowCalculator().withSearchParams(originalRequest.searchParams()); + this.extraMcSearch = extraMcSearch; this.fwdHeuristics = new HeuristicSearchTask<>(FORWARD, "Forward", config, transitData); this.revHeuristics = new HeuristicSearchTask<>(REVERSE, "Reverse", config, transitData); @@ -134,7 +140,12 @@ private RaptorResponse createAndRunDynamicRRWorker(RaptorRequest request) // Create worker if (request.profile().is(MULTI_CRITERIA)) { raptorRouter = - config.createRangeRaptorWithMcWorker(transitData, request, getDestinationHeuristics()); + config.createRangeRaptorWithMcWorker( + transitData, + request, + getDestinationHeuristics(), + extraMcSearch + ); } else { raptorRouter = config.createRangeRaptorWithStdWorker(transitData, request); } diff --git a/application/src/main/java/org/opentripplanner/raptor/spi/ExtraMcRouterSearch.java b/application/src/main/java/org/opentripplanner/raptor/spi/ExtraMcRouterSearch.java new file mode 100644 index 00000000000..afebc107832 --- /dev/null +++ b/application/src/main/java/org/opentripplanner/raptor/spi/ExtraMcRouterSearch.java @@ -0,0 +1,35 @@ +package org.opentripplanner.raptor.spi; + +import java.util.Collection; +import java.util.function.BiFunction; +import org.opentripplanner.raptor.api.model.RaptorTripSchedule; +import org.opentripplanner.raptor.api.path.RaptorPath; + +/** + * This interface is used to run two mulit-criteria searches and merging the result. Raptor will + * run the heuristics as normal. Then create two multi-criteria searches, the main search and the + * alternative search. The caller must provide a {@code merger} and + * {@link RaptorTransitDataProvider}. The transit data is used for the alternative search. This + * allows the caller to filter the transit data or change the cost-calculator. + *

+ * When changing the transit data, you may also invalidate the heuristics created by Raptor. If this + * is the case, you need to turn off the {@link org.opentripplanner.raptor.api.request.Optimization#PARETO_CHECK_AGAINST_DESTINATION}. + * For the heuristics to work, you may add extra cost or filter away data. + *

+ * @param The TripSchedule type defined by the user of the raptor API. + */ +public interface ExtraMcRouterSearch { + /** + * The returned transit-data is used in the ALTERNATIVE search. The given transit data is used in + * the main search. It is the same data passed into Raptor. + */ + RaptorTransitDataProvider createTransitDataAlternativeSearch( + RaptorTransitDataProvider transitDataMainSearch + ); + + /** + * You must provide a merge strategy to merge the main result (first argument) with the + * alternative result(second argument). Make sure the end result does not have any duplicates. + */ + BiFunction>, Collection>, Collection>> merger(); +} diff --git a/application/src/test/java/org/opentripplanner/raptor/moduletests/I01_HeuristicTest.java b/application/src/test/java/org/opentripplanner/raptor/moduletests/I01_HeuristicTest.java index 7fe9cfa2c15..1e2f79cce44 100644 --- a/application/src/test/java/org/opentripplanner/raptor/moduletests/I01_HeuristicTest.java +++ b/application/src/test/java/org/opentripplanner/raptor/moduletests/I01_HeuristicTest.java @@ -90,7 +90,7 @@ public void setup() { public void regular() { var request = requestBuilder.build(); - var search = new RangeRaptorDynamicSearch<>(config, data, request); + var search = new RangeRaptorDynamicSearch<>(config, data, null, request); search.route(); @@ -105,7 +105,7 @@ public void withConstrainedTransfers() { var request = requestBuilder.build(); - var search = new RangeRaptorDynamicSearch<>(config, data, request); + var search = new RangeRaptorDynamicSearch<>(config, data, null, request); search.route(); From a20988a2c3f9648717d1bd6306af7a1366f5949b Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Mon, 21 Oct 2024 12:09:02 +0200 Subject: [PATCH 035/110] feature: Add method to calculate distance to WgsCoordinate. --- .../framework/geometry/WgsCoordinate.java | 14 ++++++++++++++ .../framework/geometry/WgsCoordinateTest.java | 10 ++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/application/src/main/java/org/opentripplanner/framework/geometry/WgsCoordinate.java b/application/src/main/java/org/opentripplanner/framework/geometry/WgsCoordinate.java index 6c3dbf0f9d3..136bb4264c0 100644 --- a/application/src/main/java/org/opentripplanner/framework/geometry/WgsCoordinate.java +++ b/application/src/main/java/org/opentripplanner/framework/geometry/WgsCoordinate.java @@ -163,6 +163,20 @@ public WgsCoordinate roundToApproximate100m() { return new WgsCoordinate(lat, lng); } + /** + * Compute a farly accurate distance between two coordinates. Use the fast version in + * {@link SphericalDistanceLibrary} if many computations are needed. Return the distance in + * meters between the two coordinates. + */ + public double distanceTo(WgsCoordinate other) { + return SphericalDistanceLibrary.distance( + this.latitude, + this.longitude, + other.latitude, + other.longitude + ); + } + /** * Return a new coordinate that is moved an approximate number of meters east. */ diff --git a/application/src/test/java/org/opentripplanner/framework/geometry/WgsCoordinateTest.java b/application/src/test/java/org/opentripplanner/framework/geometry/WgsCoordinateTest.java index 5cd7ac66123..4bb27fa6d36 100644 --- a/application/src/test/java/org/opentripplanner/framework/geometry/WgsCoordinateTest.java +++ b/application/src/test/java/org/opentripplanner/framework/geometry/WgsCoordinateTest.java @@ -5,6 +5,7 @@ import static org.junit.jupiter.api.Assertions.assertSame; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.opentripplanner.framework.geometry.WgsCoordinate.GREENWICH; import java.util.List; import org.junit.jupiter.api.Test; @@ -101,8 +102,8 @@ void add() { @Test void testGreenwich() { - assertEquals(51.48d, WgsCoordinate.GREENWICH.latitude()); - assertEquals(0d, WgsCoordinate.GREENWICH.longitude()); + assertEquals(51.48d, GREENWICH.latitude()); + assertEquals(0d, GREENWICH.longitude()); } @Test @@ -120,4 +121,9 @@ void roundingTo100m() { assertEquals(10, rounded.longitude()); assertEquals(53.557, rounded.latitude()); } + + @Test + void testDistanceTo() { + assertEquals(131_394, (int) GREENWICH.distanceTo(GREENWICH.add(-1.0, 1.0))); + } } From e416a175d897be05961697b2985359db6996fa88 Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Mon, 21 Oct 2024 12:34:50 +0200 Subject: [PATCH 036/110] feature: Add sandbox feature Sorlandsbanen. --- .../sorlandsbanen/CoachCostCalculator.java | 79 ++++++++++++++ .../EnturSorlandsbanenService.java | 103 ++++++++++++++++++ .../ext/sorlandsbanen/MergePaths.java | 52 +++++++++ .../ext/sorlandsbanen/PathKey.java | 58 ++++++++++ .../configure/EnturSorlandsbanenModule.java | 17 +++ .../framework/application/OTPFeature.java | 5 + .../raptoradapter/router/TransitRouter.java | 24 +++- .../RaptorRoutingRequestTransitData.java | 17 +++ .../api/OtpServerRequestContext.java | 18 ++- .../ConstructApplicationFactory.java | 6 + .../configure/ConstructApplicationModule.java | 3 + .../server/DefaultServerRequestContext.java | 20 +++- .../opentripplanner/TestServerContext.java | 1 + .../mapping/TripRequestMapperTest.java | 1 + .../transit/speed_test/SpeedTest.java | 1 + doc/user/Configuration.md | 1 + doc/user/sandbox/Sorlandsbanen.md | 44 ++++++++ mkdocs.yml | 1 + 18 files changed, 441 insertions(+), 10 deletions(-) create mode 100644 application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/CoachCostCalculator.java create mode 100644 application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/EnturSorlandsbanenService.java create mode 100644 application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/MergePaths.java create mode 100644 application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/PathKey.java create mode 100644 application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/configure/EnturSorlandsbanenModule.java create mode 100644 doc/user/sandbox/Sorlandsbanen.md diff --git a/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/CoachCostCalculator.java b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/CoachCostCalculator.java new file mode 100644 index 00000000000..b7ce446d430 --- /dev/null +++ b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/CoachCostCalculator.java @@ -0,0 +1,79 @@ +package org.opentripplanner.ext.sorlandsbanen; + +import org.opentripplanner.raptor.api.model.RaptorAccessEgress; +import org.opentripplanner.raptor.api.model.RaptorTransferConstraint; +import org.opentripplanner.raptor.spi.RaptorCostCalculator; +import org.opentripplanner.routing.algorithm.raptoradapter.transit.TripSchedule; +import org.opentripplanner.routing.algorithm.raptoradapter.transit.cost.RaptorCostConverter; +import org.opentripplanner.transit.model.basic.TransitMode; + + +/** + * This cost calculator increases the cost on mode coach by adding an extra reluctance. The + * reluctance is hardcoded in this class and cannot be configured. + */ +class CoachCostCalculator implements RaptorCostCalculator { + + private static final int EXTRA_RELUCTANCE_ON_COACH = RaptorCostConverter.toRaptorCost(0.6); + + private final RaptorCostCalculator delegate; + + CoachCostCalculator(RaptorCostCalculator delegate) { + this.delegate = delegate; + } + + @Override + public int boardingCost( + boolean firstBoarding, + int prevArrivalTime, + int boardStop, + int boardTime, + T trip, + RaptorTransferConstraint transferConstraints + ) { + return delegate.boardingCost( + firstBoarding, + prevArrivalTime, + boardStop, + boardTime, + trip, + transferConstraints + ); + } + + @Override + public int onTripRelativeRidingCost(int boardTime, T tripScheduledBoarded) { + return delegate.onTripRelativeRidingCost(boardTime, tripScheduledBoarded); + } + + @Override + public int transitArrivalCost( + int boardCost, + int alightSlack, + int transitTime, + T trip, + int toStop + ) { + int cost = delegate.transitArrivalCost(boardCost, alightSlack, transitTime, trip, toStop); + if(trip.transitReluctanceFactorIndex() == TransitMode.COACH.ordinal()) { + cost += transitTime * EXTRA_RELUCTANCE_ON_COACH; + } + return cost; + } + + @Override + public int waitCost(int waitTimeInSeconds) { + return delegate.waitCost(waitTimeInSeconds); + } + + @Override + public int calculateRemainingMinCost(int minTravelTime, int minNumTransfers, int fromStop) { + return delegate.calculateRemainingMinCost(minTravelTime, minNumTransfers, fromStop); + } + + @Override + public int costEgress(RaptorAccessEgress egress) { + return delegate.costEgress(egress); + } + +} diff --git a/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/EnturSorlandsbanenService.java b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/EnturSorlandsbanenService.java new file mode 100644 index 00000000000..a973617f257 --- /dev/null +++ b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/EnturSorlandsbanenService.java @@ -0,0 +1,103 @@ +package org.opentripplanner.ext.sorlandsbanen; + +import java.util.Collection; +import java.util.function.BiFunction; +import org.opentripplanner.framework.geometry.WgsCoordinate; +import org.opentripplanner.model.GenericLocation; +import org.opentripplanner.raptor.api.path.RaptorPath; +import org.opentripplanner.raptor.spi.ExtraMcRouterSearch; +import org.opentripplanner.raptor.spi.RaptorTransitDataProvider; +import org.opentripplanner.routing.algorithm.raptoradapter.router.street.AccessEgresses; +import org.opentripplanner.routing.algorithm.raptoradapter.transit.RoutingAccessEgress; +import org.opentripplanner.routing.algorithm.raptoradapter.transit.TransitLayer; +import org.opentripplanner.routing.algorithm.raptoradapter.transit.TripSchedule; +import org.opentripplanner.routing.algorithm.raptoradapter.transit.request.RaptorRoutingRequestTransitData; +import org.opentripplanner.routing.api.request.RouteRequest; +import org.opentripplanner.transit.model.framework.FeedScopedId; +import org.opentripplanner.transit.model.site.StopLocation; + +/** + * This is basically a big hack to produce results containing "Sørlandsbanen" in Norway. This + * railroad line is slow and goes inland fare from where people live. Despite this, people and the + * operator want to show it in the results for log travel along the southern part of Norway where + * ii is an option. Tuning the search has proven to be challenging. It is solved here by doing + * two searches. One normal search and one where the rail is given a big cost advantage over coach. + * If train results are found in the second search, then it is added to the results of the first + * search. Everything found in the first search is always returned. + */ +public class EnturSorlandsbanenService { + + private static final double SOUTH_BOARDER_LIMIT = 59.1; + private static final int MIN_DISTANCE_LIMIT = 120_000; + + + public ExtraMcRouterSearch createMcRouterFactory(RouteRequest request, AccessEgresses accessEgresses, TransitLayer transitLayer) { + WgsCoordinate from = findStopCoordinate( + request.from(), + accessEgresses.getAccesses(), + transitLayer + ); + WgsCoordinate to = findStopCoordinate(request.to(), accessEgresses.getEgresses(), transitLayer); + + if (from.latitude() > SOUTH_BOARDER_LIMIT && to.latitude() > SOUTH_BOARDER_LIMIT) { + return null; + } + + double distance = from.distanceTo(to); + if (distance < MIN_DISTANCE_LIMIT) { + return null; + } + + return new ExtraMcRouterSearch<>() { + @Override + public RaptorTransitDataProvider createTransitDataAlternativeSearch(RaptorTransitDataProvider transitDataMainSearch) { + return new RaptorRoutingRequestTransitData( + (RaptorRoutingRequestTransitData)transitDataMainSearch, + new CoachCostCalculator<>(transitDataMainSearch.multiCriteriaCostCalculator()) + ); + } + + @Override + public BiFunction>, Collection>, Collection>> merger() { + return new MergePaths<>(); + } + }; + } + + /** + * Find a coordinate matching the given location, in order: + * - First return the coordinate of the location if it exists. + * - Then loop through the access/egress stops and try to find the + * stop or station given by the location id, return the stop/station coordinate. + * - Return the fist stop in the access/egress list coordinate. + */ + @SuppressWarnings("ConstantConditions") + private static WgsCoordinate findStopCoordinate( + GenericLocation location, + Collection accessEgress, + TransitLayer transitLayer + ) { + if (location.lat != null) { + return new WgsCoordinate(location.lat, location.lng); + } + + StopLocation firstStop = null; + for (RoutingAccessEgress it : accessEgress) { + StopLocation stop = transitLayer.getStopByIndex(it.stop()); + if (stop.getId().equals(location.stopId)) { + return stop.getCoordinate(); + } + if (idIsParentStation(stop, location.stopId)) { + return stop.getParentStation().getCoordinate(); + } + if (firstStop == null) { + firstStop = stop; + } + } + return firstStop.getCoordinate(); + } + + private static boolean idIsParentStation(StopLocation stop, FeedScopedId pId) { + return stop.getParentStation() != null && stop.getParentStation().getId().equals(pId); + } +} diff --git a/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/MergePaths.java b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/MergePaths.java new file mode 100644 index 00000000000..b5f94019b72 --- /dev/null +++ b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/MergePaths.java @@ -0,0 +1,52 @@ +package org.opentripplanner.ext.sorlandsbanen; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import java.util.function.BiFunction; +import org.opentripplanner.raptor.api.model.RaptorTripSchedule; +import org.opentripplanner.raptor.api.path.PathLeg; +import org.opentripplanner.raptor.api.path.RaptorPath; +import org.opentripplanner.routing.algorithm.raptoradapter.transit.request.TripScheduleWithOffset; +import org.opentripplanner.transit.model.basic.TransitMode; + +/** + * Strategy for merging the main results and the extra rail results from Sorlandsbanen. + * Everything from the main result is kept, and any additional rail results from the alternative + * search are added. + */ +class MergePaths implements BiFunction>, Collection>, Collection>> { + + @Override + public Collection> apply(Collection> main, Collection> railAlternatives) { + Map> result = new HashMap<>(); + addAllToMap(result, main); + addRailToMap(result, railAlternatives); + return result.values(); + } + + private void addAllToMap(Map> map, Collection> paths) { + for (var it : paths) { + map.put(new PathKey(it), it); + } + } + + private void addRailToMap(Map> map, Collection> paths) { + for (var it : paths) { + if (hasRail(it)) { + map.put(new PathKey(it), it); + } + } + } + + private static boolean hasRail(RaptorPath path) { + return path + .legStream() + .filter(PathLeg::isTransitLeg) + .anyMatch(leg -> { + var trip = (TripScheduleWithOffset) leg.asTransitLeg().trip(); + var mode = trip.getOriginalTripPattern().getMode(); + return mode == TransitMode.RAIL; + }); + } +} diff --git a/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/PathKey.java b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/PathKey.java new file mode 100644 index 00000000000..28c1b1eac25 --- /dev/null +++ b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/PathKey.java @@ -0,0 +1,58 @@ +package org.opentripplanner.ext.sorlandsbanen; + +import org.opentripplanner.raptor.api.path.PathLeg; +import org.opentripplanner.raptor.api.path.RaptorPath; + + +/** + * Uses a hash to create a key for access, egress and transit legs in a path. Transfers + * are not included. The key is used to exclude duplicates. This approach may drop valid results + * when there is a hash collision, but this whole sandbox feature is a hack - so we can tolerate + * this here. + */ +final class PathKey { + + private final int hash; + + PathKey(RaptorPath path) { + this.hash = hash(path); + } + + private static int hash(RaptorPath path) { + if (path == null) { + return 0; + } + int result = 1; + + PathLeg leg = path.accessLeg(); + + while (!leg.isEgressLeg()) { + result = 31 * result + leg.toStop(); + result = 31 * result + leg.toTime(); + + if (leg.isTransitLeg()) { + result = 31 * result + leg.asTransitLeg().trip().pattern().debugInfo().hashCode(); + } + leg = leg.nextLeg(); + } + result = 31 * result + leg.toTime(); + + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o.getClass() != PathKey.class) { + return false; + } + return hash == ((PathKey) o).hash; + } + + @Override + public int hashCode() { + return hash; + } +} diff --git a/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/configure/EnturSorlandsbanenModule.java b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/configure/EnturSorlandsbanenModule.java new file mode 100644 index 00000000000..b1208f2c68b --- /dev/null +++ b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/configure/EnturSorlandsbanenModule.java @@ -0,0 +1,17 @@ +package org.opentripplanner.ext.sorlandsbanen.configure; + +import dagger.Module; +import dagger.Provides; +import javax.annotation.Nullable; +import org.opentripplanner.ext.sorlandsbanen.EnturSorlandsbanenService; +import org.opentripplanner.framework.application.OTPFeature; + +@Module +public class EnturSorlandsbanenModule { + + @Provides + @Nullable + EnturSorlandsbanenService providesEnturSorlandsbanenService() { + return OTPFeature.Sorlandsbanen.isOn() ? new EnturSorlandsbanenService() : null; + } +} diff --git a/application/src/main/java/org/opentripplanner/framework/application/OTPFeature.java b/application/src/main/java/org/opentripplanner/framework/application/OTPFeature.java index 324f5397673..c4cb86ebfb9 100644 --- a/application/src/main/java/org/opentripplanner/framework/application/OTPFeature.java +++ b/application/src/main/java/org/opentripplanner/framework/application/OTPFeature.java @@ -118,6 +118,11 @@ public enum OTPFeature { SandboxAPIGeocoder(false, true, "Enable the Geocoder API."), SandboxAPIMapboxVectorTilesApi(false, true, "Enable Mapbox vector tiles API."), SandboxAPIParkAndRideApi(false, true, "Enable park-and-ride endpoint."), + Sorlandsbanen( + false, + true, + "Include train Sørlandsbanen in results when searchig in south of Norway. Only relevant in Norway." + ), TransferAnalyzer(false, true, "Analyze transfers during graph build."); private static final Object TEST_LOCK = new Object(); diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/TransitRouter.java b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/TransitRouter.java index e72d8ee1427..d6c03c4d773 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/TransitRouter.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/TransitRouter.java @@ -12,12 +12,14 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionException; import java.util.stream.IntStream; +import javax.annotation.Nullable; import org.opentripplanner.ext.ridehailing.RideHailingAccessShifter; import org.opentripplanner.framework.application.OTPFeature; import org.opentripplanner.model.plan.Itinerary; import org.opentripplanner.raptor.RaptorService; import org.opentripplanner.raptor.api.path.RaptorPath; import org.opentripplanner.raptor.api.response.RaptorResponse; +import org.opentripplanner.raptor.spi.ExtraMcRouterSearch; import org.opentripplanner.routing.algorithm.mapping.RaptorPathToItineraryMapper; import org.opentripplanner.routing.algorithm.raptoradapter.router.street.AccessEgressPenaltyDecorator; import org.opentripplanner.routing.algorithm.raptoradapter.router.street.AccessEgressRouter; @@ -142,7 +144,10 @@ private TransitRouterResult route() { ); // Route transit - var raptorService = new RaptorService<>(serverContext.raptorConfig()); + var raptorService = new RaptorService<>( + serverContext.raptorConfig(), + createMcRouterFactory(accessEgresses, transitLayer) + ); var transitResponse = raptorService.route(raptorRequest, requestTransitDataProvider); checkIfTransitConnectionExists(transitResponse); @@ -387,4 +392,21 @@ private IntStream listStopIndexes(FeedScopedId stopLocationId) { } return stops.stream().mapToInt(StopLocation::getIndex); } + + /** + * An optional factory for creating a decorator around the multi-criteria RangeRaptor instance. + */ + @Nullable + private ExtraMcRouterSearch createMcRouterFactory( + AccessEgresses accessEgresses, + TransitLayer transitLayer + ) { + if (OTPFeature.Sorlandsbanen.isOff()) { + return null; + } + var service = serverContext.enturSorlandsbanenService(); + return service == null + ? null + : service.createMcRouterFactory(request, accessEgresses, transitLayer); + } } diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RaptorRoutingRequestTransitData.java b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RaptorRoutingRequestTransitData.java index 0182598ca35..f1b462e031a 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RaptorRoutingRequestTransitData.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RaptorRoutingRequestTransitData.java @@ -128,6 +128,23 @@ public RaptorRoutingRequestTransitData( ); } + public RaptorRoutingRequestTransitData( + RaptorRoutingRequestTransitData original, + RaptorCostCalculator newCostCalculator + ) { + this.transitLayer = original.transitLayer; + this.transitSearchTimeZero = original.transitSearchTimeZero; + this.activeTripPatternsPerStop = original.activeTripPatternsPerStop; + this.patternIndex = original.patternIndex; + this.transferIndex = original.transferIndex; + this.transferService = original.transferService; + this.constrainedTransfers = original.constrainedTransfers; + this.validTransitDataStartTime = original.validTransitDataStartTime; + this.validTransitDataEndTime = original.validTransitDataEndTime; + this.generalizedCostCalculator = newCostCalculator; + this.slackProvider = original.slackProvider(); + } + @Override public Iterator getTransfersFromStop(int stopIndex) { return transferIndex.getForwardTransfers(stopIndex).iterator(); diff --git a/application/src/main/java/org/opentripplanner/standalone/api/OtpServerRequestContext.java b/application/src/main/java/org/opentripplanner/standalone/api/OtpServerRequestContext.java index 7ec71e589c7..765262840ee 100644 --- a/application/src/main/java/org/opentripplanner/standalone/api/OtpServerRequestContext.java +++ b/application/src/main/java/org/opentripplanner/standalone/api/OtpServerRequestContext.java @@ -10,6 +10,7 @@ import org.opentripplanner.ext.flex.FlexParameters; import org.opentripplanner.ext.geocoder.LuceneIndex; import org.opentripplanner.ext.ridehailing.RideHailingService; +import org.opentripplanner.ext.sorlandsbanen.EnturSorlandsbanenService; import org.opentripplanner.ext.stopconsolidation.StopConsolidationService; import org.opentripplanner.framework.application.OTPFeature; import org.opentripplanner.inspector.raster.TileRendererManager; @@ -101,16 +102,10 @@ public interface OtpServerRequestContext { List rideHailingServices(); - @Nullable - StopConsolidationService stopConsolidationService(); - StreetLimitationParametersService streetLimitationParametersService(); MeterRegistry meterRegistry(); - @Nullable - EmissionsService emissionsService(); - /** Inspector/debug services */ TileRendererManager tileRendererManager(); @@ -129,6 +124,8 @@ default GraphFinder graphFinder() { VectorTileConfig vectorTileConfig(); + /* Sandbox modules */ + @Nullable default DataOverlayContext dataOverlayContext(RouteRequest request) { return OTPFeature.DataOverlay.isOnElseNull(() -> @@ -139,6 +136,15 @@ default DataOverlayContext dataOverlayContext(RouteRequest request) { ); } + @Nullable + EmissionsService emissionsService(); + @Nullable LuceneIndex lucenceIndex(); + + @Nullable + StopConsolidationService stopConsolidationService(); + + @Nullable + EnturSorlandsbanenService enturSorlandsbanenService(); } diff --git a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationFactory.java b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationFactory.java index b307776ef52..c76595a3eed 100644 --- a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationFactory.java +++ b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationFactory.java @@ -10,6 +10,8 @@ import org.opentripplanner.ext.geocoder.configure.GeocoderModule; import org.opentripplanner.ext.interactivelauncher.configuration.InteractiveLauncherModule; import org.opentripplanner.ext.ridehailing.configure.RideHailingServicesModule; +import org.opentripplanner.ext.sorlandsbanen.EnturSorlandsbanenService; +import org.opentripplanner.ext.sorlandsbanen.configure.EnturSorlandsbanenModule; import org.opentripplanner.ext.stopconsolidation.StopConsolidationRepository; import org.opentripplanner.ext.stopconsolidation.configure.StopConsolidationServiceModule; import org.opentripplanner.graph_builder.issue.api.DataImportIssueSummary; @@ -55,6 +57,7 @@ ConstructApplicationModule.class, RideHailingServicesModule.class, EmissionsServiceModule.class, + EnturSorlandsbanenModule.class, StopConsolidationServiceModule.class, InteractiveLauncherModule.class, StreetLimitationParametersServiceModule.class, @@ -90,6 +93,9 @@ public interface ConstructApplicationFactory { StreetLimitationParameters streetLimitationParameters(); + @Nullable + EnturSorlandsbanenService enturSorlandsbanenService(); + @Nullable LuceneIndex luceneIndex(); diff --git a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationModule.java b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationModule.java index 6c830054c49..75e2d0940a3 100644 --- a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationModule.java +++ b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationModule.java @@ -10,6 +10,7 @@ import org.opentripplanner.ext.geocoder.LuceneIndex; import org.opentripplanner.ext.interactivelauncher.api.LauncherRequestDecorator; import org.opentripplanner.ext.ridehailing.RideHailingService; +import org.opentripplanner.ext.sorlandsbanen.EnturSorlandsbanenService; import org.opentripplanner.ext.stopconsolidation.StopConsolidationService; import org.opentripplanner.raptor.configure.RaptorConfig; import org.opentripplanner.routing.algorithm.raptoradapter.transit.TripSchedule; @@ -41,6 +42,7 @@ OtpServerRequestContext providesServerContext( StreetLimitationParametersService streetLimitationParametersService, @Nullable TraverseVisitor traverseVisitor, EmissionsService emissionsService, + @Nullable EnturSorlandsbanenService enturSorlandsbanenService, LauncherRequestDecorator launcherRequestDecorator, @Nullable LuceneIndex luceneIndex ) { @@ -58,6 +60,7 @@ OtpServerRequestContext providesServerContext( realtimeVehicleService, vehicleRentalService, emissionsService, + enturSorlandsbanenService, routerConfig.flexParameters(), rideHailingServices, stopConsolidationService, diff --git a/application/src/main/java/org/opentripplanner/standalone/server/DefaultServerRequestContext.java b/application/src/main/java/org/opentripplanner/standalone/server/DefaultServerRequestContext.java index 0e81193d787..2c35dfe6263 100644 --- a/application/src/main/java/org/opentripplanner/standalone/server/DefaultServerRequestContext.java +++ b/application/src/main/java/org/opentripplanner/standalone/server/DefaultServerRequestContext.java @@ -9,6 +9,7 @@ import org.opentripplanner.ext.flex.FlexParameters; import org.opentripplanner.ext.geocoder.LuceneIndex; import org.opentripplanner.ext.ridehailing.RideHailingService; +import org.opentripplanner.ext.sorlandsbanen.EnturSorlandsbanenService; import org.opentripplanner.ext.stopconsolidation.StopConsolidationService; import org.opentripplanner.inspector.raster.TileRendererManager; import org.opentripplanner.raptor.api.request.RaptorTuningParameters; @@ -48,6 +49,10 @@ public class DefaultServerRequestContext implements OtpServerRequestContext { private final RealtimeVehicleService realtimeVehicleService; private final VehicleRentalService vehicleRentalService; private final EmissionsService emissionsService; + + @Nullable + private final EnturSorlandsbanenService enturSorlandsbanenService; + private final StopConsolidationService stopConsolidationService; private final StreetLimitationParametersService streetLimitationParametersService; private final LuceneIndex luceneIndex; @@ -67,12 +72,13 @@ private DefaultServerRequestContext( WorldEnvelopeService worldEnvelopeService, RealtimeVehicleService realtimeVehicleService, VehicleRentalService vehicleRentalService, - EmissionsService emissionsService, + @Nullable EmissionsService emissionsService, + @Nullable EnturSorlandsbanenService enturSorlandsbanenService, List rideHailingServices, - StopConsolidationService stopConsolidationService, + @Nullable StopConsolidationService stopConsolidationService, StreetLimitationParametersService streetLimitationParametersService, FlexParameters flexParameters, - TraverseVisitor traverseVisitor, + @Nullable TraverseVisitor traverseVisitor, @Nullable LuceneIndex luceneIndex ) { this.graph = graph; @@ -90,6 +96,7 @@ private DefaultServerRequestContext( this.realtimeVehicleService = realtimeVehicleService; this.rideHailingServices = rideHailingServices; this.emissionsService = emissionsService; + this.enturSorlandsbanenService = enturSorlandsbanenService; this.stopConsolidationService = stopConsolidationService; this.streetLimitationParametersService = streetLimitationParametersService; this.luceneIndex = luceneIndex; @@ -110,6 +117,7 @@ public static DefaultServerRequestContext create( RealtimeVehicleService realtimeVehicleService, VehicleRentalService vehicleRentalService, @Nullable EmissionsService emissionsService, + @Nullable EnturSorlandsbanenService enturSorlandsbanenService, FlexParameters flexParameters, List rideHailingServices, @Nullable StopConsolidationService stopConsolidationService, @@ -130,6 +138,7 @@ public static DefaultServerRequestContext create( realtimeVehicleService, vehicleRentalService, emissionsService, + enturSorlandsbanenService, rideHailingServices, stopConsolidationService, streetLimitationParametersService, @@ -251,4 +260,9 @@ public LuceneIndex lucenceIndex() { public EmissionsService emissionsService() { return emissionsService; } + + @Nullable + public EnturSorlandsbanenService enturSorlandsbanenService() { + return enturSorlandsbanenService; + } } diff --git a/application/src/test/java/org/opentripplanner/TestServerContext.java b/application/src/test/java/org/opentripplanner/TestServerContext.java index 90dca6ff840..b403e9432fe 100644 --- a/application/src/test/java/org/opentripplanner/TestServerContext.java +++ b/application/src/test/java/org/opentripplanner/TestServerContext.java @@ -51,6 +51,7 @@ public static OtpServerRequestContext createServerContext( createRealtimeVehicleService(transitService), createVehicleRentalService(), createEmissionsService(), + null, routerConfig.flexParameters(), List.of(), null, diff --git a/application/src/test/java/org/opentripplanner/apis/transmodel/mapping/TripRequestMapperTest.java b/application/src/test/java/org/opentripplanner/apis/transmodel/mapping/TripRequestMapperTest.java index 38a411ac1cf..d71a11aad68 100644 --- a/application/src/test/java/org/opentripplanner/apis/transmodel/mapping/TripRequestMapperTest.java +++ b/application/src/test/java/org/opentripplanner/apis/transmodel/mapping/TripRequestMapperTest.java @@ -141,6 +141,7 @@ void setup() { new DefaultRealtimeVehicleService(transitService), new DefaultVehicleRentalService(), new DefaultEmissionsService(new EmissionsDataModel()), + null, RouterConfig.DEFAULT.flexParameters(), List.of(), null, diff --git a/application/src/test/java/org/opentripplanner/transit/speed_test/SpeedTest.java b/application/src/test/java/org/opentripplanner/transit/speed_test/SpeedTest.java index 85a33281f81..087843644b1 100644 --- a/application/src/test/java/org/opentripplanner/transit/speed_test/SpeedTest.java +++ b/application/src/test/java/org/opentripplanner/transit/speed_test/SpeedTest.java @@ -117,6 +117,7 @@ public SpeedTest( TestServerContext.createRealtimeVehicleService(transitService), TestServerContext.createVehicleRentalService(), TestServerContext.createEmissionsService(), + null, config.flexConfig, List.of(), null, diff --git a/doc/user/Configuration.md b/doc/user/Configuration.md index bca974f8617..a45e4253a06 100644 --- a/doc/user/Configuration.md +++ b/doc/user/Configuration.md @@ -250,6 +250,7 @@ Here is a list of all features which can be toggled on/off and their default val | `SandboxAPIGeocoder` | Enable the Geocoder API. | | ✓️ | | `SandboxAPIMapboxVectorTilesApi` | Enable Mapbox vector tiles API. | | ✓️ | | `SandboxAPIParkAndRideApi` | Enable park-and-ride endpoint. | | ✓️ | +| `Sorlandsbanen` | Include train Sørlandsbanen in results when searchig in south of Norway. Only relevant in Norway. | | ✓️ | | `TransferAnalyzer` | Analyze transfers during graph build. | | ✓️ | diff --git a/doc/user/sandbox/Sorlandsbanen.md b/doc/user/sandbox/Sorlandsbanen.md new file mode 100644 index 00000000000..4898a29af37 --- /dev/null +++ b/doc/user/sandbox/Sorlandsbanen.md @@ -0,0 +1,44 @@ +# Sørlandsbanen - The southern railroad in Norway + +**This sandbox module is only working in Norway**, in particular only in the south of Norway. The +feature flag to turn it *on* should only be enabled if you are routing using the norwegian data set. + +The railroad in southern Norway is very slow and does not go by the cost where most people live. It +is easily beaten by coaches in the area. Despite this, we need to include it in results where it is +relevant. + +When the feature flag is enabled, two Raptor searches are performed. The first is the regular +search - unmodified, as requested by the user. The second search is modified to include train +results with Sørlandsbanen. This is achieved by setting a high COACH reluctance. We then take any +rail results(if they exist) from the second search and add it two to the results from the first +search. The new set of results will contain everything we found in the first search, plus the train +results in the second results. + +Note! This is a hack and the logic to enable this look at the origin and destination coordinates +in addition to the feature flag. + + +## Contact Info + +- Entur, Norway + +## Changelog + +- 2024-10-14: We have used this feature for som time, but now want it in the Sandbox so we do not + need to merge it everytime we create a new entur release. + + +### Configuration + +This is turned _off_ by default. To turn it on enable the `Sorlandsbanen` feature. + +```json +// otp-config.json +{ + "otpFeatures": { + "Sorlandsbanen": true + } +} +``` + + diff --git a/mkdocs.yml b/mkdocs.yml index 1364be7be1f..7d1c25bd45d 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -122,3 +122,4 @@ nav: - Ride Hailing: 'sandbox/RideHailing.md' - Emissions: 'sandbox/Emissions.md' - Stop Consolidation: 'sandbox/StopConsolidation.md' + - Sørlandsbanen: 'sandbox/Sorlandsbanen.md' From 1460c114fa19b4b1625b086a9158ce558d3791f1 Mon Sep 17 00:00:00 2001 From: Teemu Kalvas Date: Mon, 21 Oct 2024 14:41:47 +0300 Subject: [PATCH 037/110] Remove branding url from Agency and ApiLeg --- .../ext/restapi/mapping/AgencyMapper.java | 1 - .../opentripplanner/ext/restapi/mapping/LegMapper.java | 1 - .../opentripplanner/ext/restapi/model/ApiAgency.java | 1 - .../org/opentripplanner/ext/restapi/model/ApiLeg.java | 2 -- .../org/opentripplanner/gtfs/mapping/AgencyMapper.java | 1 - .../transit/model/organization/Agency.java | 10 +--------- .../transit/model/organization/AgencyBuilder.java | 10 ---------- .../opentripplanner/gtfs/mapping/AgencyMapperTest.java | 4 ---- .../netex/NetexEpipBundleSmokeTest.java | 1 - .../netex/NetexNordicBundleSmokeTest.java | 1 - .../transit/model/organization/AgencyTest.java | 4 ---- 11 files changed, 1 insertion(+), 35 deletions(-) diff --git a/application/src/ext/java/org/opentripplanner/ext/restapi/mapping/AgencyMapper.java b/application/src/ext/java/org/opentripplanner/ext/restapi/mapping/AgencyMapper.java index 4ea3ebb5209..5a86968153a 100644 --- a/application/src/ext/java/org/opentripplanner/ext/restapi/mapping/AgencyMapper.java +++ b/application/src/ext/java/org/opentripplanner/ext/restapi/mapping/AgencyMapper.java @@ -28,7 +28,6 @@ public static ApiAgency mapToApi(Agency domain) { api.lang = domain.getLang(); api.phone = domain.getPhone(); api.fareUrl = domain.getFareUrl(); - api.brandingUrl = domain.getBrandingUrl(); return api; } diff --git a/application/src/ext/java/org/opentripplanner/ext/restapi/mapping/LegMapper.java b/application/src/ext/java/org/opentripplanner/ext/restapi/mapping/LegMapper.java index b642426cd6d..ce9ceeb7f46 100644 --- a/application/src/ext/java/org/opentripplanner/ext/restapi/mapping/LegMapper.java +++ b/application/src/ext/java/org/opentripplanner/ext/restapi/mapping/LegMapper.java @@ -100,7 +100,6 @@ public ApiLeg mapLeg( api.agencyId = FeedScopedIdMapper.mapToApi(agency.getId()); api.agencyName = agency.getName(); api.agencyUrl = agency.getUrl(); - api.agencyBrandingUrl = agency.getBrandingUrl(); api.mode = ModeMapper.mapToApi(trLeg.getMode()); var route = domain.getRoute(); diff --git a/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiAgency.java b/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiAgency.java index ada6739a795..d1c15b7f6f6 100644 --- a/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiAgency.java +++ b/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiAgency.java @@ -12,7 +12,6 @@ public class ApiAgency implements Serializable { public String lang; public String phone; public String fareUrl; - public String brandingUrl; @Override public int hashCode() { diff --git a/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiLeg.java b/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiLeg.java index 7bbd83f7c2d..b020df10a91 100644 --- a/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiLeg.java +++ b/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiLeg.java @@ -87,8 +87,6 @@ public class ApiLeg { public String agencyUrl; - public String agencyBrandingUrl; - public int agencyTimeZoneOffset; /** diff --git a/application/src/main/java/org/opentripplanner/gtfs/mapping/AgencyMapper.java b/application/src/main/java/org/opentripplanner/gtfs/mapping/AgencyMapper.java index f57a9db8684..e72b3ae584b 100644 --- a/application/src/main/java/org/opentripplanner/gtfs/mapping/AgencyMapper.java +++ b/application/src/main/java/org/opentripplanner/gtfs/mapping/AgencyMapper.java @@ -36,7 +36,6 @@ private Agency doMap(org.onebusaway.gtfs.model.Agency rhs) { .withLang(rhs.getLang()) .withPhone(rhs.getPhone()) .withFareUrl(rhs.getFareUrl()) - .withBrandingUrl(rhs.getBrandingUrl()) .build(); } } diff --git a/application/src/main/java/org/opentripplanner/transit/model/organization/Agency.java b/application/src/main/java/org/opentripplanner/transit/model/organization/Agency.java index 4d82ab05e57..0953f65559d 100644 --- a/application/src/main/java/org/opentripplanner/transit/model/organization/Agency.java +++ b/application/src/main/java/org/opentripplanner/transit/model/organization/Agency.java @@ -21,7 +21,6 @@ public final class Agency extends AbstractTransitEntity i private final String lang; private final String phone; private final String fareUrl; - private final String brandingUrl; Agency(AgencyBuilder builder) { super(builder.getId()); @@ -43,7 +42,6 @@ public final class Agency extends AbstractTransitEntity i this.lang = builder.getLang(); this.phone = builder.getPhone(); this.fareUrl = builder.getFareUrl(); - this.brandingUrl = builder.getBrandingUrl(); } public static AgencyBuilder of(FeedScopedId id) { @@ -78,11 +76,6 @@ public String getFareUrl() { return fareUrl; } - @Nullable - public String getBrandingUrl() { - return brandingUrl; - } - @Override public AgencyBuilder copy() { return new AgencyBuilder(this); @@ -102,8 +95,7 @@ public boolean sameAs(Agency other) { Objects.equals(url, other.url) && Objects.equals(lang, other.lang) && Objects.equals(phone, other.phone) && - Objects.equals(fareUrl, other.fareUrl) && - Objects.equals(brandingUrl, other.brandingUrl) + Objects.equals(fareUrl, other.fareUrl) ); } } diff --git a/application/src/main/java/org/opentripplanner/transit/model/organization/AgencyBuilder.java b/application/src/main/java/org/opentripplanner/transit/model/organization/AgencyBuilder.java index 3cf24523c5d..a0958b1d8a4 100644 --- a/application/src/main/java/org/opentripplanner/transit/model/organization/AgencyBuilder.java +++ b/application/src/main/java/org/opentripplanner/transit/model/organization/AgencyBuilder.java @@ -25,7 +25,6 @@ public class AgencyBuilder extends AbstractEntityBuilder this.lang = original.getLang(); this.phone = original.getPhone(); this.fareUrl = original.getFareUrl(); - this.brandingUrl = original.getBrandingUrl(); } public String getName() { @@ -82,15 +81,6 @@ public AgencyBuilder withFareUrl(String fareUrl) { return this; } - public String getBrandingUrl() { - return brandingUrl; - } - - public AgencyBuilder withBrandingUrl(String brandingUrl) { - this.brandingUrl = brandingUrl; - return this; - } - @Override protected Agency buildFromValues() { return new Agency(this); diff --git a/application/src/test/java/org/opentripplanner/gtfs/mapping/AgencyMapperTest.java b/application/src/test/java/org/opentripplanner/gtfs/mapping/AgencyMapperTest.java index e0390fee6b2..789b94991b0 100644 --- a/application/src/test/java/org/opentripplanner/gtfs/mapping/AgencyMapperTest.java +++ b/application/src/test/java/org/opentripplanner/gtfs/mapping/AgencyMapperTest.java @@ -31,7 +31,6 @@ public class AgencyMapperTest { private static final String FARE_URL = "www.url.com/fare"; - private static final String BRANDING_URL = "www.url.com/brand"; private final AgencyMapper subject = new AgencyMapper(TimetableRepositoryForTest.FEED_ID); static { @@ -42,7 +41,6 @@ public class AgencyMapperTest { AGENCY.setTimezone(TIMEZONE); AGENCY.setUrl(URL); AGENCY.setFareUrl(FARE_URL); - AGENCY.setBrandingUrl(BRANDING_URL); } @Test @@ -66,7 +64,6 @@ public void testMap() throws Exception { assertEquals(TIMEZONE, result.getTimezone().getId()); assertEquals(URL, result.getUrl()); assertEquals(FARE_URL, result.getFareUrl()); - assertEquals(BRANDING_URL, result.getBrandingUrl()); } @Test @@ -88,7 +85,6 @@ public void testMapWithNulls() throws Exception { assertNull(result.getLang()); assertNull(result.getPhone()); assertNull(result.getFareUrl()); - assertNull(result.getBrandingUrl()); } /** Mapping the same object twice, should return the the same instance. */ diff --git a/application/src/test/java/org/opentripplanner/netex/NetexEpipBundleSmokeTest.java b/application/src/test/java/org/opentripplanner/netex/NetexEpipBundleSmokeTest.java index 72e750c055f..c0214ad7998 100644 --- a/application/src/test/java/org/opentripplanner/netex/NetexEpipBundleSmokeTest.java +++ b/application/src/test/java/org/opentripplanner/netex/NetexEpipBundleSmokeTest.java @@ -92,7 +92,6 @@ private void assertAgencies(Collection agencies) { assertNull(a.getLang()); assertNull(a.getPhone()); assertNull(a.getFareUrl()); - assertNull(a.getBrandingUrl()); } private void assertOperators(Collection operators) { diff --git a/application/src/test/java/org/opentripplanner/netex/NetexNordicBundleSmokeTest.java b/application/src/test/java/org/opentripplanner/netex/NetexNordicBundleSmokeTest.java index 6b5e9b60098..4ddd07e814b 100644 --- a/application/src/test/java/org/opentripplanner/netex/NetexNordicBundleSmokeTest.java +++ b/application/src/test/java/org/opentripplanner/netex/NetexNordicBundleSmokeTest.java @@ -104,7 +104,6 @@ private void assertAgencies(Collection agencies) { assertNull(a.getLang()); assertNull(a.getPhone()); assertNull(a.getFareUrl()); - assertNull(a.getBrandingUrl()); } private void assertMultiModalStations(Collection multiModalStations) { diff --git a/application/src/test/java/org/opentripplanner/transit/model/organization/AgencyTest.java b/application/src/test/java/org/opentripplanner/transit/model/organization/AgencyTest.java index d5b0bff33a3..2eff9b5d112 100644 --- a/application/src/test/java/org/opentripplanner/transit/model/organization/AgencyTest.java +++ b/application/src/test/java/org/opentripplanner/transit/model/organization/AgencyTest.java @@ -12,7 +12,6 @@ class AgencyTest { private static final String ID = "1"; - private static final String BRANDING_URL = "http://branding.aaa.com"; private static final String NAME = "name"; private static final String URL = "http://info.aaa.com"; private static final String TIMEZONE = "Europe/Oslo"; @@ -26,7 +25,6 @@ class AgencyTest { .withUrl(URL) .withTimezone(TIMEZONE) .withPhone(PHONE) - .withBrandingUrl(BRANDING_URL) .withFareUrl(FARE_URL) .withLang(LANG) .build(); @@ -52,7 +50,6 @@ void copy() { assertEquals(URL, copy.getUrl()); assertEquals(TIMEZONE, copy.getTimezone().getId()); assertEquals(PHONE, copy.getPhone()); - assertEquals(BRANDING_URL, copy.getBrandingUrl()); assertEquals(FARE_URL, copy.getFareUrl()); assertEquals(LANG, copy.getLang()); } @@ -65,7 +62,6 @@ void sameAs() { assertFalse(subject.sameAs(subject.copy().withUrl("X").build())); assertFalse(subject.sameAs(subject.copy().withTimezone("CET").build())); assertFalse(subject.sameAs(subject.copy().withPhone("X").build())); - assertFalse(subject.sameAs(subject.copy().withBrandingUrl("X").build())); assertFalse(subject.sameAs(subject.copy().withFareUrl("X").build())); assertFalse(subject.sameAs(subject.copy().withLang("X").build())); } From d562a5261e9fe9eb92035d564e23f00196b37c31 Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Tue, 22 Oct 2024 00:30:48 +0200 Subject: [PATCH 038/110] Generate GTFS Realtime protobuf files in separate Maven module --- application/pom.xml | 8 ++++ gtfs-realtime-protobuf/pom.xml | 44 +++++++++++++++++++ .../src/main/proto/gtfs-realtime.proto | 0 .../main/proto/mfdz-realtime-extensions.proto | 0 pom.xml | 22 +--------- 5 files changed, 53 insertions(+), 21 deletions(-) create mode 100644 gtfs-realtime-protobuf/pom.xml rename {application => gtfs-realtime-protobuf}/src/main/proto/gtfs-realtime.proto (100%) rename {application => gtfs-realtime-protobuf}/src/main/proto/mfdz-realtime-extensions.proto (100%) diff --git a/application/pom.xml b/application/pom.xml index 49c738a251e..5a838ff85d8 100644 --- a/application/pom.xml +++ b/application/pom.xml @@ -12,6 +12,14 @@ OpenTripPlanner - Application + + + ${project.groupId} + gtfs-realtime-protobuf + ${project.version} + + + net.sf.trove4j trove4j diff --git a/gtfs-realtime-protobuf/pom.xml b/gtfs-realtime-protobuf/pom.xml new file mode 100644 index 00000000000..5d814e2ac42 --- /dev/null +++ b/gtfs-realtime-protobuf/pom.xml @@ -0,0 +1,44 @@ + + + 4.0.0 + + org.opentripplanner + otp-root + 2.7.0-SNAPSHOT + + gtfs-realtime-protobuf + OpenTripPlanner - GTFS Realtime (protobuf) + + + + com.google.protobuf + protobuf-java + + + + + + + org.xolstice.maven.plugins + protobuf-maven-plugin + 0.6.1 + + + + compile + test-compile + + + + + com.google.protobuf:protoc:3.22.0:exe:${os.detected.classifier} + + + + + \ No newline at end of file diff --git a/application/src/main/proto/gtfs-realtime.proto b/gtfs-realtime-protobuf/src/main/proto/gtfs-realtime.proto similarity index 100% rename from application/src/main/proto/gtfs-realtime.proto rename to gtfs-realtime-protobuf/src/main/proto/gtfs-realtime.proto diff --git a/application/src/main/proto/mfdz-realtime-extensions.proto b/gtfs-realtime-protobuf/src/main/proto/mfdz-realtime-extensions.proto similarity index 100% rename from application/src/main/proto/mfdz-realtime-extensions.proto rename to gtfs-realtime-protobuf/src/main/proto/mfdz-realtime-extensions.proto diff --git a/pom.xml b/pom.xml index 0b4dd2ea10c..247ddfe5a83 100644 --- a/pom.xml +++ b/pom.xml @@ -95,6 +95,7 @@ application + gtfs-realtime-protobuf @@ -357,27 +358,6 @@ - - - - org.xolstice.maven.plugins - protobuf-maven-plugin - 0.6.1 - - - - compile - test-compile - - - - - com.google.protobuf:protoc:3.22.0:exe:${os.detected.classifier} - - From d34f27face49aa33301b81d4e807cf9293dcd516 Mon Sep 17 00:00:00 2001 From: "Johan Torin (extern)" Date: Fri, 18 Oct 2024 08:07:29 +0000 Subject: [PATCH 039/110] Make the test itinerary instance non-static as it's modified in some tests. Specifically, an itinerary can be flagged for deletion in one test, which affects the assertions in the next test. Without this, tests may fail if they are executed in a certain order. This may be because LC_COLLATE is not set in the environment. --- .../filterchain/ItineraryListFilterChainTest.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/application/src/test/java/org/opentripplanner/routing/algorithm/filterchain/ItineraryListFilterChainTest.java b/application/src/test/java/org/opentripplanner/routing/algorithm/filterchain/ItineraryListFilterChainTest.java index 1cd19823f17..4ccb7ac9793 100644 --- a/application/src/test/java/org/opentripplanner/routing/algorithm/filterchain/ItineraryListFilterChainTest.java +++ b/application/src/test/java/org/opentripplanner/routing/algorithm/filterchain/ItineraryListFilterChainTest.java @@ -305,12 +305,12 @@ void testPostProcessorWithMaxItinerariesFilterSetToOneArriveBy() { @Nested class FlexSearchWindow { - private static final Itinerary FLEX = newItinerary(A, T11_00) + private final Itinerary flex = newItinerary(A, T11_00) .flex(T11_00, T11_30, B) .withIsSearchWindowAware(false) .build(); - private static final Instant EARLIEST_DEPARTURE = FLEX.startTime().plusMinutes(10).toInstant(); - private static final Duration SEARCH_WINDOW = Duration.ofHours(7); + private final Instant earliestDeparture = flex.startTime().plusMinutes(10).toInstant(); + private final Duration searchWindow = Duration.ofHours(7); /** * When the filtering of direct flex by the transit search window is deactivated, the direct @@ -320,18 +320,18 @@ class FlexSearchWindow { void keepDirectFlexWhenFilteringByEarliestDepartureIsDisabled() { ItineraryListFilterChain chain = createBuilder(true, false, 10) .withFilterDirectFlexBySearchWindow(false) - .withSearchWindow(EARLIEST_DEPARTURE, SEARCH_WINDOW) + .withSearchWindow(earliestDeparture, searchWindow) .build(); - assertEquals(toStr(List.of(FLEX)), toStr(chain.filter(List.of(FLEX)))); + assertEquals(toStr(List.of(flex)), toStr(chain.filter(List.of(flex)))); } @Test void removeDirectFlexWhenFilteringByEarliestDepartureIsEnabled() { ItineraryListFilterChain chain = createBuilder(true, false, 10) .withFilterDirectFlexBySearchWindow(true) - .withSearchWindow(EARLIEST_DEPARTURE, SEARCH_WINDOW) + .withSearchWindow(earliestDeparture, searchWindow) .build(); - assertEquals(toStr(List.of()), toStr(chain.filter(List.of(FLEX)))); + assertEquals(toStr(List.of()), toStr(chain.filter(List.of(flex)))); } } From cee960fc71fe22b1bd4fd8a28559883c18a25981 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 23 Oct 2024 02:02:20 +0000 Subject: [PATCH 040/110] Update Maven plugins --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 1ecfe27230b..2e9dea389fe 100644 --- a/pom.xml +++ b/pom.xml @@ -308,7 +308,7 @@ com.google.cloud.tools jib-maven-plugin - 3.4.3 + 3.4.4 org.opentripplanner.standalone.OTPMain @@ -564,7 +564,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.2.6 + 3.2.7 sign-artifacts From eca2528621f37738ab944b2227443b1b3fd0a2c0 Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Wed, 23 Oct 2024 11:07:32 +0200 Subject: [PATCH 041/110] Fix max search-window when paging The PagingService was initialized with the dynamic max-search-window value, and not the request max search-window. This commit also updates the Transmodel API doc. --- .../apis/transmodel/TransmodelAPI.java | 11 ++- .../transmodel/TransmodelGraphQLSchema.java | 20 ++++- .../apis/transmodel/model/plan/TripQuery.java | 79 ++++++++++++------- .../mapping/PagingServiceFactory.java | 4 +- .../routing/api/request/RouteRequest.java | 20 ++++- .../standalone/config/RouterConfig.java | 2 +- .../routerconfig/TransitRoutingConfig.java | 2 +- .../configure/ConstructApplication.java | 3 +- .../server/DefaultServerRequestContext.java | 9 ++- .../apis/transmodel/schema.graphql | 37 +++++++-- .../TransmodelGraphQLSchemaTest.java | 7 +- .../routing/core/RouteRequestTest.java | 2 +- 12 files changed, 147 insertions(+), 49 deletions(-) diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/TransmodelAPI.java b/application/src/main/java/org/opentripplanner/apis/transmodel/TransmodelAPI.java index 7d982e77885..fe73e8b9887 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/TransmodelAPI.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/TransmodelAPI.java @@ -22,6 +22,7 @@ import org.opentripplanner.apis.transmodel.mapping.TransitIdMapper; import org.opentripplanner.routing.api.request.RouteRequest; import org.opentripplanner.standalone.api.OtpServerRequestContext; +import org.opentripplanner.standalone.config.routerconfig.TransitRoutingConfig; import org.opentripplanner.transit.service.TimetableRepository; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -67,14 +68,20 @@ public TransmodelAPIOldPath( public static void setUp( TransmodelAPIParameters config, TimetableRepository timetableRepository, - RouteRequest defaultRouteRequest + RouteRequest defaultRouteRequest, + TransitRoutingConfig transitRoutingConfig ) { if (config.hideFeedId()) { TransitIdMapper.setupFixedFeedId(timetableRepository.getAgencies()); } tracingHeaderTags = config.tracingHeaderTags(); maxNumberOfResultFields = config.maxNumberOfResultFields(); - schema = TransmodelGraphQLSchema.create(defaultRouteRequest, timetableRepository.getTimeZone()); + schema = + TransmodelGraphQLSchema.create( + defaultRouteRequest, + timetableRepository.getTimeZone(), + transitRoutingConfig + ); } @POST diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/TransmodelGraphQLSchema.java b/application/src/main/java/org/opentripplanner/apis/transmodel/TransmodelGraphQLSchema.java index 5a9fa4cfb59..2ffb9941bc6 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/TransmodelGraphQLSchema.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/TransmodelGraphQLSchema.java @@ -107,6 +107,7 @@ import org.opentripplanner.model.plan.legreference.LegReference; import org.opentripplanner.model.plan.legreference.LegReferenceSerializer; import org.opentripplanner.routing.alertpatch.TransitAlert; +import org.opentripplanner.routing.algorithm.raptoradapter.transit.TransitTuningParameters; import org.opentripplanner.routing.api.request.RouteRequest; import org.opentripplanner.routing.error.RoutingValidationException; import org.opentripplanner.routing.graphfinder.NearbyStop; @@ -133,17 +134,29 @@ public class TransmodelGraphQLSchema { private final DefaultRouteRequestType routing; + private final TransitTuningParameters transitTuningParameters; + private final ZoneId timeZoneId; private final Relay relay = new Relay(); - private TransmodelGraphQLSchema(RouteRequest defaultRequest, ZoneId timeZoneId) { + private TransmodelGraphQLSchema( + RouteRequest defaultRequest, + ZoneId timeZoneId, + TransitTuningParameters transitTuningParameters + ) { this.timeZoneId = timeZoneId; this.routing = new DefaultRouteRequestType(defaultRequest); + this.transitTuningParameters = transitTuningParameters; } - public static GraphQLSchema create(RouteRequest defaultRequest, ZoneId timeZoneId) { - return new TransmodelGraphQLSchema(defaultRequest, timeZoneId).create(); + public static GraphQLSchema create( + RouteRequest defaultRequest, + ZoneId timeZoneId, + TransitTuningParameters transitTuningParameters + ) { + return new TransmodelGraphQLSchema(defaultRequest, timeZoneId, transitTuningParameters) + .create(); } @SuppressWarnings("unchecked") @@ -340,6 +353,7 @@ private GraphQLSchema create() { GraphQLFieldDefinition tripQuery = TripQuery.create( routing, + transitTuningParameters, tripType, durationPerStreetModeInput, penaltyForStreetMode, diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/model/plan/TripQuery.java b/application/src/main/java/org/opentripplanner/apis/transmodel/model/plan/TripQuery.java index 5b1bbd84373..c46b8b36082 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/model/plan/TripQuery.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/model/plan/TripQuery.java @@ -12,6 +12,7 @@ import graphql.schema.GraphQLNonNull; import graphql.schema.GraphQLOutputType; import graphql.schema.GraphQLScalarType; +import java.time.Duration; import org.opentripplanner.apis.transmodel.TransmodelGraphQLPlanner; import org.opentripplanner.apis.transmodel.model.DefaultRouteRequestType; import org.opentripplanner.apis.transmodel.model.EnumTypes; @@ -20,6 +21,7 @@ import org.opentripplanner.apis.transmodel.model.framework.PassThroughPointInputType; import org.opentripplanner.apis.transmodel.model.framework.PenaltyForStreetModeType; import org.opentripplanner.apis.transmodel.model.framework.TransmodelDirectives; +import org.opentripplanner.routing.algorithm.raptoradapter.transit.TransitTuningParameters; import org.opentripplanner.routing.api.request.preference.RoutingPreferences; import org.opentripplanner.routing.core.VehicleRoutingOptimizeType; @@ -37,6 +39,7 @@ public class TripQuery { public static GraphQLFieldDefinition create( DefaultRouteRequestType routing, + TransitTuningParameters transitTuningParameters, GraphQLOutputType tripType, GraphQLInputObjectType durationPerStreetModeType, GraphQLInputObjectType penaltyForStreetMode, @@ -87,30 +90,42 @@ Normally this is when the search is performed (now), plus a small grace period t .newArgument() .name("searchWindow") .description( - "The length of the search-window in minutes. This parameter is optional." + - "\n\n" + - "The search-window is defined as the duration between the earliest-departure-time(EDT) and " + - "the latest-departure-time(LDT). OTP will search for all itineraries in this departure " + - "window. If `arriveBy=true` the `dateTime` parameter is the latest-arrival-time, so OTP " + - "will dynamically calculate the EDT. Using a short search-window is faster than using a " + - "longer one, but the search duration is not linear. Using a \"too\" short search-window will " + - "waste resources server side, while using a search-window that is too long will be slow." + - "\n\n" + - "OTP will dynamically calculate a reasonable value for the search-window, if not provided. The " + - "calculation comes with a significant overhead (10-20% extra). Whether you should use the " + - "dynamic calculated value or pass in a value depends on your use-case. For a travel planner " + - "in a small geographical area, with a dense network of public transportation, a fixed value " + - "between 40 minutes and 2 hours makes sense. To find the appropriate search-window, adjust it " + - "so that the number of itineraries on average is around the wanted `numItineraries`. Make " + - "sure you set the `numItineraries` to a high number while testing. For a country wide area like " + - "Norway, using the dynamic search-window is the best." + - "\n\n" + - "When paginating, the search-window is calculated using the `numItineraries` in the original " + - "search together with statistics from the search for the last page. This behaviour is " + - "configured server side, and can not be overridden from the client." + - "\n\n" + - "The search-window used is returned to the response metadata as `searchWindowUsed` for " + - "debugging purposes." + """ + The length of the search-window in minutes. This parameter is optional. + + The search-window is defined as the duration between the earliest-departure-time(EDT) and + the latest-departure-time(LDT). OTP will search for all itineraries in this departure + window. If `arriveBy=true` the `dateTime` parameter is the latest-arrival-time, so OTP + will dynamically calculate the EDT. Using a short search-window is faster than using a + longer one, but the search duration is not linear. Using a \"too\" short search-window will + waste resources server side, while using a search-window that is too long will be slow. + + OTP will dynamically calculate a reasonable value for the search-window, if not provided. The + calculation comes with a significant overhead (10-20% extra). Whether you should use the + dynamic calculated value or pass in a value depends on your use-case. For a travel planner + in a small geographical area, with a dense network of public transportation, a fixed value + between 40 minutes and 2 hours makes sense. To find the appropriate search-window, adjust it + so that the number of itineraries on average is around the wanted `numTripPatterns`. Make + sure you set the `numTripPatterns` to a high number while testing. For a country wide area like + Norway, using the dynamic search-window is the best. + + When paginating, the search-window is calculated using the `numTripPatterns` in the original + search together with statistics from the search for the last page. This behaviour is + configured server side, and can not be overridden from the client. The paging may even + exceed the maximum value. + + The search-window used is returned to the response metadata as `searchWindowUsed`. + This can be used by the client to calculate the when the next page start/end. + + Note! In some cases you may have to page many times to get all the results you want. + This is intended. Increasing the search-window beyond the max value is NOT going to be + much faster. Instead the client can inform the user about the progress. + + Maximum value: {max-search-window} + """.replace( + "{max-search-window}", + durationInMinutesToString(transitTuningParameters.maxSearchWindow()) + ) ) .type(Scalars.GraphQLInt) .build() @@ -120,9 +135,12 @@ Normally this is when the search is performed (now), plus a small grace period t .newArgument() .name("pageCursor") .description( - "Use the cursor to go to the next \"page\" of itineraries. Copy the cursor from " + - "the last response and keep the original request as is. This will enable you to " + - "search for itineraries in the next or previous time-window." + """ + Use the cursor to go to the next \"page\" of itineraries. Copy the cursor from the last + response and keep the original request as is. This will enable you to search for + itineraries in the next or previous search-window. The paging will automatically scale + up/down the search-window to fit the `numTripPatterns`. + """ ) .type(Scalars.GraphQLString) .build() @@ -646,4 +664,11 @@ private static String enumValAsString(GraphQLEnumType enumType, Enum otpVal) .get() .getName(); } + + /** + * Format and return: "2440 minute (48h)" + */ + private static String durationInMinutesToString(Duration value) { + return "%d minutes (%s)".formatted(value.toMinutes(), value.toHours() + "h"); + } } diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/mapping/PagingServiceFactory.java b/application/src/main/java/org/opentripplanner/routing/algorithm/mapping/PagingServiceFactory.java index ec58d444914..97dbda4bb68 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/mapping/PagingServiceFactory.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/mapping/PagingServiceFactory.java @@ -24,8 +24,10 @@ public static PagingService createPagingService( ) { return new PagingService( transitTuningParameters.pagingSearchWindowAdjustments(), + // The dynamic search-window is not the same as requested search-window, but in lack + // of a something else we use the raptor dynamic min here. raptorTuningParameters.dynamicSearchWindowCoefficients().minWindow(), - raptorTuningParameters.dynamicSearchWindowCoefficients().maxWindow(), + transitTuningParameters.maxSearchWindow(), searchWindowOf(raptorSearchParamsUsed), edt(searchStartTime, raptorSearchParamsUsed), lat(searchStartTime, raptorSearchParamsUsed), diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/RouteRequest.java b/application/src/main/java/org/opentripplanner/routing/api/request/RouteRequest.java index 56ba39d8431..27ecc777050 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/RouteRequest.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/RouteRequest.java @@ -11,9 +11,11 @@ import java.util.Collections; import java.util.List; import java.util.Locale; +import java.util.Objects; import java.util.function.Consumer; import javax.annotation.Nullable; import org.opentripplanner.framework.collection.ListSection; +import org.opentripplanner.framework.lang.ObjectUtils; import org.opentripplanner.framework.time.DateUtils; import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.model.GenericLocation; @@ -26,6 +28,7 @@ import org.opentripplanner.routing.api.response.RoutingError; import org.opentripplanner.routing.api.response.RoutingErrorCode; import org.opentripplanner.routing.error.RoutingValidationException; +import org.opentripplanner.standalone.config.routerconfig.TransitRoutingConfig; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -332,12 +335,25 @@ private boolean hasMaxSearchWindow() { return maxSearchWindow != null; } + /** + * For testing only. Use {@link TransitRoutingConfig#maxSearchWindow()} instead. + * @see #initMaxSearchWindow(Duration) + */ public Duration maxSearchWindow() { return maxSearchWindow; } - public void setMaxSearchWindow(@Nullable Duration maxSearchWindow) { - this.maxSearchWindow = maxSearchWindow; + /** + * Initialize the maxSearchWindow from the transit config. This is necessary because the + * default route request is configured before the {@link TransitRoutingConfig}. + */ + public void initMaxSearchWindow(Duration maxSearchWindow) { + this.maxSearchWindow = + ObjectUtils.requireNotInitialized( + "maxSearchWindow", + this.maxSearchWindow, + Objects.requireNonNull(maxSearchWindow) + ); } public Locale locale() { diff --git a/application/src/main/java/org/opentripplanner/standalone/config/RouterConfig.java b/application/src/main/java/org/opentripplanner/standalone/config/RouterConfig.java index 55128af5659..cb00428284b 100644 --- a/application/src/main/java/org/opentripplanner/standalone/config/RouterConfig.java +++ b/application/src/main/java/org/opentripplanner/standalone/config/RouterConfig.java @@ -69,7 +69,7 @@ public RouterConfig(JsonNode node, String source, boolean logUnusedParams) { this.transmodelApi = new TransmodelAPIConfig("transmodelApi", root); this.routingRequestDefaults = mapDefaultRouteRequest("routingDefaults", root); this.transitConfig = new TransitRoutingConfig("transit", root, routingRequestDefaults); - this.routingRequestDefaults.setMaxSearchWindow(transitConfig.maxSearchWindow()); + this.routingRequestDefaults.initMaxSearchWindow(transitConfig.maxSearchWindow()); this.updatersParameters = new UpdatersConfig(root); this.rideHailingConfig = new RideHailingServicesConfig(root); this.vectorTileConfig = VectorTileConfig.mapVectorTilesParameters(root, "vectorTiles"); diff --git a/application/src/main/java/org/opentripplanner/standalone/config/routerconfig/TransitRoutingConfig.java b/application/src/main/java/org/opentripplanner/standalone/config/routerconfig/TransitRoutingConfig.java index 74dbfd4bab9..8ef190e2f08 100644 --- a/application/src/main/java/org/opentripplanner/standalone/config/routerconfig/TransitRoutingConfig.java +++ b/application/src/main/java/org/opentripplanner/standalone/config/routerconfig/TransitRoutingConfig.java @@ -366,7 +366,7 @@ heuristics perform a Raptor search (one-iteration) to find a trip which we use t .summary("Upper limit for the search-window calculation.") .description( """ -Long search windows consumes a lot of resources and may take a long time. Use this parameter to +Long search windows consumes a lot of resources and may take a long time. Use this parameter to tune the desired maximum search time. This is the parameter that affects the response time most, the downside is that a search is only diff --git a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java index 560f234187a..979467299cd 100644 --- a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java +++ b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java @@ -175,7 +175,8 @@ private void setupTransitRoutingServer() { TransmodelAPI.setUp( routerConfig().transmodelApi(), timetableRepository(), - routerConfig().routingRequestDefaults() + routerConfig().routingRequestDefaults(), + routerConfig().transitTuningConfig() ); } diff --git a/application/src/main/java/org/opentripplanner/standalone/server/DefaultServerRequestContext.java b/application/src/main/java/org/opentripplanner/standalone/server/DefaultServerRequestContext.java index 0e81193d787..6dc3d27ce69 100644 --- a/application/src/main/java/org/opentripplanner/standalone/server/DefaultServerRequestContext.java +++ b/application/src/main/java/org/opentripplanner/standalone/server/DefaultServerRequestContext.java @@ -33,7 +33,6 @@ public class DefaultServerRequestContext implements OtpServerRequestContext { private final List rideHailingServices; - private RouteRequest routeRequest = null; private final Graph graph; private final TransitService transitService; private final TransitRoutingConfig transitRoutingConfig; @@ -52,6 +51,8 @@ public class DefaultServerRequestContext implements OtpServerRequestContext { private final StreetLimitationParametersService streetLimitationParametersService; private final LuceneIndex luceneIndex; + private RouteRequest defaultRouteRequestWithTimeSet = null; + /** * Make sure all mutable components are copied/cloned before calling this constructor. */ @@ -142,10 +143,10 @@ public static DefaultServerRequestContext create( @Override public RouteRequest defaultRouteRequest() { // Lazy initialize request-scoped request to avoid doing this when not needed - if (routeRequest == null) { - routeRequest = routeRequestDefaults.copyWithDateTimeNow(); + if (defaultRouteRequestWithTimeSet == null) { + defaultRouteRequestWithTimeSet = routeRequestDefaults.copyWithDateTimeNow(); } - return routeRequest; + return defaultRouteRequestWithTimeSet; } /** diff --git a/application/src/main/resources/org/opentripplanner/apis/transmodel/schema.graphql b/application/src/main/resources/org/opentripplanner/apis/transmodel/schema.graphql index 2f3aef2d9a2..6985ae1d654 100644 --- a/application/src/main/resources/org/opentripplanner/apis/transmodel/schema.graphql +++ b/application/src/main/resources/org/opentripplanner/apis/transmodel/schema.graphql @@ -831,7 +831,12 @@ type QueryType { modes: Modes, "The maximum number of trip patterns to return. Note! This reduce the number of trip patterns AFTER the OTP travel search is done in a post-filtering process. There is little/no performance gain in reducing the number of trip patterns returned. See also the trip meta-data on how to implement paging." numTripPatterns: Int = 50, - "Use the cursor to go to the next \"page\" of itineraries. Copy the cursor from the last response and keep the original request as is. This will enable you to search for itineraries in the next or previous time-window." + """ + Use the cursor to go to the next "page" of itineraries. Copy the cursor from the last + response and keep the original request as is. This will enable you to search for + itineraries in the next or previous search-window. The paging will automatically scale + up/down the search-window to fit the `numTripPatterns`. + """ pageCursor: String, "The list of points the journey is required to pass through." passThroughPoints: [PassThroughPoint!] @deprecated(reason : "Use via instead"), @@ -868,13 +873,35 @@ type QueryType { """ The length of the search-window in minutes. This parameter is optional. - The search-window is defined as the duration between the earliest-departure-time(EDT) and the latest-departure-time(LDT). OTP will search for all itineraries in this departure window. If `arriveBy=true` the `dateTime` parameter is the latest-arrival-time, so OTP will dynamically calculate the EDT. Using a short search-window is faster than using a longer one, but the search duration is not linear. Using a "too" short search-window will waste resources server side, while using a search-window that is too long will be slow. + The search-window is defined as the duration between the earliest-departure-time(EDT) and + the latest-departure-time(LDT). OTP will search for all itineraries in this departure + window. If `arriveBy=true` the `dateTime` parameter is the latest-arrival-time, so OTP + will dynamically calculate the EDT. Using a short search-window is faster than using a + longer one, but the search duration is not linear. Using a "too" short search-window will + waste resources server side, while using a search-window that is too long will be slow. - OTP will dynamically calculate a reasonable value for the search-window, if not provided. The calculation comes with a significant overhead (10-20% extra). Whether you should use the dynamic calculated value or pass in a value depends on your use-case. For a travel planner in a small geographical area, with a dense network of public transportation, a fixed value between 40 minutes and 2 hours makes sense. To find the appropriate search-window, adjust it so that the number of itineraries on average is around the wanted `numItineraries`. Make sure you set the `numItineraries` to a high number while testing. For a country wide area like Norway, using the dynamic search-window is the best. + OTP will dynamically calculate a reasonable value for the search-window, if not provided. The + calculation comes with a significant overhead (10-20% extra). Whether you should use the + dynamic calculated value or pass in a value depends on your use-case. For a travel planner + in a small geographical area, with a dense network of public transportation, a fixed value + between 40 minutes and 2 hours makes sense. To find the appropriate search-window, adjust it + so that the number of itineraries on average is around the wanted `numTripPatterns`. Make + sure you set the `numTripPatterns` to a high number while testing. For a country wide area like + Norway, using the dynamic search-window is the best. - When paginating, the search-window is calculated using the `numItineraries` in the original search together with statistics from the search for the last page. This behaviour is configured server side, and can not be overridden from the client. + When paginating, the search-window is calculated using the `numTripPatterns` in the original + search together with statistics from the search for the last page. This behaviour is + configured server side, and can not be overridden from the client. The paging may even + exceed the maximum value. - The search-window used is returned to the response metadata as `searchWindowUsed` for debugging purposes. + The search-window used is returned to the response metadata as `searchWindowUsed`. + This can be used by the client to calculate the when the next page start/end. + + Note! In some cases you may have to page many times to get all the results you want. + This is intended. Increasing the search-window beyond the max value is NOT going to be + much faster. Instead the client can inform the user about the progress. + + Maximum value: 1440 minutes (24h) """ searchWindow: Int, """ diff --git a/application/src/test/java/org/opentripplanner/apis/transmodel/TransmodelGraphQLSchemaTest.java b/application/src/test/java/org/opentripplanner/apis/transmodel/TransmodelGraphQLSchemaTest.java index bfbaedfabbf..4cdb0586aa7 100644 --- a/application/src/test/java/org/opentripplanner/apis/transmodel/TransmodelGraphQLSchemaTest.java +++ b/application/src/test/java/org/opentripplanner/apis/transmodel/TransmodelGraphQLSchemaTest.java @@ -9,6 +9,7 @@ import java.io.File; import org.junit.jupiter.api.Test; import org.opentripplanner._support.time.ZoneIds; +import org.opentripplanner.routing.algorithm.raptoradapter.transit.TransitTuningParameters; import org.opentripplanner.routing.api.request.RouteRequest; class TransmodelGraphQLSchemaTest { @@ -19,7 +20,11 @@ class TransmodelGraphQLSchemaTest { @Test void testSchemaBuild() { - var schema = TransmodelGraphQLSchema.create(new RouteRequest(), ZoneIds.OSLO); + var schema = TransmodelGraphQLSchema.create( + new RouteRequest(), + ZoneIds.OSLO, + TransitTuningParameters.FOR_TEST + ); assertNotNull(schema); String original = readFile(SCHEMA_FILE); diff --git a/application/src/test/java/org/opentripplanner/routing/core/RouteRequestTest.java b/application/src/test/java/org/opentripplanner/routing/core/RouteRequestTest.java index b18c12e0485..15960c44122 100644 --- a/application/src/test/java/org/opentripplanner/routing/core/RouteRequestTest.java +++ b/application/src/test/java/org/opentripplanner/routing/core/RouteRequestTest.java @@ -133,7 +133,7 @@ void testZeroSearchWindow() { @Test void testTooLongSearchWindow() { RouteRequest request = new RouteRequest(); - request.setMaxSearchWindow(DURATION_24_HOURS); + request.initMaxSearchWindow(DURATION_24_HOURS); assertThrows( IllegalArgumentException.class, () -> request.setSearchWindow(DURATION_24_HOURS_AND_ONE_MINUTE) From 685ea174064064abd3112c519fb35c87f6742774 Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Wed, 23 Oct 2024 15:30:12 +0200 Subject: [PATCH 042/110] review: Apply review fixes. --- .../apis/transmodel/model/plan/TripQuery.java | 10 ++++---- .../DynamicSearchWindowCoefficients.java | 5 ++-- .../routerconfig/TransitRoutingConfig.java | 24 +++++++++---------- doc/user/RouterConfiguration.md | 2 +- 4 files changed, 20 insertions(+), 21 deletions(-) diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/model/plan/TripQuery.java b/application/src/main/java/org/opentripplanner/apis/transmodel/model/plan/TripQuery.java index c46b8b36082..09ae8a593b5 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/model/plan/TripQuery.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/model/plan/TripQuery.java @@ -101,7 +101,7 @@ Normally this is when the search is performed (now), plus a small grace period t waste resources server side, while using a search-window that is too long will be slow. OTP will dynamically calculate a reasonable value for the search-window, if not provided. The - calculation comes with a significant overhead (10-20% extra). Whether you should use the + calculation comes with a significant overhead (10-20%% extra). Whether you should use the dynamic calculated value or pass in a value depends on your use-case. For a travel planner in a small geographical area, with a dense network of public transportation, a fixed value between 40 minutes and 2 hours makes sense. To find the appropriate search-window, adjust it @@ -121,10 +121,10 @@ calculation comes with a significant overhead (10-20% extra). Whether you should This is intended. Increasing the search-window beyond the max value is NOT going to be much faster. Instead the client can inform the user about the progress. - Maximum value: {max-search-window} - """.replace( - "{max-search-window}", - durationInMinutesToString(transitTuningParameters.maxSearchWindow()) + Maximum value: %d minutes (%dh) + """.formatted( + transitTuningParameters.maxSearchWindow().toMinutes(), + transitTuningParameters.maxSearchWindow().toHours() ) ) .type(Scalars.GraphQLInt) diff --git a/application/src/main/java/org/opentripplanner/raptor/api/request/DynamicSearchWindowCoefficients.java b/application/src/main/java/org/opentripplanner/raptor/api/request/DynamicSearchWindowCoefficients.java index 27ebb62c870..4cc74c34c66 100644 --- a/application/src/main/java/org/opentripplanner/raptor/api/request/DynamicSearchWindowCoefficients.java +++ b/application/src/main/java/org/opentripplanner/raptor/api/request/DynamicSearchWindowCoefficients.java @@ -60,11 +60,10 @@ default Duration minWindow() { /** * Set an upper limit to the calculation of the dynamic search window to prevent exceptionable - * cases to cause very long search windows. Long search windows consumes a lot of resources and + * cases to cause very long search windows. Long search windows consume a lot of resources and * may take a long time. Use this parameter to tune the desired maximum search time. *

- * This is the parameter that affect the response time most, the downside is that a search is only - * guaranteed to be pareto-optimal within a search-window. + * This is the parameter that affects the response time the most. *

* The default is 3 hours. The unit is minutes. */ diff --git a/application/src/main/java/org/opentripplanner/standalone/config/routerconfig/TransitRoutingConfig.java b/application/src/main/java/org/opentripplanner/standalone/config/routerconfig/TransitRoutingConfig.java index 8ef190e2f08..de67cf03817 100644 --- a/application/src/main/java/org/opentripplanner/standalone/config/routerconfig/TransitRoutingConfig.java +++ b/application/src/main/java/org/opentripplanner/standalone/config/routerconfig/TransitRoutingConfig.java @@ -62,8 +62,8 @@ public TransitRoutingConfig( .summary("This parameter is used to allocate enough memory space for Raptor.") .description( """ -Set it to the maximum number of transfers for any given itinerary expected to be found within the -entire transit network. The memory overhead of setting this higher than the maximum number of +Set it to the maximum number of transfers for any given itinerary expected to be found within the +entire transit network. The memory overhead of setting this higher than the maximum number of transfers is very little so it is better to set it too high than to low. """ ) @@ -78,8 +78,8 @@ public TransitRoutingConfig( .description( """ This reduce the number of trips departure time lookups and comparisons. When testing with data from -Entur and all of Norway as a Graph, the optimal value was about 50. If you calculate the departure -time every time or want to fine tune the performance, changing this may improve the performance a +Entur and all of Norway as a Graph, the optimal value was about 50. If you calculate the departure +time every time or want to fine tune the performance, changing this may improve the performance a few percents. """ ) @@ -108,7 +108,7 @@ public TransitRoutingConfig( .description( """ Use this parameter to set the total number of executable threads available across all searches. -Multiple searches can run in parallel - this parameter have no effect with regard to that. If 0, +Multiple searches can run in parallel - this parameter have no effect with regard to that. If 0, no extra threads are started and the search is done in one thread. """ ) @@ -142,7 +142,7 @@ public TransitRoutingConfig( | `recommended` | Use a small cost penalty like `60`. | int | | `preferred` | The best place to do transfers. Should be set to `0`(zero). | int | -Use values in a range from `0` to `100 000`. **All key/value pairs are required if the +Use values in a range from `0` to `100 000`. **All key/value pairs are required if the `stopBoardAlightDuringTransferCost` is listed.** """ ) @@ -166,7 +166,7 @@ public TransitRoutingConfig( .summary("Routing requests to use for pre-filling the stop-to-stop transfer cache.") .description( """ -If not set, the default behavior is to cache stop-to-stop transfers using the default route request +If not set, the default behavior is to cache stop-to-stop transfers using the default route request (`routingDefaults`). Use this to change the default or specify more than one `RouteRequest`. **Example** @@ -175,7 +175,7 @@ public TransitRoutingConfig( // router-config.json { "transit": { - "transferCacheRequests": [ + "transferCacheRequests": [ { "modes": "WALK" }, { "modes": "WALK", "wheelchairAccessibility": { "enabled": true } } ] @@ -201,7 +201,7 @@ public TransitRoutingConfig( """ The search window is expanded when the current page return few options. If ZERO result is returned the first duration in the list is used, if ONE result is returned then the second duration is used -and so on. The duration is added to the existing search-window and inserted into the next and +and so on. The duration is added to the existing search-window and inserted into the next and previous page cursor. See JavaDoc for [TransitTuningParameters#pagingSearchWindowAdjustments](https://github.com/opentripplanner/OpenTripPlanner/blob/dev-2.x/src/main/java/org/opentripplanner/routing/algorithm/raptor/transit/TransitTuningParameters.java)" + for more info." """ @@ -366,7 +366,7 @@ heuristics perform a Raptor search (one-iteration) to find a trip which we use t .summary("Upper limit for the search-window calculation.") .description( """ -Long search windows consumes a lot of resources and may take a long time. Use this parameter to +Long search windows consume a lot of resources and may take a long time. Use this parameter to tune the desired maximum search time. This is the parameter that affects the response time most, the downside is that a search is only @@ -381,12 +381,12 @@ heuristics perform a Raptor search (one-iteration) to find a trip which we use t .summary("Used to set the steps the search-window is rounded to.") .description( """ -The search window is rounded off to the closest multiplication of `stepMinutes`. If `stepMinutes` = +The search window is rounded off to the closest multiplication of `stepMinutes`. If `stepMinutes` = 10 minutes, the search-window can be 10, 20, 30 ... minutes. It the computed search-window is 5 minutes and 17 seconds it will be rounded up to 10 minutes. -Use a value between `1` and `60`. This should be less than the `min-raptor-search-window` +Use a value between `1` and `60`. This should be less than the `min-raptor-search-window` coefficient. """ ) diff --git a/doc/user/RouterConfiguration.md b/doc/user/RouterConfiguration.md index 766ad0de4ef..425ab92373e 100644 --- a/doc/user/RouterConfiguration.md +++ b/doc/user/RouterConfiguration.md @@ -295,7 +295,7 @@ In addition there is an upper bound on the calculation of the search window: Upper limit for the search-window calculation. -Long search windows consumes a lot of resources and may take a long time. Use this parameter to +Long search windows consume a lot of resources and may take a long time. Use this parameter to tune the desired maximum search time. This is the parameter that affects the response time most, the downside is that a search is only From 4d3fff12ce3bafe80f2b865a5c9db0071c52e317 Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Thu, 24 Oct 2024 10:56:25 +0200 Subject: [PATCH 043/110] review: Apply review fixes. --- .../apis/transmodel/model/plan/TripQuery.java | 8 -------- .../config/routerconfig/TransitRoutingConfig.java | 2 +- doc/user/RouterConfiguration.md | 2 +- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/model/plan/TripQuery.java b/application/src/main/java/org/opentripplanner/apis/transmodel/model/plan/TripQuery.java index 09ae8a593b5..ac496131954 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/model/plan/TripQuery.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/model/plan/TripQuery.java @@ -12,7 +12,6 @@ import graphql.schema.GraphQLNonNull; import graphql.schema.GraphQLOutputType; import graphql.schema.GraphQLScalarType; -import java.time.Duration; import org.opentripplanner.apis.transmodel.TransmodelGraphQLPlanner; import org.opentripplanner.apis.transmodel.model.DefaultRouteRequestType; import org.opentripplanner.apis.transmodel.model.EnumTypes; @@ -664,11 +663,4 @@ private static String enumValAsString(GraphQLEnumType enumType, Enum otpVal) .get() .getName(); } - - /** - * Format and return: "2440 minute (48h)" - */ - private static String durationInMinutesToString(Duration value) { - return "%d minutes (%s)".formatted(value.toMinutes(), value.toHours() + "h"); - } } diff --git a/application/src/main/java/org/opentripplanner/standalone/config/routerconfig/TransitRoutingConfig.java b/application/src/main/java/org/opentripplanner/standalone/config/routerconfig/TransitRoutingConfig.java index de67cf03817..e6602a188f4 100644 --- a/application/src/main/java/org/opentripplanner/standalone/config/routerconfig/TransitRoutingConfig.java +++ b/application/src/main/java/org/opentripplanner/standalone/config/routerconfig/TransitRoutingConfig.java @@ -108,7 +108,7 @@ public TransitRoutingConfig( .description( """ Use this parameter to set the total number of executable threads available across all searches. -Multiple searches can run in parallel - this parameter have no effect with regard to that. If 0, +Multiple searches can run in parallel - this parameter has no effect with regard to that. If 0, no extra threads are started and the search is done in one thread. """ ) diff --git a/doc/user/RouterConfiguration.md b/doc/user/RouterConfiguration.md index 425ab92373e..6dbd1174397 100644 --- a/doc/user/RouterConfiguration.md +++ b/doc/user/RouterConfiguration.md @@ -237,7 +237,7 @@ few percents. Split a travel search in smaller jobs and run them in parallel to improve performance. Use this parameter to set the total number of executable threads available across all searches. -Multiple searches can run in parallel - this parameter have no effect with regard to that. If 0, +Multiple searches can run in parallel - this parameter has no effect with regard to that. If 0, no extra threads are started and the search is done in one thread. From 79cf391d21aae808e7764bbd464fb92182535c9a Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Thu, 24 Oct 2024 11:03:42 +0200 Subject: [PATCH 044/110] review: Move build extension for protobuf to sub-module(gtfs-realtime-protobuf) --- gtfs-realtime-protobuf/pom.xml | 10 ++++++++++ pom.xml | 10 ---------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/gtfs-realtime-protobuf/pom.xml b/gtfs-realtime-protobuf/pom.xml index 5d814e2ac42..e4465a4d366 100644 --- a/gtfs-realtime-protobuf/pom.xml +++ b/gtfs-realtime-protobuf/pom.xml @@ -18,6 +18,16 @@ + + + + kr.motd.maven + os-maven-plugin + 1.7.1 + + - - kr.motd.maven - os-maven-plugin - 1.7.1 - - org.apache.maven.plugins From 48399ccb0fbd7737f88c7a0a875bcf794c84d757 Mon Sep 17 00:00:00 2001 From: Johan Torin Date: Thu, 24 Oct 2024 13:49:59 +0200 Subject: [PATCH 045/110] Avoid making a copy of the underlying collection when checking if the Itinerary is flagged for deletion. --- .../src/main/java/org/opentripplanner/model/plan/Itinerary.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/src/main/java/org/opentripplanner/model/plan/Itinerary.java b/application/src/main/java/org/opentripplanner/model/plan/Itinerary.java index c3d8513c2f1..18055690b6e 100644 --- a/application/src/main/java/org/opentripplanner/model/plan/Itinerary.java +++ b/application/src/main/java/org/opentripplanner/model/plan/Itinerary.java @@ -232,7 +232,7 @@ public void removeDeletionFlags(Set removeTags) { } public boolean isFlaggedForDeletion() { - return !getSystemNotices().isEmpty(); + return !systemNotices.isEmpty(); } /** From c895a9ef32c06c2ebc406eca985aad3e4c46cc65 Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Thu, 24 Oct 2024 14:12:48 +0200 Subject: [PATCH 046/110] review/refactor: Reanme EnturSorlandsbanen to SorlandsbanenNorway --- ...ice.java => SorlandsbanenNorwayService.java} | 2 +- .../configure/EnturSorlandsbanenModule.java | 17 ----------------- .../configure/SorlandsbanenNorwayModule.java | 17 +++++++++++++++++ .../raptoradapter/router/TransitRouter.java | 2 +- .../standalone/api/OtpServerRequestContext.java | 4 ++-- .../configure/ConstructApplicationFactory.java | 8 ++++---- .../configure/ConstructApplicationModule.java | 6 +++--- .../server/DefaultServerRequestContext.java | 16 ++++++++-------- 8 files changed, 36 insertions(+), 36 deletions(-) rename application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/{EnturSorlandsbanenService.java => SorlandsbanenNorwayService.java} (99%) delete mode 100644 application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/configure/EnturSorlandsbanenModule.java create mode 100644 application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/configure/SorlandsbanenNorwayModule.java diff --git a/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/EnturSorlandsbanenService.java b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/SorlandsbanenNorwayService.java similarity index 99% rename from application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/EnturSorlandsbanenService.java rename to application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/SorlandsbanenNorwayService.java index a973617f257..f08c0fc4f6b 100644 --- a/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/EnturSorlandsbanenService.java +++ b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/SorlandsbanenNorwayService.java @@ -25,7 +25,7 @@ * If train results are found in the second search, then it is added to the results of the first * search. Everything found in the first search is always returned. */ -public class EnturSorlandsbanenService { +public class SorlandsbanenNorwayService { private static final double SOUTH_BOARDER_LIMIT = 59.1; private static final int MIN_DISTANCE_LIMIT = 120_000; diff --git a/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/configure/EnturSorlandsbanenModule.java b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/configure/EnturSorlandsbanenModule.java deleted file mode 100644 index b1208f2c68b..00000000000 --- a/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/configure/EnturSorlandsbanenModule.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.opentripplanner.ext.sorlandsbanen.configure; - -import dagger.Module; -import dagger.Provides; -import javax.annotation.Nullable; -import org.opentripplanner.ext.sorlandsbanen.EnturSorlandsbanenService; -import org.opentripplanner.framework.application.OTPFeature; - -@Module -public class EnturSorlandsbanenModule { - - @Provides - @Nullable - EnturSorlandsbanenService providesEnturSorlandsbanenService() { - return OTPFeature.Sorlandsbanen.isOn() ? new EnturSorlandsbanenService() : null; - } -} diff --git a/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/configure/SorlandsbanenNorwayModule.java b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/configure/SorlandsbanenNorwayModule.java new file mode 100644 index 00000000000..d0b177ac767 --- /dev/null +++ b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/configure/SorlandsbanenNorwayModule.java @@ -0,0 +1,17 @@ +package org.opentripplanner.ext.sorlandsbanen.configure; + +import dagger.Module; +import dagger.Provides; +import javax.annotation.Nullable; +import org.opentripplanner.ext.sorlandsbanen.SorlandsbanenNorwayService; +import org.opentripplanner.framework.application.OTPFeature; + +@Module +public class SorlandsbanenNorwayModule { + + @Provides + @Nullable + SorlandsbanenNorwayService providesSorlandsbanenNorwayService() { + return OTPFeature.Sorlandsbanen.isOn() ? new SorlandsbanenNorwayService() : null; + } +} diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/TransitRouter.java b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/TransitRouter.java index cb52d5bd6a4..f77711136e8 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/TransitRouter.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/TransitRouter.java @@ -403,7 +403,7 @@ private ExtraMcRouterSearch createMcRouterFactory( if (OTPFeature.Sorlandsbanen.isOff()) { return null; } - var service = serverContext.enturSorlandsbanenService(); + var service = serverContext.sorlandsbanenService(); return service == null ? null : service.createMcRouterFactory(request, accessEgresses, transitLayer); diff --git a/application/src/main/java/org/opentripplanner/standalone/api/OtpServerRequestContext.java b/application/src/main/java/org/opentripplanner/standalone/api/OtpServerRequestContext.java index 765262840ee..49b43856011 100644 --- a/application/src/main/java/org/opentripplanner/standalone/api/OtpServerRequestContext.java +++ b/application/src/main/java/org/opentripplanner/standalone/api/OtpServerRequestContext.java @@ -10,7 +10,7 @@ import org.opentripplanner.ext.flex.FlexParameters; import org.opentripplanner.ext.geocoder.LuceneIndex; import org.opentripplanner.ext.ridehailing.RideHailingService; -import org.opentripplanner.ext.sorlandsbanen.EnturSorlandsbanenService; +import org.opentripplanner.ext.sorlandsbanen.SorlandsbanenNorwayService; import org.opentripplanner.ext.stopconsolidation.StopConsolidationService; import org.opentripplanner.framework.application.OTPFeature; import org.opentripplanner.inspector.raster.TileRendererManager; @@ -146,5 +146,5 @@ default DataOverlayContext dataOverlayContext(RouteRequest request) { StopConsolidationService stopConsolidationService(); @Nullable - EnturSorlandsbanenService enturSorlandsbanenService(); + SorlandsbanenNorwayService sorlandsbanenService(); } diff --git a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationFactory.java b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationFactory.java index c93cca4887d..7191b82e814 100644 --- a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationFactory.java +++ b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationFactory.java @@ -10,8 +10,8 @@ import org.opentripplanner.ext.geocoder.configure.GeocoderModule; import org.opentripplanner.ext.interactivelauncher.configuration.InteractiveLauncherModule; import org.opentripplanner.ext.ridehailing.configure.RideHailingServicesModule; -import org.opentripplanner.ext.sorlandsbanen.EnturSorlandsbanenService; -import org.opentripplanner.ext.sorlandsbanen.configure.EnturSorlandsbanenModule; +import org.opentripplanner.ext.sorlandsbanen.SorlandsbanenNorwayService; +import org.opentripplanner.ext.sorlandsbanen.configure.SorlandsbanenNorwayModule; import org.opentripplanner.ext.stopconsolidation.StopConsolidationRepository; import org.opentripplanner.ext.stopconsolidation.configure.StopConsolidationServiceModule; import org.opentripplanner.graph_builder.issue.api.DataImportIssueSummary; @@ -57,7 +57,7 @@ ConstructApplicationModule.class, RideHailingServicesModule.class, EmissionsServiceModule.class, - EnturSorlandsbanenModule.class, + SorlandsbanenNorwayModule.class, StopConsolidationServiceModule.class, InteractiveLauncherModule.class, StreetLimitationParametersServiceModule.class, @@ -94,7 +94,7 @@ public interface ConstructApplicationFactory { StreetLimitationParameters streetLimitationParameters(); @Nullable - EnturSorlandsbanenService enturSorlandsbanenService(); + SorlandsbanenNorwayService enturSorlandsbanenService(); @Nullable LuceneIndex luceneIndex(); diff --git a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationModule.java b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationModule.java index 75e2d0940a3..ab0f242f834 100644 --- a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationModule.java +++ b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplicationModule.java @@ -10,7 +10,7 @@ import org.opentripplanner.ext.geocoder.LuceneIndex; import org.opentripplanner.ext.interactivelauncher.api.LauncherRequestDecorator; import org.opentripplanner.ext.ridehailing.RideHailingService; -import org.opentripplanner.ext.sorlandsbanen.EnturSorlandsbanenService; +import org.opentripplanner.ext.sorlandsbanen.SorlandsbanenNorwayService; import org.opentripplanner.ext.stopconsolidation.StopConsolidationService; import org.opentripplanner.raptor.configure.RaptorConfig; import org.opentripplanner.routing.algorithm.raptoradapter.transit.TripSchedule; @@ -42,7 +42,7 @@ OtpServerRequestContext providesServerContext( StreetLimitationParametersService streetLimitationParametersService, @Nullable TraverseVisitor traverseVisitor, EmissionsService emissionsService, - @Nullable EnturSorlandsbanenService enturSorlandsbanenService, + @Nullable SorlandsbanenNorwayService sorlandsbanenService, LauncherRequestDecorator launcherRequestDecorator, @Nullable LuceneIndex luceneIndex ) { @@ -60,7 +60,7 @@ OtpServerRequestContext providesServerContext( realtimeVehicleService, vehicleRentalService, emissionsService, - enturSorlandsbanenService, + sorlandsbanenService, routerConfig.flexParameters(), rideHailingServices, stopConsolidationService, diff --git a/application/src/main/java/org/opentripplanner/standalone/server/DefaultServerRequestContext.java b/application/src/main/java/org/opentripplanner/standalone/server/DefaultServerRequestContext.java index 2c35dfe6263..c6d388ffd0e 100644 --- a/application/src/main/java/org/opentripplanner/standalone/server/DefaultServerRequestContext.java +++ b/application/src/main/java/org/opentripplanner/standalone/server/DefaultServerRequestContext.java @@ -9,7 +9,7 @@ import org.opentripplanner.ext.flex.FlexParameters; import org.opentripplanner.ext.geocoder.LuceneIndex; import org.opentripplanner.ext.ridehailing.RideHailingService; -import org.opentripplanner.ext.sorlandsbanen.EnturSorlandsbanenService; +import org.opentripplanner.ext.sorlandsbanen.SorlandsbanenNorwayService; import org.opentripplanner.ext.stopconsolidation.StopConsolidationService; import org.opentripplanner.inspector.raster.TileRendererManager; import org.opentripplanner.raptor.api.request.RaptorTuningParameters; @@ -51,7 +51,7 @@ public class DefaultServerRequestContext implements OtpServerRequestContext { private final EmissionsService emissionsService; @Nullable - private final EnturSorlandsbanenService enturSorlandsbanenService; + private final SorlandsbanenNorwayService sorlandsbanenService; private final StopConsolidationService stopConsolidationService; private final StreetLimitationParametersService streetLimitationParametersService; @@ -73,7 +73,7 @@ private DefaultServerRequestContext( RealtimeVehicleService realtimeVehicleService, VehicleRentalService vehicleRentalService, @Nullable EmissionsService emissionsService, - @Nullable EnturSorlandsbanenService enturSorlandsbanenService, + @Nullable SorlandsbanenNorwayService sorlandsbanenService, List rideHailingServices, @Nullable StopConsolidationService stopConsolidationService, StreetLimitationParametersService streetLimitationParametersService, @@ -96,7 +96,7 @@ private DefaultServerRequestContext( this.realtimeVehicleService = realtimeVehicleService; this.rideHailingServices = rideHailingServices; this.emissionsService = emissionsService; - this.enturSorlandsbanenService = enturSorlandsbanenService; + this.sorlandsbanenService = sorlandsbanenService; this.stopConsolidationService = stopConsolidationService; this.streetLimitationParametersService = streetLimitationParametersService; this.luceneIndex = luceneIndex; @@ -117,7 +117,7 @@ public static DefaultServerRequestContext create( RealtimeVehicleService realtimeVehicleService, VehicleRentalService vehicleRentalService, @Nullable EmissionsService emissionsService, - @Nullable EnturSorlandsbanenService enturSorlandsbanenService, + @Nullable SorlandsbanenNorwayService sorlandsbanenService, FlexParameters flexParameters, List rideHailingServices, @Nullable StopConsolidationService stopConsolidationService, @@ -138,7 +138,7 @@ public static DefaultServerRequestContext create( realtimeVehicleService, vehicleRentalService, emissionsService, - enturSorlandsbanenService, + sorlandsbanenService, rideHailingServices, stopConsolidationService, streetLimitationParametersService, @@ -262,7 +262,7 @@ public EmissionsService emissionsService() { } @Nullable - public EnturSorlandsbanenService enturSorlandsbanenService() { - return enturSorlandsbanenService; + public SorlandsbanenNorwayService sorlandsbanenService() { + return sorlandsbanenService; } } From b2f6fafed8bb9923443932cc459754785f736ff0 Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Thu, 24 Oct 2024 14:29:12 +0200 Subject: [PATCH 047/110] doc: Update JavaDoc in sandbox sorlandsbanen --- .../ext/sorlandsbanen/CoachCostCalculator.java | 3 +++ .../sorlandsbanen/SorlandsbanenNorwayService.java | 15 ++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/CoachCostCalculator.java b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/CoachCostCalculator.java index b7ce446d430..204878072d5 100644 --- a/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/CoachCostCalculator.java +++ b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/CoachCostCalculator.java @@ -55,6 +55,9 @@ public int transitArrivalCost( int toStop ) { int cost = delegate.transitArrivalCost(boardCost, alightSlack, transitTime, trip, toStop); + + // This is a bit ugly, since it relays on the fact that the 'transitReluctanceFactorIndex' + // returns the 'route.getMode().ordinal()' if(trip.transitReluctanceFactorIndex() == TransitMode.COACH.ordinal()) { cost += transitTime * EXTRA_RELUCTANCE_ON_COACH; } diff --git a/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/SorlandsbanenNorwayService.java b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/SorlandsbanenNorwayService.java index f08c0fc4f6b..5acffe65788 100644 --- a/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/SorlandsbanenNorwayService.java +++ b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/SorlandsbanenNorwayService.java @@ -17,13 +17,14 @@ import org.opentripplanner.transit.model.site.StopLocation; /** - * This is basically a big hack to produce results containing "Sørlandsbanen" in Norway. This - * railroad line is slow and goes inland fare from where people live. Despite this, people and the - * operator want to show it in the results for log travel along the southern part of Norway where - * ii is an option. Tuning the search has proven to be challenging. It is solved here by doing - * two searches. One normal search and one where the rail is given a big cost advantage over coach. - * If train results are found in the second search, then it is added to the results of the first - * search. Everything found in the first search is always returned. + * This service is responsible for producing results with rail for the south of Norway. The rail + * line is called "Sørlandsbanen". This rail line is slow and goes inland fare from where people + * live. Despite this, people and the operator want to show it in the results for log travel along + * the southern part of Norway where ii is an option. Tuning the search has proven to be + * challenging. It is solved here by doing two searches. One normal search and one where the rail + * is given a big cost advantage over coach. If train results are found in the second search, then + * it is added to the results of the first search. Everything found in the first search is always + * returned. */ public class SorlandsbanenNorwayService { From 9f2f507cf9d5eb32bf2f4574bc1657e051dc258b Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Thu, 24 Oct 2024 14:07:44 +0200 Subject: [PATCH 048/110] feature: Add 'isNorthOf(lat)' to WgsCoordinate --- .../opentripplanner/framework/geometry/WgsCoordinate.java | 4 ++++ .../framework/geometry/WgsCoordinateTest.java | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/application/src/main/java/org/opentripplanner/framework/geometry/WgsCoordinate.java b/application/src/main/java/org/opentripplanner/framework/geometry/WgsCoordinate.java index 136bb4264c0..3a5d4b23e73 100644 --- a/application/src/main/java/org/opentripplanner/framework/geometry/WgsCoordinate.java +++ b/application/src/main/java/org/opentripplanner/framework/geometry/WgsCoordinate.java @@ -177,6 +177,10 @@ public double distanceTo(WgsCoordinate other) { ); } + public boolean isNorthOf(double latitudeBorder) { + return latitude > latitudeBorder; + } + /** * Return a new coordinate that is moved an approximate number of meters east. */ diff --git a/application/src/test/java/org/opentripplanner/framework/geometry/WgsCoordinateTest.java b/application/src/test/java/org/opentripplanner/framework/geometry/WgsCoordinateTest.java index 4bb27fa6d36..d9da08044a5 100644 --- a/application/src/test/java/org/opentripplanner/framework/geometry/WgsCoordinateTest.java +++ b/application/src/test/java/org/opentripplanner/framework/geometry/WgsCoordinateTest.java @@ -100,6 +100,13 @@ void add() { assertEquals(new WgsCoordinate(12d, 5d), new WgsCoordinate(9d, 1d).add(3d, 4d)); } + @Test + void testIsNorthOf() { + var c = new WgsCoordinate(10.0, 30.0); + assertTrue(c.isNorthOf(9.9)); + assertFalse(c.isNorthOf(10.1)); + } + @Test void testGreenwich() { assertEquals(51.48d, GREENWICH.latitude()); From 1d52e7bccdc9c48e0e5bea79e023d7428c07b1fa Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Thu, 24 Oct 2024 14:31:37 +0200 Subject: [PATCH 049/110] refactor: MAke code more readable --- .../org/opentripplanner/ext/sorlandsbanen/MergePaths.java | 4 ++-- .../ext/sorlandsbanen/SorlandsbanenNorwayService.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/MergePaths.java b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/MergePaths.java index b5f94019b72..830ec4574ea 100644 --- a/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/MergePaths.java +++ b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/MergePaths.java @@ -18,10 +18,10 @@ class MergePaths implements BiFunction>, Collection>, Collection>> { @Override - public Collection> apply(Collection> main, Collection> railAlternatives) { + public Collection> apply(Collection> main, Collection> alternatives) { Map> result = new HashMap<>(); addAllToMap(result, main); - addRailToMap(result, railAlternatives); + addRailToMap(result, alternatives); return result.values(); } diff --git a/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/SorlandsbanenNorwayService.java b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/SorlandsbanenNorwayService.java index 5acffe65788..783f6dc1200 100644 --- a/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/SorlandsbanenNorwayService.java +++ b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/SorlandsbanenNorwayService.java @@ -40,7 +40,7 @@ public ExtraMcRouterSearch createMcRouterFactory(RouteRequest requ ); WgsCoordinate to = findStopCoordinate(request.to(), accessEgresses.getEgresses(), transitLayer); - if (from.latitude() > SOUTH_BOARDER_LIMIT && to.latitude() > SOUTH_BOARDER_LIMIT) { + if (from.isNorthOf(SOUTH_BOARDER_LIMIT) && to.isNorthOf(SOUTH_BOARDER_LIMIT)) { return null; } From 8a0dfc70b66662aee097da8e4caaf2e259e58feb Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Thu, 24 Oct 2024 14:36:03 +0200 Subject: [PATCH 050/110] feature: Avoid replacing existing paths in the result for Sorlandsbanen --- .../org/opentripplanner/ext/sorlandsbanen/MergePaths.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/MergePaths.java b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/MergePaths.java index 830ec4574ea..8abf35ffa4c 100644 --- a/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/MergePaths.java +++ b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/MergePaths.java @@ -34,7 +34,9 @@ private void addAllToMap(Map> map, Collection> map, Collection> paths) { for (var it : paths) { if (hasRail(it)) { - map.put(new PathKey(it), it); + // Avoid replacing an existing value if it exists, there might be minor differences in the + // path, in witch case we want to keep the main result. + map.computeIfAbsent(new PathKey(it), k -> it); } } } From 5a685861c58d880b76e29072e276d9604cc81417 Mon Sep 17 00:00:00 2001 From: Teemu Kalvas Date: Thu, 24 Oct 2024 15:54:59 +0300 Subject: [PATCH 051/110] remove orphaned field AgencyBuilder.brandingUrl --- .../transit/model/organization/AgencyBuilder.java | 1 - 1 file changed, 1 deletion(-) diff --git a/application/src/main/java/org/opentripplanner/transit/model/organization/AgencyBuilder.java b/application/src/main/java/org/opentripplanner/transit/model/organization/AgencyBuilder.java index a0958b1d8a4..f985a953d9e 100644 --- a/application/src/main/java/org/opentripplanner/transit/model/organization/AgencyBuilder.java +++ b/application/src/main/java/org/opentripplanner/transit/model/organization/AgencyBuilder.java @@ -11,7 +11,6 @@ public class AgencyBuilder extends AbstractEntityBuilder private String lang; private String phone; private String fareUrl; - private String brandingUrl; AgencyBuilder(FeedScopedId id) { super(id); From 2e0a034ed8f93f744999110c7b43dc610501b0c5 Mon Sep 17 00:00:00 2001 From: Johan Torin Date: Thu, 24 Oct 2024 11:10:58 +0200 Subject: [PATCH 052/110] Disable protocol upgrades for the HTTP client by default. This avoids problems where a connection could be blocked by an intermediate proxy that disallows upgrades. If wanted, it could be enabled on an individual case with a configuration API on the OTP HTTP client --- .../java/org/opentripplanner/framework/io/OtpHttpClient.java | 1 + .../org/opentripplanner/framework/io/OtpHttpClientFactory.java | 1 + 2 files changed, 2 insertions(+) diff --git a/application/src/main/java/org/opentripplanner/framework/io/OtpHttpClient.java b/application/src/main/java/org/opentripplanner/framework/io/OtpHttpClient.java index ebfeb3ff496..ccb88c3c74b 100644 --- a/application/src/main/java/org/opentripplanner/framework/io/OtpHttpClient.java +++ b/application/src/main/java/org/opentripplanner/framework/io/OtpHttpClient.java @@ -378,6 +378,7 @@ private static RequestConfig requestConfig(Duration timeout) { .custom() .setResponseTimeout(Timeout.of(timeout)) .setConnectionRequestTimeout(Timeout.of(timeout)) + .setProtocolUpgradeEnabled(false) .build(); } diff --git a/application/src/main/java/org/opentripplanner/framework/io/OtpHttpClientFactory.java b/application/src/main/java/org/opentripplanner/framework/io/OtpHttpClientFactory.java index a6436168541..8f7256f642f 100644 --- a/application/src/main/java/org/opentripplanner/framework/io/OtpHttpClientFactory.java +++ b/application/src/main/java/org/opentripplanner/framework/io/OtpHttpClientFactory.java @@ -132,6 +132,7 @@ private static RequestConfig requestConfig(Duration timeout) { .custom() .setResponseTimeout(Timeout.of(timeout)) .setConnectionRequestTimeout(Timeout.of(timeout)) + .setProtocolUpgradeEnabled(false) .build(); } } From 06aeadbd582690c2522559a490553d51f78e3b5a Mon Sep 17 00:00:00 2001 From: OTP Changelog Bot Date: Thu, 24 Oct 2024 14:24:40 +0000 Subject: [PATCH 053/110] Add changelog entry for #6179 [ci skip] --- doc/user/Changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/user/Changelog.md b/doc/user/Changelog.md index e72cc790c17..98fb53825c9 100644 --- a/doc/user/Changelog.md +++ b/doc/user/Changelog.md @@ -19,6 +19,7 @@ based on merged pull requests. Search GitHub issues and pull requests for smalle - Rename TransitModel to TransitRepository [#6148](https://github.com/opentripplanner/OpenTripPlanner/pull/6148) - Clear added patterns in TimetableSnapshot [#6141](https://github.com/opentripplanner/OpenTripPlanner/pull/6141) - Rename StopModel to SiteRepository [#6165](https://github.com/opentripplanner/OpenTripPlanner/pull/6165) +- Allow bike walking through bicycle no thru traffic areas [#6179](https://github.com/opentripplanner/OpenTripPlanner/pull/6179) [](AUTOMATIC_CHANGELOG_PLACEHOLDER_DO_NOT_REMOVE) ## 2.6.0 (2024-09-18) From 0d826d7ae96c5508a966aa5878c03c9864a6d9c4 Mon Sep 17 00:00:00 2001 From: Michael Tsang Date: Thu, 24 Oct 2024 15:44:27 +0100 Subject: [PATCH 054/110] only enable pedestrian indoor routing in the UK --- .../osm/tagmapping/DefaultMapper.java | 2 -- .../osm/tagmapping/UKMapper.java | 6 +++++ .../osm/tagmapping/DefaultMapperTest.java | 8 ------ .../osm/tagmapping/UKMapperTest.java | 26 +++++++++++++++++++ doc/user/osm/Default.md | 2 -- doc/user/osm/Finland.md | 2 -- doc/user/osm/Germany.md | 2 -- doc/user/osm/UK.md | 4 +-- 8 files changed, 34 insertions(+), 18 deletions(-) create mode 100644 application/src/test/java/org/opentripplanner/osm/tagmapping/UKMapperTest.java diff --git a/application/src/main/java/org/opentripplanner/osm/tagmapping/DefaultMapper.java b/application/src/main/java/org/opentripplanner/osm/tagmapping/DefaultMapper.java index 532b2569d45..faa666c750a 100644 --- a/application/src/main/java/org/opentripplanner/osm/tagmapping/DefaultMapper.java +++ b/application/src/main/java/org/opentripplanner/osm/tagmapping/DefaultMapper.java @@ -67,8 +67,6 @@ public void populateProperties(WayPropertySet props) { props.setProperties("public_transport=platform", pedestrianWayProperties); props.setProperties("railway=platform", pedestrianWayProperties); props.setProperties("footway=sidewalk;highway=footway", pedestrianWayProperties); - props.setProperties("indoor=area", pedestrianWayProperties); - props.setProperties("indoor=corridor", pedestrianWayProperties); props.setProperties("mtb:scale=1", pedestrianWayProperties); props.setProperties("mtb:scale=2", pedestrianWayProperties); diff --git a/application/src/main/java/org/opentripplanner/osm/tagmapping/UKMapper.java b/application/src/main/java/org/opentripplanner/osm/tagmapping/UKMapper.java index bef0be4101b..08531ce051d 100644 --- a/application/src/main/java/org/opentripplanner/osm/tagmapping/UKMapper.java +++ b/application/src/main/java/org/opentripplanner/osm/tagmapping/UKMapper.java @@ -2,7 +2,9 @@ import static org.opentripplanner.osm.wayproperty.WayPropertiesBuilder.withModes; import static org.opentripplanner.street.model.StreetTraversalPermission.ALL; +import static org.opentripplanner.street.model.StreetTraversalPermission.PEDESTRIAN; +import org.opentripplanner.osm.wayproperty.WayProperties; import org.opentripplanner.osm.wayproperty.WayPropertySet; /** @@ -73,6 +75,10 @@ public void populateProperties(WayPropertySet props) { props.setCarSpeed("highway=secondary_link", 13.4f); // ~= 30mph props.setCarSpeed("highway=tertiary", 15.7f); // ~= 35mph + WayProperties pedestrianWayProperties = withModes(PEDESTRIAN).build(); + props.setProperties("indoor=area", pedestrianWayProperties); + props.setProperties("indoor=corridor", pedestrianWayProperties); + // Read the rest from the default set new DefaultMapper().populateProperties(props); } diff --git a/application/src/test/java/org/opentripplanner/osm/tagmapping/DefaultMapperTest.java b/application/src/test/java/org/opentripplanner/osm/tagmapping/DefaultMapperTest.java index 31073f87e92..87e23acbf12 100644 --- a/application/src/test/java/org/opentripplanner/osm/tagmapping/DefaultMapperTest.java +++ b/application/src/test/java/org/opentripplanner/osm/tagmapping/DefaultMapperTest.java @@ -122,14 +122,6 @@ void stairs() { assertEquals(PEDESTRIAN, props.getPermission()); } - @Test - void indoor() { - var corridor = wps.getDataForWay(WayTestData.indoor("corridor")); - assertEquals(PEDESTRIAN, corridor.getPermission()); - var area = wps.getDataForWay(WayTestData.indoor("area")); - assertEquals(PEDESTRIAN, area.getPermission()); - } - @Test void footDiscouraged() { var regular = WayTestData.pedestrianTunnel(); diff --git a/application/src/test/java/org/opentripplanner/osm/tagmapping/UKMapperTest.java b/application/src/test/java/org/opentripplanner/osm/tagmapping/UKMapperTest.java new file mode 100644 index 00000000000..3e9e46618fd --- /dev/null +++ b/application/src/test/java/org/opentripplanner/osm/tagmapping/UKMapperTest.java @@ -0,0 +1,26 @@ +package org.opentripplanner.osm.tagmapping; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.opentripplanner.street.model.StreetTraversalPermission.PEDESTRIAN; + +import org.junit.jupiter.api.Test; +import org.opentripplanner.osm.wayproperty.WayPropertySet; +import org.opentripplanner.osm.wayproperty.specifier.WayTestData; + +public class UKMapperTest { + + static WayPropertySet wps = new WayPropertySet(); + + static { + var source = new UKMapper(); + source.populateProperties(wps); + } + + @Test + void indoor() { + var corridor = wps.getDataForWay(WayTestData.indoor("corridor")); + assertEquals(PEDESTRIAN, corridor.getPermission()); + var area = wps.getDataForWay(WayTestData.indoor("area")); + assertEquals(PEDESTRIAN, area.getPermission()); + } +} diff --git a/doc/user/osm/Default.md b/doc/user/osm/Default.md index 1373b499579..814420b791f 100644 --- a/doc/user/osm/Default.md +++ b/doc/user/osm/Default.md @@ -35,8 +35,6 @@ Lower safety values make an OSM way more desirable and higher values less desira | `public_transport=platform` | `PEDESTRIAN` | | | | `railway=platform` | `PEDESTRIAN` | | | | `footway=sidewalk; highway=footway` | `PEDESTRIAN` | | | -| `indoor=area` | `PEDESTRIAN` | | | -| `indoor=corridor` | `PEDESTRIAN` | | | | `mtb:scale=1` | `PEDESTRIAN` | | | | `mtb:scale=2` | `PEDESTRIAN` | | | | `mtb:scale=0` | `PEDESTRIAN_AND_BICYCLE` | | | diff --git a/doc/user/osm/Finland.md b/doc/user/osm/Finland.md index 820e47c46e0..8a60b5f0b13 100644 --- a/doc/user/osm/Finland.md +++ b/doc/user/osm/Finland.md @@ -79,8 +79,6 @@ Lower safety values make an OSM way more desirable and higher values less desira | `public_transport=platform` | `PEDESTRIAN` | | | | `railway=platform` | `PEDESTRIAN` | | | | `footway=sidewalk; highway=footway` | `PEDESTRIAN` | | | -| `indoor=area` | `PEDESTRIAN` | | | -| `indoor=corridor` | `PEDESTRIAN` | | | | `mtb:scale=1` | `PEDESTRIAN` | | | | `mtb:scale=2` | `PEDESTRIAN` | | | | `mtb:scale=0` | `PEDESTRIAN_AND_BICYCLE` | | | diff --git a/doc/user/osm/Germany.md b/doc/user/osm/Germany.md index f422022d4f2..922aa3af836 100644 --- a/doc/user/osm/Germany.md +++ b/doc/user/osm/Germany.md @@ -44,8 +44,6 @@ Lower safety values make an OSM way more desirable and higher values less desira | `public_transport=platform` | `PEDESTRIAN` | | | | `railway=platform` | `PEDESTRIAN` | | | | `footway=sidewalk; highway=footway` | `PEDESTRIAN` | | | -| `indoor=area` | `PEDESTRIAN` | | | -| `indoor=corridor` | `PEDESTRIAN` | | | | `mtb:scale=1` | `PEDESTRIAN` | | | | `mtb:scale=2` | `PEDESTRIAN` | | | | `mtb:scale=0` | `PEDESTRIAN_AND_BICYCLE` | | | diff --git a/doc/user/osm/UK.md b/doc/user/osm/UK.md index d5e401e40cc..34c4d1c1778 100644 --- a/doc/user/osm/UK.md +++ b/doc/user/osm/UK.md @@ -38,6 +38,8 @@ Lower safety values make an OSM way more desirable and higher values less desira | `highway=trunk_link; cycleway=opposite_track` | `ALL` | forward: 2.06
back: 0.85 | | | `highway=trunk; bicycle=designated` | `ALL` | 7.25 | | | `highway=trunk_link; bicycle=designated` | `ALL` | 2.0 | | +| `indoor=area` | `PEDESTRIAN` | | | +| `indoor=corridor` | `PEDESTRIAN` | | | | `mtb:scale=3` | `NONE` | | | | `mtb:scale=4` | `NONE` | | | | `mtb:scale=5` | `NONE` | | | @@ -49,8 +51,6 @@ Lower safety values make an OSM way more desirable and higher values less desira | `public_transport=platform` | `PEDESTRIAN` | | | | `railway=platform` | `PEDESTRIAN` | | | | `footway=sidewalk; highway=footway` | `PEDESTRIAN` | | | -| `indoor=area` | `PEDESTRIAN` | | | -| `indoor=corridor` | `PEDESTRIAN` | | | | `mtb:scale=1` | `PEDESTRIAN` | | | | `mtb:scale=2` | `PEDESTRIAN` | | | | `mtb:scale=0` | `PEDESTRIAN_AND_BICYCLE` | | | From 36ffbb7d24954a49f4693cc56fd19285b1314588 Mon Sep 17 00:00:00 2001 From: OTP Changelog Bot Date: Thu, 24 Oct 2024 15:44:22 +0000 Subject: [PATCH 055/110] Add changelog entry for #6173 [ci skip] --- doc/user/Changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/user/Changelog.md b/doc/user/Changelog.md index 98fb53825c9..5e38357a814 100644 --- a/doc/user/Changelog.md +++ b/doc/user/Changelog.md @@ -20,6 +20,7 @@ based on merged pull requests. Search GitHub issues and pull requests for smalle - Clear added patterns in TimetableSnapshot [#6141](https://github.com/opentripplanner/OpenTripPlanner/pull/6141) - Rename StopModel to SiteRepository [#6165](https://github.com/opentripplanner/OpenTripPlanner/pull/6165) - Allow bike walking through bicycle no thru traffic areas [#6179](https://github.com/opentripplanner/OpenTripPlanner/pull/6179) +- update the description of mode to cable tram. [#6173](https://github.com/opentripplanner/OpenTripPlanner/pull/6173) [](AUTOMATIC_CHANGELOG_PLACEHOLDER_DO_NOT_REMOVE) ## 2.6.0 (2024-09-18) From aafd8798c7ae26b7345039811e58f7d6cd42576c Mon Sep 17 00:00:00 2001 From: Sam Kim <21956685+sam-k@users.noreply.github.com> Date: Thu, 24 Oct 2024 13:31:46 -0700 Subject: [PATCH 056/110] docs --- doc/dev/decisionrecords/Codestyle.md | 160 ++++++++---------- doc/dev/decisionrecords/NamingConventions.md | 105 ++++++------ .../decisionrecords/RecordsPOJOsBuilders.md | 45 +++-- doc/dev/decisionrecords/UseDecisionRecords.md | 33 ++-- doc/dev/decisionrecords/_TEMPLATE.md | 14 +- doc/dev/onboarding-checklist.md | 1 + 6 files changed, 176 insertions(+), 182 deletions(-) diff --git a/doc/dev/decisionrecords/Codestyle.md b/doc/dev/decisionrecords/Codestyle.md index 46e2062f41c..2476b9ecc4c 100644 --- a/doc/dev/decisionrecords/Codestyle.md +++ b/doc/dev/decisionrecords/Codestyle.md @@ -1,96 +1,96 @@ -# Codestyle +# Code Style We use the following code conventions for [Java](#Java) and [JavaScript](#JavaScript). ## Java The OpenTripPlanner Java code style is revised in OTP v2.2. We use the -[Prettier Java](https://github.com/jhipster/prettier-java) as is. Maven is setup to +[Prettier Java](https://github.com/jhipster/prettier-java) as is. Maven is set up to run `prettier-maven-plugin`. A check is run in the CI build, which fails the build preventing -merging a PR if the code-style is incorrect. +merging a PR if the code style is incorrect. -There is two ways to format the code before checkin it in. You may run a normal build with maven - -it takes a bit of time, but reformat the entire codebase. Only code you have changed should be -formatted, since the existing code is already formatted. The second way is to set up prettier and +There are two ways to format the code before checking it in. You may run a normal build with +Maven—it takes a bit of time, but reformat the entire codebase. Only code you have changed should be +formatted, since the existing code is already formatted. The second way is to set up Prettier and run it manually or hick it into your IDE, so it runs every time a file is changed. -### How to run Prettier with Maven +### How to Run Prettier with Maven -Prettier will automatically format all code in the Maven "validate" phase, which runs before the test, package, and install phases. So formatting will happen for example when you run: +Prettier will automatically format all code in the Maven "validate" phase, which runs before the +test, package, and install phases. So formatting will happen for example when you run: -``` +```shell % mvn test ``` You can manually run _only_ the formatting process with: -``` +```shell % mvn prettier:write - ``` -To skip the prettier formating use profile `prettierSkip`: +To skip the Prettier formating, use the profile `prettierSkip`: -``` +```shell % mvn test -P prettierSkip ``` -The check for formatting errors use profile `prettierCheck`: +To check for formatting errors, use the profile `prettierCheck`: -``` +```shell % mvn test -P prettierCheck ``` The check is run by the CI server and will fail the build if the code is incorrectly formatted. -### IntellJ and Code Style Formatting +### IntelliJ and Code Style Formatting -You should use the prettier Maven plugin to reformat the code or run prettier with Node(faster). +You should use the Prettier Maven plugin to reformat the code or run Prettier with Node (faster). -The prettier does NOT format the doc and markdown files, only Java code. So, for other files you should -use the _project_ code-style. It is automatically imported when you first open the project. But, if -you have set a custom code-style in your settings (as we used until OTP v2.1), then you need to -change to the _Project_ Code Style. Open the `Preferences` from the menu and select _ -Editor > Code Style_. Then select **Project** in the \_Scheme drop down. +Prettier does _not_ format the doc and Markdown files—only Java code. So, for other files, you +should use the _project_ code style. It is automatically imported when you first open the project. +But, if you have set a custom code style in your settings (as we used until OTP v2.1), then you need +to change to the _Project_ code style. Open the `Preferences` from the menu and select _Editor > +Code Style_. Then select **Project** in the \_Scheme drop down. #### Run Prettier Maven Plugin as an external tool in IntelliJ You can run the Prettier Maven plugin as an external tool in IntelliJ. Set it up as an -`External tool` and assign a key-shortcut to the tool execution. +`External tool` and assign a keyboard shortcut to the tool execution. ![External Tool Dialog](../images/ExternalToolDialog.png) -``` +```text Name: Prettier Format Current File Program: mvn Arguments: prettier:write -Dprettier.inputGlobs=$FilePathRelativeToProjectRoot$ Working Directory: $ProjectFileDir$ ``` -> **Tip!** Add a unused key shortcut to execute the external tool, then you can use the old -> short-cut to format other file types. - +> **Tip!** Add an unused key shortcut to execute the external tool. Then you can use the old +> shortcut to format other file types. #### Install File Watchers Plugin in IntelliJ -You can also configure IntelliJ to run the prettier every time IntelliJ save a Java file. But, -if you are editing the file at the same time you will get a warning that the file in memory and the -file on disk both changed - and asked to select one of them. +You can also configure IntelliJ to run Prettier every time IntelliJ saves a Java file. But if you +are editing the file at the same time, you will get a warning that the file in memory and the file +on disk both changed, and asked to select one of them. -1. In the menyopen _Prefernces..._ and select _Plugins_. -2. Search for "File Watchers" in Marketplace -3. Run _Install_ +1. In the menu, open _Preferences..._ and select _Plugins_. +2. Search for "File Watchers" in the Marketplace. +3. Run _Install_. -##### Configure File Watcher +##### Configure File Watchers -You can run Prettier on every file save in Intellij using the File Watcher plugin. There is several -ways to set it up. Below is hwo to configure it using Maven to run the formatter. The Maven way work -without any installation of other components, but might be a bit slow. So, you might want to install -[prettier-java](https://github.com/jhipster/prettier-java/) in your shell and run it instead. +You can run Prettier upon every file save in IntelliJ using the File Watchers plugin. There are +several ways to set it up. Below is how to configure it using Maven to run the formatter. The Maven +way works without any installation of other components but might be a bit slow. So you might want to +install [prettier-java](https://github.com/jhipster/prettier-java/) in your shell and run it +instead. -``` +```text Name: Format files with Prettier -File type: Java +File Type: Java Scope: Project Files Program: mvn Arguments: prettier:write -Dprettier.inputGlobs=$FilePathRelativeToProjectRoot$ @@ -99,43 +99,44 @@ Working Directory: $ProjectFileDir$ ### Other IDEs -We do not have support for other IDEs at the moment. If you use another editor and make one please +We do not have support for other IDEs at the moment. If you use another editor and make one, please feel free to share it. ### Sorting Class Members -Some of the classes in OTP have a lot of fields and methods. Keeping members sorted reduce the merge +Some of the classes in OTP have a lot of fields and methods. Keeping members sorted reduces merge conflicts. Adding fields and methods to the end of the list will cause merge conflicts more often -than inserting methods and fields in an ordered list. Fields and methods can be sorted in "feature" -sections or alphabetically, but stick to it and respect it when adding new methods and fields. +than will inserting methods and fields in an ordered list. Fields and methods can be sorted in +"feature" sections or alphabetically, but stick to it and respect it when adding new methods and +fields. The provided formatter will group class members in this order: -1. Getter and Setter methods are kept together -2. Overridden methods are kept together -3. Dependent methods are sorted in a breadth-first order. +1. Getter and setter methods are kept together. +2. Overridden methods are kept together. +3. Dependent methods are sorted in breadth-first order. 4. Members are sorted like this: - 1. `static` `final` fields (constants) + 1. `static final` fields (constants) 2. `static` fields (avoid) - 3. instance fields - 4. static initializer - 5. class initializer - 6. constructor + 3. Instance fields + 4. Static initializers + 5. Class initializers + 6. Constructors 7. `static` factory methods 8. `public` methods - 9. getter and setters - 8. `private`/package methods - 10. `private` enums (avoid `public`) - 11. interfaces - 12. `private static` classes (avoid `public`) - 13. instance classes (avoid) + 9. Getter and setters + 10. `private`/package methods + 11. `private` enums (avoid `public`) + 12. Interfaces + 13. `private static` classes (avoid `public`) + 14. Instance classes (avoid) -### JavaDoc Guidlines +### Javadoc Guidelines As a matter of [policy](http://github.com/opentripplanner/OpenTripPlanner/issues/93), all new methods, classes, and fields should include comments explaining what they are for and any other pertinent information. For Java code, the comments should follow industry standards. It is best to -provide comments that not only explain *what* you did but also *why you did it* while providing some +provide comments that explain not only *what* you did but also *why you did it* while providing some context. Please avoid including trivial Javadoc or the empty Javadoc stubs added by IDEs, such as `@param` annotations with no description. @@ -144,41 +145,28 @@ context. Please avoid including trivial Javadoc or the empty Javadoc stubs added - Contract of the method - Input domain for which the logic is designed - Range of outputs produced from valid inputs - - Is behavior undefined or will fail when conditions are not met - - Are null values allowed as inputs - - Will null values occur as outputs (what do they mean) + - Is behavior undefined or will the method fail when conditions are not met? + - Are null values allowed as inputs? + - Will null values occur as outputs (and what do they mean)? - Invariants that hold if the preconditions are met - Concurrency - - Is method thread-safe + - Is the method thread-safe? - Usage constraints for multi-threaded use - On classes: - Initialization and teardown process - - Can instance be reused for multiple operations, or should it be discarded - - Is it immutable or should anything be treated as immutable - - Is it a utility class of static methods that should not be instantiated - -### Annotations - -- On methods: - - Method should be marked as `@Nullable` if they can return null values - - Method parameters should be marked as `@Nullable` if they can take null values. -- On fields: - - Fields should be marked as `@Nullable` if they are nullable. - -Use of `@Nonnull` annotation is not allowed. It should be assumed methods/parameters/fields -are non-null if they are not marked as `@Nullable`. However, there are places where the -`@Nullable` annotation is missing even if it should have been used. Those can be updated -to use the `@Nullable` annotation. + - Can an instance be reused for multiple operations, or should it be discarded? + - Is it immutable, or should anything be treated as immutable? + - Is it a utility class of static methods that should not be instantiated? ## JavaScript -As of #206, we -follow [Crockford's JavaScript code conventions](http://javascript.crockford.com/code.html). Further +As of [#206](https://github.com/opentripplanner/OpenTripPlanner/issues/206), we follow +[Crockford's JavaScript code conventions](http://javascript.crockford.com/code.html). Further guidelines include: * All .js source files should contain one class only -* Capitalize the class name, as well as the source file name (a la Java) -* Include the namespace definition in each and every file: `otp.namespace("otp.configure");` +* Capitalize the class name, as well as the source file name (a la Java). +* Include the namespace definition in each and every file: `otp.namespace("otp.configure");`. * Include a class comment. For example, ```javascript @@ -187,8 +175,8 @@ guidelines include: * * Purpose is to allow a generic configuration object to be read via AJAX/JSON, and inserted into an * Ext Store - * The implementation is TriMet route map specific...but replacing ConfigureStore object (or member - * variables) with another implementation, will give this widget flexibility for other uses beyond + * The implementation is TriMet route map-specific...but replacing ConfigureStore object (or member + * variables) with another implementation will give this widget flexibility for other uses beyond * the iMap. * * @class diff --git a/doc/dev/decisionrecords/NamingConventions.md b/doc/dev/decisionrecords/NamingConventions.md index ed6175f4f4c..e0f5000e97c 100644 --- a/doc/dev/decisionrecords/NamingConventions.md +++ b/doc/dev/decisionrecords/NamingConventions.md @@ -1,74 +1,71 @@ # Naming Conventions -In general, we use American English. We use the GTFS terminology inside OTP as the transit domain -specific language. In cases where GTFS does not provide an alternative we use NeTEx. The naming -should follow the Java standard naming conventions. For example a "real-time updater" class -is named `RealTimeUpdater`. If in doubt check the Oxford Dictionary(American). - +In general, we use American English. We use the GTFS terminology inside OTP as the transit +domain-specific language. In cases where GTFS does not provide an alternative, we use NeTEx. The +naming should follow the Java standard naming conventions. For example, a "real-time updater" class +is named `RealTimeUpdater`. If in doubt, check the Oxford Dictionary (American). ## Packages Try to arrange code by domain functionality, not technology. The main structure of a package should be `org.opentripplanner...`. -| Package | Description | -| ------------------------------- |----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `o.o.` | At the top level we should divide OTP into "domain"s like `apis`, `framework`, `transit`, `street`, `astar`, `raptor`, `feeds`, `updaters`, and `application`. | -| `component` and `sub-component` | A group of packages/classes which naturally belong together, think aggregate as in Domain Driven Design. | -| `component.api` | Used for components to define the programing interface for the component. If present, (see Raptor) all outside dependencies to the component should be through the `api`. | -| `component.model` | Used to create a model of a Entites, ValueObjects, ++. If exposed outside the component you should include an entry point like `xyz.model.XyzModel` and/or a Service (in api or component root package). | -| `component.service` | Implementation of the service like `DefaultTransitService`, may also contain use-case specific code. Note, the Service interface goes into the component root or `api`, not in the service package. | -| `component.configure` | Component creation/orchestration. Put Dependency Injection code here, like the Dagger Module. | -| `support` | Sometimes domain logic get complicated, then extracting/isolating it helps. `support` is used internally in a component, not outside. | -| `framework` | (Abstract) building blocks internal to a domain/parent package. In some cases accessed outside the component, e.g. `OptAppException`, `TransitEntity`. | -| `mapping` | Map between two domains/components. | -| `util` | General "util" functionality, often characterized by `static` methods. Dependencies to other OTP packages is NOT allowed, only 3rd party utils libs. | -| `o.o.apis` | OTP external endpoints. Note! Many apis are in the Sandbox where they are in the `o.o.ext` package. | - -> **Note!** The above is the goal, the current package structure needs cleanup. - -> **Note!** Util methods depending on an OTP type/component should go into that type/component, not in the -utils class. E.g. static factory methods. Warning the "pure" utilities right now are placed into -sub-packages of `o.o.util`, the root package needs cleanup. - +| Package | Description | +| ------------------------------- |-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `o.o.` | At the top level, we should divide OTP into "domains" like `apis`, `framework`, `transit`, `street`, `astar`, `raptor`, `feeds`, `updaters`, and `application`. | +| `component` and `sub-component` | A group of packages/classes that naturally belong together; think aggregate as in Domain-Driven Design. | +| `component.api` | Used for components to define the programing interface for the component. If present, (see Raptor) all outside dependencies to the component should be through the `api`. | +| `component.model` | Used to create a model of Entities, ValueObjects, etc. If exposed outside the component, you should include an entry point like `xyz.model.XyzModel` and/or a Service (in `api` or component root package). | +| `component.service` | Implementation of a service like `DefaultTransitService`; may also contain use case-specific code. Note: The Service interface goes into the component root or `api`, not in the service package. | +| `component.configure` | Component creation/orchestration. Put dependency injection code here, like the Dagger module. | +| `support` | Sometimes domain logic gets complicated; then extracting/isolating it helps. `support` is used internally in a component, not outside. | +| `framework` | (Abstract) building blocks internal to a domain/parent package. In some cases accessed outside the component; e.g., `OptAppException`, `TransitEntity`. | +| `mapping` | Map between two domains/components. | +| `util` | General "util" functionality, often characterized by `static` methods. Dependencies to other OTP packages are NOT allowed; only third-party utils libraries. | +| `o.o.apis` | OTP external endpoints. Note! Many APIs are in the Sandbox where they are in the `o.o.ext` package. | + +> **Note!** The above is the goal. The current package structure needs cleanup. + +> **Note!** Util methods depending on an OTP type/component should go into that type/component, not +> in the utils class; e.g., static factory methods. Warning: The "pure" utilities right now are +> placed into subpackages of `o.o.util`. The root package needs cleanup. ## Methods -Here are a list of common prefixes used, and what to expect. - -| Good method prefixes | Description | -|-------------------------------------------------------|-----------------------------------------------------------------------------| -| `stop() : Stop` | Field accessor, equivalent to `getStop` as in the Java Bean standard | -| `getStop(ID id) : Stop` | Get Stop by ID, throws exception if not found | -| `getStops(Collection id) : List/Collection` | Get ALL Stops by set of IDs, throws exception if not found | -| `findStop(Criteria criteria) : Optional` | Find one or zero stops, return `Optional` | -| `findStops(Criteria criteria) : List/Stream` | Find 0, 1 or many stops, return a collection or stream(List is preferred) | -| `listStops() : List/Stream` | List ALL stops in context, return a collection or stream(List is preferred) | -| `withStop(Stop stop) : Builder` | Set stop in builder, replacing existing value and return `this` builder | -| `initStop(Stop stop) : void` | Set property ONCE, a second call throws an exception | -| `addStop(Stop stop) : void/Builder` | Add a stop to a collection of stops. | -| `addStops(Collection stops) : void/Builder` | Add set of stops to existing set. | -| `withBike(Consumer body) : Builder` | For nested builders use lambdas. | - -These prefixes are also "allowed", but not preferred - they have some kind of negative "force" to them. - -| Ok method prefixes, but ... | Description | -| ------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -| `withStops(Collection stops) : this`) | Replace all stops in builder with new set, consider using `addStops(...)` instead | -| `setStop(Stop stop)` | Set a mutable stop reference. Avoid if not part of natural lifecycle. Use `initStop(...)` if possible | -| `getStop() : Stop` | Old style accessor, use the shorter form `stop() : Stop` | - -## Service, Model and Repository +Here is a list of common prefixes used and what to expect. + +| Good method prefixes | Description | +|-------------------------------------------------------|-------------------------------------------------------------------------------| +| `stop() : Stop` | Field accessor, equivalent to `getStop` as in the Java Bean standard. | +| `getStop(ID id) : Stop` | Get Stop by ID; throws exception if not found. | +| `getStops(Collection id) : List/Collection` | Get _all_ Stops by set of IDs; throws exception if not found. | +| `findStop(Criteria criteria) : Optional` | Find one or zero stops; return `Optional`. | +| `findStops(Criteria criteria) : List/Stream` | Find 0, 1, or many stops; return a Collection or Stream (List is preferred). | +| `listStops() : List/Stream` | List ALL stops in context; return a Collection or Stream (List is preferred). | +| `withStop(Stop stop) : Builder` | Set Stop in builder, replacing existing value; return `this` builder. | +| `initStop(Stop stop) : void` | Set property _once_; a second call throws an exception. | +| `addStop(Stop stop) : void/Builder` | Add a Stop to a collection of Stops. | +| `addStops(Collection stops) : void/Builder` | Add set of Stops to existing set. | +| `withBike(Consumer body) : Builder` | For nested builders, use lambdas. | + +These prefixes are also "allowed" but not preferred; they have some kind of negative "force" to +them. + +| Okay method prefixes, but ... | Description | +|---------------------------------------------|--------------------------------------------------------------------------------------------------------| +| `withStops(Collection stops) : this`) | Replace all Stops in builder with new set. Consider using `addStops(...)` instead. | +| `setStop(Stop stop)` | Set a mutable Stop reference. Avoid if not part of natural lifecycle. Use `initStop(...)` if possible. | +| `getStop() : Stop` | Old style accessor. Use the shorter form `stop() : Stop`. | + +## Service, Model, and Repository ![MainModelOverview](../images/ServiceModelOverview.png) - - Naming convention for builders with and without a context. -#### Graph Build and tests run without a context +#### Graph Build and Tests Run Without a Context -```Java +```java // Create a new Stop trip = Trip.of(id).withName("The Express").build(); diff --git a/doc/dev/decisionrecords/RecordsPOJOsBuilders.md b/doc/dev/decisionrecords/RecordsPOJOsBuilders.md index e0752fc70b0..3112760cbe7 100644 --- a/doc/dev/decisionrecords/RecordsPOJOsBuilders.md +++ b/doc/dev/decisionrecords/RecordsPOJOsBuilders.md @@ -1,8 +1,8 @@ ## Records, POJOs and Builders -We prefer immutable typesafe types over flexibility and "short" class definitions. This makes -the code more robust and less error-prone. References to other entities might need to be mutable, -if so try to init them once, and throw an exception if set again. Example: +We prefer immutable typesafe types over flexibility and "short" class definitions. This makes the +code more robust and less error-prone. References to other entities might need to be mutable; if so, +try to init them once and throw an exception if set again. Example: ```java Builder initStop(Stop stop) { @@ -10,37 +10,46 @@ Builder initStop(Stop stop) { } ``` - ### Records -You may use records, but avoid using records if you cannot encapsulate them properly. Generally, records are considered appropriate and useful for throw-away compound types private to an implementation, such as hash table keys or compound values in a temporary list or set. On the other hand, records are generally not appropriate in the domain model where we insist on full encapsulation, which records cannot readily provide. Be especially -aware of array fields (which can not be protected) and collections (remember to make a defensive copy). Consider overriding `toString`. But if you need to override `equals` and `hashCode`, then it is probably not worth using a record. The implicit `equals()` and `hashCode()` implementations for records behave as if they call `equals` and `hashCode` on each field of the record, so their behavior will depend heavily on the types of these fields. +You may use records, but avoid using records if you cannot encapsulate them properly. Generally, +records are considered appropriate and useful for throwaway compound types private to an +implementation, such as hash table keys or compound values in a temporary list or set. On the other +hand, records are generally not appropriate in the domain model where we insist on full +encapsulation, which records cannot readily provide. Be especially aware of array fields (which +cannot be protected) and collections (remember to make a defensive copy). Consider overriding +`toString`. But if you need to override `equals` and `hashCode`, then it is probably not worth using +a record. The implicit `equals` and `hashCode` implementations for records behave as if they call +`equals` and `hashCode` on each field of the record, so their behavior will depend heavily on the +types of these fields. ### Builders OTP used a simple builder pattern in many places, especially when creating immutable types. #### Builder conventions -- Use factory methods to create builder, either `of()` or `copyOf()`. The _copyOf_ uses an existing - instance as its base. The `of()` creates a builder with all default values set. All constructors - should be private (or package local) to enforce the use of the factory methods. -- If the class has more than 5 fields, then avoid using an inner class builder, instead create a + +- Use factory methods to create builder—either `of` or `copyOf`. The `copyOf` uses an existing + instance as its base. The `of` creates a builder with all default values set. All constructors + should be private (or package-local) to enforce use of the factory methods. +- If the class has more than 5 fields, then avoid using an inner class builder. Instead, create a builder in the same package. - Make all fields in the main class final to enforce immutability. - Consider using utility methods for parameter checking, like `Objects#requireNonNull` and - `ObjectUtils.ifNotNull`. -- Validate all fields in the main type constructor(i.e. not in the builder), especially null checks. - Prefer default values over null-checks. All business logic using the type can rely on its validity. + `ObjectUtils#ifNotNull`. +- Validate all fields in the main type constructor (i.e., not in the builder), especially null + checks. Prefer default values over null checks. All business logic using the type can rely on its + validity. - You may keep the original instance in the builder to avoid creating a new object if nothing - changed. This prevents polluting the heap for long-lived objects and make comparison very fast. -- There is no need to provide all get accessors in the Builder if not needed. + changed. This prevents polluting the heap for long-lived objects and makes comparison very fast. +- There is no need to provide all get accessors in the builder if not needed. - Unit-test builders and verify all fields are copied over. -- For nested builders see the field `nested` in the example. +- For nested builders, see the field `nested` in the example.

- Builder example + Builder example -```Java +```java /** * THIS CLASS IS IMMUTABLE AND THREAD-SAFE */ diff --git a/doc/dev/decisionrecords/UseDecisionRecords.md b/doc/dev/decisionrecords/UseDecisionRecords.md index a3520ea5133..0c07f89fd12 100644 --- a/doc/dev/decisionrecords/UseDecisionRecords.md +++ b/doc/dev/decisionrecords/UseDecisionRecords.md @@ -1,37 +1,36 @@ # Decision Records -An OTP Decision Record is a justified software design choice that addresses a significant -functional or non-functional requirement. [Architectural Decision Records](https://adr.github.io/) is a similar -concept, but we have widened the scope to include any relevant decision about OTP development. - +An OTP Decision Record is a justified software design choice that addresses a significant +functional or non-functional requirement. [Architectural Decision Records](https://adr.github.io/) +is a similar concept, but we have widened the scope to include any relevant decision about OTP +development. ## Process Decisions we make in the developer meetings are recorded in the [Developer Decision Records](/DEVELOPMENT_DECISION_RECORDS.md) -list. If the decision is small and uncontroversial, but yet important and can be expressed in +list. If the decision is small and uncontroversial, yet is important and can be expressed in maximum 2 sentences, we will list it here without any more documentation. If the decision requires -a bit more discussion and explanations, then we will create a PR with a document for it. - -Use the **[template](/doc/dev/decisionrecords/_TEMPLATE.md) as a starting point for documenting -the decision. +a bit more discussion and explanation, then we will create a PR with a document for it. +Use the [template](/doc/dev/decisionrecords/_TEMPLATE.md) as a starting point for documenting the +decision. ### How to discuss and document a Decision Record -- Create a new pull-request and describe the decision record by adding a document to the +- Create a new pull request and describe the decision record by adding a document to the `/doc/dev/decisionrecords` folder. Use the [template](/doc/dev/decisionrecords/_TEMPLATE.md). - template. -- Present the decision record in a developer meeting. Make sure to update the main description - based on the feedback/discussion and decisions in the developer meeting. -- The final approval is done in the developer meeting, at least 3 developers representing 3 +- Present the decision record in a developer meeting. Make sure to update the main description based + on the feedback/discussion and decisions in the developer meeting. +- The final approval is done in the developer meeting. At least 3 developers representing 3 different organisations should approve it. No vote against the proposal. If the developers are not able to agree, the PLC can decide. - References to Development Decision Records in reviews can be done by linking or just typing. - For example `Use-Dependency-Injection` or [Use-Dependency-Injection](../../../DEVELOPMENT_DECISION_RECORDS.md#use-dependency-injection) + For example, `Use-Dependency-Injection` or [Use-Dependency-Injection](../../../DEVELOPMENT_DECISION_RECORDS.md#use-dependency-injection). ### Checklist + - [ ] Give it a meaningful title that quickly lets the reader understand what it is all about. - [ ] Get it approved in a developer meeting with 3 votes in favor (3 organisations). -- [ ] Add the name and description to the list in the [Development Decision Records](../../../DEVELOPMENT_DECISION_RECORDS.md) list. - Maximum two sentences should be used. Try to keep it as short as possible. +- [ ] Add the name and description to the list in the [Development Decision Records](../../../DEVELOPMENT_DECISION_RECORDS.md) + list. Maximum two sentences should be used. Try to keep it as short as possible. - [ ] Remember to link to the PR. diff --git a/doc/dev/decisionrecords/_TEMPLATE.md b/doc/dev/decisionrecords/_TEMPLATE.md index 45bb3b11d34..b628d74c6a7 100644 --- a/doc/dev/decisionrecords/_TEMPLATE.md +++ b/doc/dev/decisionrecords/_TEMPLATE.md @@ -2,8 +2,8 @@ {DESCRIPTION} Original pull-request: {#NNNN} @@ -12,13 +12,13 @@ Original pull-request: {#NNNN} ### Context and Problem Statement ### Other options - - +- ### Decision & Consequences @@ -26,8 +26,8 @@ Original pull-request: {#NNNN} #### Positive Consequences - - +- #### Negative Consequences - - +- diff --git a/doc/dev/onboarding-checklist.md b/doc/dev/onboarding-checklist.md index 201238a7fd4..4e39e887175 100644 --- a/doc/dev/onboarding-checklist.md +++ b/doc/dev/onboarding-checklist.md @@ -1,4 +1,5 @@ # Onboarding Checklist + * What is OTP? * [Website](https://www.opentripplanner.org/) * History From c42d8ce71bf2b06d1708dc520918f3dfa08b7f8d Mon Sep 17 00:00:00 2001 From: Sam Kim <21956685+sam-k@users.noreply.github.com> Date: Thu, 24 Oct 2024 13:46:33 -0700 Subject: [PATCH 057/110] misc --- doc/dev/decisionrecords/Codestyle.md | 2 +- doc/dev/decisionrecords/NamingConventions.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/dev/decisionrecords/Codestyle.md b/doc/dev/decisionrecords/Codestyle.md index 2476b9ecc4c..a57d748051c 100644 --- a/doc/dev/decisionrecords/Codestyle.md +++ b/doc/dev/decisionrecords/Codestyle.md @@ -70,7 +70,7 @@ Working Directory: $ProjectFileDir$ > **Tip!** Add an unused key shortcut to execute the external tool. Then you can use the old > shortcut to format other file types. -#### Install File Watchers Plugin in IntelliJ +#### Install File Watchers plugin in IntelliJ You can also configure IntelliJ to run Prettier every time IntelliJ saves a Java file. But if you are editing the file at the same time, you will get a warning that the file in memory and the file diff --git a/doc/dev/decisionrecords/NamingConventions.md b/doc/dev/decisionrecords/NamingConventions.md index e0f5000e97c..37010430bec 100644 --- a/doc/dev/decisionrecords/NamingConventions.md +++ b/doc/dev/decisionrecords/NamingConventions.md @@ -63,7 +63,7 @@ them. Naming convention for builders with and without a context. -#### Graph Build and Tests Run Without a Context +#### Graph builds and tests run without a context ```java // Create a new Stop From 179c26a4e0bd1ce2517ec6330750efd1645d8c72 Mon Sep 17 00:00:00 2001 From: Sam Kim <21956685+sam-k@users.noreply.github.com> Date: Thu, 24 Oct 2024 14:20:13 -0700 Subject: [PATCH 058/110] merged contents --- doc/dev/decisionrecords/Codestyle.md | 13 +++++++++++++ doc/dev/decisionrecords/NamingConventions.md | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/doc/dev/decisionrecords/Codestyle.md b/doc/dev/decisionrecords/Codestyle.md index a57d748051c..72db4796291 100644 --- a/doc/dev/decisionrecords/Codestyle.md +++ b/doc/dev/decisionrecords/Codestyle.md @@ -158,6 +158,19 @@ context. Please avoid including trivial Javadoc or the empty Javadoc stubs added - Is it immutable, or should anything be treated as immutable? - Is it a utility class of static methods that should not be instantiated? +### Annotations + +- On methods: + - Method should be marked as `@Nullable` if they can return null values. + - Method parameters should be marked as `@Nullable` if they can take null values. +- On fields: + - Fields should be marked as `@Nullable` if they are nullable. + +Use of `@NonNull` annotation is not allowed. It should be assumed methods/parameters/fields are +non-null if they are not marked as `@Nullable`. However, there are places where the `@Nullable` +annotation is missing even if it should have been used. Those can be updated to use the `@Nullable` +annotation. + ## JavaScript As of [#206](https://github.com/opentripplanner/OpenTripPlanner/issues/206), we follow diff --git a/doc/dev/decisionrecords/NamingConventions.md b/doc/dev/decisionrecords/NamingConventions.md index 37010430bec..0c7cd201d7d 100644 --- a/doc/dev/decisionrecords/NamingConventions.md +++ b/doc/dev/decisionrecords/NamingConventions.md @@ -57,7 +57,7 @@ them. | `setStop(Stop stop)` | Set a mutable Stop reference. Avoid if not part of natural lifecycle. Use `initStop(...)` if possible. | | `getStop() : Stop` | Old style accessor. Use the shorter form `stop() : Stop`. | -## Service, Model, and Repository +## Service, Model and Repository ![MainModelOverview](../images/ServiceModelOverview.png) From 2e2be55036512d933f16b516bf3de1ed08b671d2 Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Fri, 25 Oct 2024 10:52:26 +0200 Subject: [PATCH 059/110] review: Cleanup CompositeResult --- .../raptor/rangeraptor/CompositeResult.java | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/CompositeResult.java b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/CompositeResult.java index d92f0df79bb..b547493a7df 100644 --- a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/CompositeResult.java +++ b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/CompositeResult.java @@ -17,7 +17,8 @@ */ class CompositeResult implements RaptorRouterResult { - private final RaptorRouterResult mainResult; + public static final String UNSOPORTED_OPERATION = + "Merging all stop arrivals will be a complicated and memory intensive process, unless we need this this should not be done."; private final Collection> result; CompositeResult( @@ -25,7 +26,6 @@ class CompositeResult implements RaptorRouterResul RaptorRouterResult alternativeResult, BiFunction>, Collection>, Collection>> merger ) { - this.mainResult = mainResult; this.result = merger.apply(mainResult.extractPaths(), alternativeResult.extractPaths()); } @@ -37,28 +37,19 @@ public Collection> extractPaths() { return result; } - /** - * Return the main result only. - */ @Override public SingleCriteriaStopArrivals extractBestOverallArrivals() { - return mainResult.extractBestOverallArrivals(); + throw new UnsupportedOperationException(UNSOPORTED_OPERATION); } - /** - * Return the main result only. - */ @Override public SingleCriteriaStopArrivals extractBestTransitArrivals() { - return mainResult.extractBestTransitArrivals(); + throw new UnsupportedOperationException(UNSOPORTED_OPERATION); } - /** - * Return the main result only. - */ @Override public SingleCriteriaStopArrivals extractBestNumberOfTransfers() { - return mainResult.extractBestNumberOfTransfers(); + throw new UnsupportedOperationException(UNSOPORTED_OPERATION); } /** From d67d4d064581a21313d961fd7bd5fa13dde9b437 Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Fri, 25 Oct 2024 10:52:58 +0200 Subject: [PATCH 060/110] review: Cleanup PathKey --- .../java/org/opentripplanner/ext/sorlandsbanen/PathKey.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/PathKey.java b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/PathKey.java index 28c1b1eac25..9d0d1a14936 100644 --- a/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/PathKey.java +++ b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/PathKey.java @@ -19,9 +19,6 @@ final class PathKey { } private static int hash(RaptorPath path) { - if (path == null) { - return 0; - } int result = 1; PathLeg leg = path.accessLeg(); From 1cb96d66f0df91672ded08b10bcd9f9647be62c3 Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Fri, 25 Oct 2024 10:53:49 +0200 Subject: [PATCH 061/110] review: Add more doc to ExtraMcRouterSearch --- .../org/opentripplanner/raptor/spi/ExtraMcRouterSearch.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/application/src/main/java/org/opentripplanner/raptor/spi/ExtraMcRouterSearch.java b/application/src/main/java/org/opentripplanner/raptor/spi/ExtraMcRouterSearch.java index afebc107832..deb22107036 100644 --- a/application/src/main/java/org/opentripplanner/raptor/spi/ExtraMcRouterSearch.java +++ b/application/src/main/java/org/opentripplanner/raptor/spi/ExtraMcRouterSearch.java @@ -14,7 +14,11 @@ *

* When changing the transit data, you may also invalidate the heuristics created by Raptor. If this * is the case, you need to turn off the {@link org.opentripplanner.raptor.api.request.Optimization#PARETO_CHECK_AGAINST_DESTINATION}. - * For the heuristics to work, you may add extra cost or filter away data. + * For the heuristics to work, you may add extra cost or filter away data. But you cannot decrease + * the cost, add transfer or add new trips. + *

+ * This will alter the multi-criteria search, if only a sadard search is requested any extra + * multi-criteria search is ignored. *

* @param The TripSchedule type defined by the user of the raptor API. */ From af4121d8d93b85881a9994116af6039098e185c1 Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Fri, 25 Oct 2024 10:54:51 +0200 Subject: [PATCH 062/110] review: Rename 'createMcRouterFactory' to 'createExtraMcRouterSearch' --- .../ext/sorlandsbanen/SorlandsbanenNorwayService.java | 8 +++++--- .../algorithm/raptoradapter/router/TransitRouter.java | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/SorlandsbanenNorwayService.java b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/SorlandsbanenNorwayService.java index 783f6dc1200..9314400c649 100644 --- a/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/SorlandsbanenNorwayService.java +++ b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/SorlandsbanenNorwayService.java @@ -2,6 +2,7 @@ import java.util.Collection; import java.util.function.BiFunction; +import javax.annotation.Nullable; import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.model.GenericLocation; import org.opentripplanner.raptor.api.path.RaptorPath; @@ -28,11 +29,12 @@ */ public class SorlandsbanenNorwayService { - private static final double SOUTH_BOARDER_LIMIT = 59.1; + private static final double SOUTH_BORDER_LIMIT = 59.1; private static final int MIN_DISTANCE_LIMIT = 120_000; - public ExtraMcRouterSearch createMcRouterFactory(RouteRequest request, AccessEgresses accessEgresses, TransitLayer transitLayer) { + @Nullable + public ExtraMcRouterSearch createExtraMcRouterSearch(RouteRequest request, AccessEgresses accessEgresses, TransitLayer transitLayer) { WgsCoordinate from = findStopCoordinate( request.from(), accessEgresses.getAccesses(), @@ -40,7 +42,7 @@ public ExtraMcRouterSearch createMcRouterFactory(RouteRequest requ ); WgsCoordinate to = findStopCoordinate(request.to(), accessEgresses.getEgresses(), transitLayer); - if (from.isNorthOf(SOUTH_BOARDER_LIMIT) && to.isNorthOf(SOUTH_BOARDER_LIMIT)) { + if (from.isNorthOf(SOUTH_BORDER_LIMIT) && to.isNorthOf(SOUTH_BORDER_LIMIT)) { return null; } diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/TransitRouter.java b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/TransitRouter.java index f77711136e8..2b9c0136e07 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/TransitRouter.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/TransitRouter.java @@ -146,7 +146,7 @@ private TransitRouterResult route() { // Route transit var raptorService = new RaptorService<>( serverContext.raptorConfig(), - createMcRouterFactory(accessEgresses, transitLayer) + createExtraMcRouterSearch(accessEgresses, transitLayer) ); var transitResponse = raptorService.route(raptorRequest, requestTransitDataProvider); @@ -396,7 +396,7 @@ private IntStream listStopIndexes(FeedScopedId stopLocationId) { * An optional factory for creating a decorator around the multi-criteria RangeRaptor instance. */ @Nullable - private ExtraMcRouterSearch createMcRouterFactory( + private ExtraMcRouterSearch createExtraMcRouterSearch( AccessEgresses accessEgresses, TransitLayer transitLayer ) { @@ -406,6 +406,6 @@ private ExtraMcRouterSearch createMcRouterFactory( var service = serverContext.sorlandsbanenService(); return service == null ? null - : service.createMcRouterFactory(request, accessEgresses, transitLayer); + : service.createExtraMcRouterSearch(request, accessEgresses, transitLayer); } } From 736daffe10406150ea3724bca4dbfc1e76030315 Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Fri, 25 Oct 2024 11:05:06 +0200 Subject: [PATCH 063/110] review: Add @Nullable to 'executorService' in ConcurrentCompositeRaptorRouter --- .../raptor/rangeraptor/ConcurrentCompositeRaptorRouter.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/ConcurrentCompositeRaptorRouter.java b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/ConcurrentCompositeRaptorRouter.java index dbf0c2d89c7..5cc0b7f2189 100644 --- a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/ConcurrentCompositeRaptorRouter.java +++ b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/ConcurrentCompositeRaptorRouter.java @@ -4,6 +4,7 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.function.BiFunction; +import javax.annotation.Nullable; import org.opentripplanner.framework.application.OTPRequestTimeoutException; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; import org.opentripplanner.raptor.api.path.RaptorPath; @@ -21,13 +22,15 @@ public class ConcurrentCompositeRaptorRouter private final RaptorRouter mainWorker; private final RaptorRouter alternativeWorker; private final BiFunction>, Collection>, Collection>> merger; + + @Nullable private final ExecutorService executorService; public ConcurrentCompositeRaptorRouter( RaptorRouter mainWorker, RaptorRouter alternativeWorker, BiFunction>, Collection>, Collection>> merger, - ExecutorService executorService + @Nullable ExecutorService executorService ) { this.mainWorker = mainWorker; this.alternativeWorker = alternativeWorker; From c6801aeba2bedad8873b052685d3f29d5d556da5 Mon Sep 17 00:00:00 2001 From: Teemu Kalvas Date: Fri, 25 Oct 2024 16:03:17 +0300 Subject: [PATCH 064/110] no longer read unstandard brandingUrl for GTFS routes --- .../gtfs/mapping/BrandingMapper.java | 26 ------------------- .../gtfs/mapping/RouteMapper.java | 3 --- .../gtfs/mapping/RouteMapperTest.java | 4 +-- 3 files changed, 2 insertions(+), 31 deletions(-) delete mode 100644 application/src/main/java/org/opentripplanner/gtfs/mapping/BrandingMapper.java diff --git a/application/src/main/java/org/opentripplanner/gtfs/mapping/BrandingMapper.java b/application/src/main/java/org/opentripplanner/gtfs/mapping/BrandingMapper.java deleted file mode 100644 index 5e370335d4e..00000000000 --- a/application/src/main/java/org/opentripplanner/gtfs/mapping/BrandingMapper.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.opentripplanner.gtfs.mapping; - -import javax.annotation.Nullable; -import org.onebusaway.gtfs.model.Route; -import org.opentripplanner.transit.model.framework.FeedScopedId; -import org.opentripplanner.transit.model.organization.Branding; - -/** Responsible for mapping GTFS Route into the OTP Branding model. */ -public class BrandingMapper { - - /** - * Convert GTFS Route entity into OTP Branding model. - * - * @param route GTFS Route entity - * @return OTP branding model. Null if route branding url is not present. - */ - @Nullable - public Branding map(Route route) { - if (route.getBrandingUrl() == null) { - return null; - } - // Make an id from the url, the id is required - var id = new FeedScopedId(route.getId().getAgencyId(), route.getBrandingUrl()); - return Branding.of(id).withUrl(route.getBrandingUrl()).build(); - } -} diff --git a/application/src/main/java/org/opentripplanner/gtfs/mapping/RouteMapper.java b/application/src/main/java/org/opentripplanner/gtfs/mapping/RouteMapper.java index 0c668f64b92..776a829f6b7 100644 --- a/application/src/main/java/org/opentripplanner/gtfs/mapping/RouteMapper.java +++ b/application/src/main/java/org/opentripplanner/gtfs/mapping/RouteMapper.java @@ -15,7 +15,6 @@ class RouteMapper { private final AgencyMapper agencyMapper; - private final BrandingMapper brandingMapper; private final DataImportIssueStore issueStore; @@ -30,7 +29,6 @@ class RouteMapper { ) { this.agencyMapper = agencyMapper; this.issueStore = issueStore; - this.brandingMapper = new BrandingMapper(); this.translationHelper = helper; } @@ -82,7 +80,6 @@ private Route doMap(org.onebusaway.gtfs.model.Route rhs) { lhs.withColor(rhs.getColor()); lhs.withTextColor(rhs.getTextColor()); lhs.withBikesAllowed(BikeAccessMapper.mapForRoute(rhs)); - lhs.withBranding(brandingMapper.map(rhs)); if (rhs.getNetworkId() != null) { var networkId = GroupOfRoutes .of(new FeedScopedId(rhs.getId().getAgencyId(), rhs.getNetworkId())) diff --git a/application/src/test/java/org/opentripplanner/gtfs/mapping/RouteMapperTest.java b/application/src/test/java/org/opentripplanner/gtfs/mapping/RouteMapperTest.java index 2119c7299d0..d245227aad6 100644 --- a/application/src/test/java/org/opentripplanner/gtfs/mapping/RouteMapperTest.java +++ b/application/src/test/java/org/opentripplanner/gtfs/mapping/RouteMapperTest.java @@ -95,9 +95,9 @@ public void testMap() throws Exception { assertEquals(BikeAccess.ALLOWED, result.getBikesAllowed()); assertEquals(SORT_ORDER, result.getGtfsSortOrder()); + // We no longer read the non-standard brandingUrl from gtfs, but if it is supplied, it will not cause an error. Branding branding = result.getBranding(); - assertNotNull(branding); - assertEquals(BRANDING_URL, branding.getUrl()); + assertNull(branding); } @Test From 91cf755cbf9d4d1f2c309b9be2ec82ddd34fce7e Mon Sep 17 00:00:00 2001 From: Eivind Morris Bakke Date: Mon, 28 Oct 2024 08:58:55 +0100 Subject: [PATCH 065/110] Change GraphQL tooltip for searchWindowUsed to say minutes, instead of seconds (#6185) * Changes GraphQL tooltip for searchWindowUsed to say minutes, instead of seconds. * Updates autogenerated graphql schema. --- .../apis/transmodel/model/timetable/TripMetadataType.java | 2 +- .../org/opentripplanner/apis/transmodel/schema.graphql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/model/timetable/TripMetadataType.java b/application/src/main/java/org/opentripplanner/apis/transmodel/model/timetable/TripMetadataType.java index fabae563047..4301b0721c2 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/model/timetable/TripMetadataType.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/model/timetable/TripMetadataType.java @@ -26,7 +26,7 @@ public static GraphQLObjectType create(GraphQLScalarType dateTimeScalar) { "override the value if it is too small or too large. When paging OTP adjusts " + "it to the appropriate size, depending on the number of itineraries found in " + "the current search window. The scaling of the search window ensures faster " + - "paging and limits resource usage. The unit is seconds." + "paging and limits resource usage. The unit is minutes." ) .type(new GraphQLNonNull(Scalars.GraphQLInt)) .dataFetcher(e -> ((TripSearchMetadata) e.getSource()).searchWindowUsed.toMinutes()) diff --git a/application/src/main/resources/org/opentripplanner/apis/transmodel/schema.graphql b/application/src/main/resources/org/opentripplanner/apis/transmodel/schema.graphql index 2f3aef2d9a2..1ef883b4038 100644 --- a/application/src/main/resources/org/opentripplanner/apis/transmodel/schema.graphql +++ b/application/src/main/resources/org/opentripplanner/apis/transmodel/schema.graphql @@ -1382,7 +1382,7 @@ type TripSearchData { nextDateTime: DateTime @deprecated(reason : "Use pageCursor instead") "This is the suggested search time for the \"previous page\" or time-window. Insert it together with the 'searchWindowUsed' in the request to get a new set of trips preceding in the time-window BEFORE the current search." prevDateTime: DateTime @deprecated(reason : "Use pageCursor instead") - "This is the time window used by the raptor search. The input searchWindow is an optional parameter and is dynamically assigned if not set. OTP might override the value if it is too small or too large. When paging OTP adjusts it to the appropriate size, depending on the number of itineraries found in the current search window. The scaling of the search window ensures faster paging and limits resource usage. The unit is seconds." + "This is the time window used by the raptor search. The input searchWindow is an optional parameter and is dynamically assigned if not set. OTP might override the value if it is too small or too large. When paging OTP adjusts it to the appropriate size, depending on the number of itineraries found in the current search window. The scaling of the search window ensures faster paging and limits resource usage. The unit is minutes." searchWindowUsed: Int! } From 76e05c185a6bd302acc3aa7cb35eb30d5b3b073d Mon Sep 17 00:00:00 2001 From: OTP Changelog Bot Date: Mon, 28 Oct 2024 07:59:09 +0000 Subject: [PATCH 066/110] Add changelog entry for #6185 [ci skip] --- doc/user/Changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/user/Changelog.md b/doc/user/Changelog.md index 5e38357a814..228251b34dd 100644 --- a/doc/user/Changelog.md +++ b/doc/user/Changelog.md @@ -21,6 +21,7 @@ based on merged pull requests. Search GitHub issues and pull requests for smalle - Rename StopModel to SiteRepository [#6165](https://github.com/opentripplanner/OpenTripPlanner/pull/6165) - Allow bike walking through bicycle no thru traffic areas [#6179](https://github.com/opentripplanner/OpenTripPlanner/pull/6179) - update the description of mode to cable tram. [#6173](https://github.com/opentripplanner/OpenTripPlanner/pull/6173) +- Change GraphQL tooltip for searchWindowUsed to say minutes, instead of seconds [#6185](https://github.com/opentripplanner/OpenTripPlanner/pull/6185) [](AUTOMATIC_CHANGELOG_PLACEHOLDER_DO_NOT_REMOVE) ## 2.6.0 (2024-09-18) From 3d604570931b04d160721145bf35ce2fadb1b6f8 Mon Sep 17 00:00:00 2001 From: OTP Changelog Bot Date: Mon, 28 Oct 2024 09:11:49 +0000 Subject: [PATCH 067/110] Add changelog entry for #6170 [ci skip] --- doc/user/Changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/user/Changelog.md b/doc/user/Changelog.md index 228251b34dd..c7a89a14922 100644 --- a/doc/user/Changelog.md +++ b/doc/user/Changelog.md @@ -22,6 +22,7 @@ based on merged pull requests. Search GitHub issues and pull requests for smalle - Allow bike walking through bicycle no thru traffic areas [#6179](https://github.com/opentripplanner/OpenTripPlanner/pull/6179) - update the description of mode to cable tram. [#6173](https://github.com/opentripplanner/OpenTripPlanner/pull/6173) - Change GraphQL tooltip for searchWindowUsed to say minutes, instead of seconds [#6185](https://github.com/opentripplanner/OpenTripPlanner/pull/6185) +- Interpret GTFS extended route types 801-899 also as trolleybus service [#6170](https://github.com/opentripplanner/OpenTripPlanner/pull/6170) [](AUTOMATIC_CHANGELOG_PLACEHOLDER_DO_NOT_REMOVE) ## 2.6.0 (2024-09-18) From 785ac677328eeb2563e63b87695025ce4bdb734c Mon Sep 17 00:00:00 2001 From: Teemu Kalvas Date: Mon, 28 Oct 2024 11:25:46 +0200 Subject: [PATCH 068/110] remove route.setBrandingUrl from test, so test won't break if onebusaway removes it as nonstandard --- .../java/org/opentripplanner/gtfs/mapping/RouteMapperTest.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/application/src/test/java/org/opentripplanner/gtfs/mapping/RouteMapperTest.java b/application/src/test/java/org/opentripplanner/gtfs/mapping/RouteMapperTest.java index d245227aad6..56b760a1fd8 100644 --- a/application/src/test/java/org/opentripplanner/gtfs/mapping/RouteMapperTest.java +++ b/application/src/test/java/org/opentripplanner/gtfs/mapping/RouteMapperTest.java @@ -47,8 +47,6 @@ public class RouteMapperTest { private static final Integer SORT_ORDER = 1; - private static final String BRANDING_URL = "www.url.me/brand"; - private static final Route ROUTE = new Route(); private final RouteMapper subject = new RouteMapper( new AgencyMapper(TimetableRepositoryForTest.FEED_ID), @@ -68,7 +66,6 @@ public class RouteMapperTest { ROUTE.setTextColor(TEXT_COLOR); ROUTE.setBikesAllowed(BIKES_ALLOWED); ROUTE.setSortOrder(SORT_ORDER); - ROUTE.setBrandingUrl(BRANDING_URL); } @Test From beba7f200d4251870793a89d9f2c44fe36f81b69 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 28 Oct 2024 14:46:54 +0200 Subject: [PATCH 069/110] Attempt to fix speed tests --- .github/workflows/performance-test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/performance-test.yml b/.github/workflows/performance-test.yml index b185ed260f9..45ea9413d36 100644 --- a/.github/workflows/performance-test.yml +++ b/.github/workflows/performance-test.yml @@ -93,13 +93,12 @@ jobs: - name: Run speed test if: matrix.profile == 'core' || github.ref == 'refs/heads/dev-2.x' - working-directory: application env: PERFORMANCE_INFLUX_DB_PASSWORD: ${{ secrets.PERFORMANCE_INFLUX_DB_PASSWORD }} SPEEDTEST_LOCATION: ${{ matrix.location }} MAVEN_OPTS: "-Xmx50g -XX:StartFlightRecording=delay=${{ matrix.jfr-delay }},duration=30m,filename=${{ matrix.location}}-speed-test.jfr -Dmaven.repo.local=/home/lenni/.m2/repository/" run: | - mvn exec:java -Dexec.mainClass="org.opentripplanner.transit.speed_test.SpeedTest" -Dexec.classpathScope=test -Dexec.args="--dir=../test/performance/${{ matrix.location }} -p md -n ${{ matrix.iterations }} -i 3 -0" -P prettierSkip + mvn exec:java -Dexec.mainClass="org.opentripplanner.transit.speed_test.SpeedTest" -Dexec.classpathScope=test -Dexec.args="--dir=test/performance/${{ matrix.location }} -p md -n ${{ matrix.iterations }} -i 3 -0" -P prettierSkip -pl application -am - name: Archive travel results file if: matrix.profile == 'core' || github.ref == 'refs/heads/dev-2.x' From 8f5af3a0567e5dc4dc41bd75baf798430b7644af Mon Sep 17 00:00:00 2001 From: OTP Changelog Bot Date: Mon, 28 Oct 2024 14:35:53 +0000 Subject: [PATCH 070/110] Add changelog entry for #6194 [ci skip] --- doc/user/Changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/user/Changelog.md b/doc/user/Changelog.md index c7a89a14922..37646716f66 100644 --- a/doc/user/Changelog.md +++ b/doc/user/Changelog.md @@ -23,6 +23,7 @@ based on merged pull requests. Search GitHub issues and pull requests for smalle - update the description of mode to cable tram. [#6173](https://github.com/opentripplanner/OpenTripPlanner/pull/6173) - Change GraphQL tooltip for searchWindowUsed to say minutes, instead of seconds [#6185](https://github.com/opentripplanner/OpenTripPlanner/pull/6185) - Interpret GTFS extended route types 801-899 also as trolleybus service [#6170](https://github.com/opentripplanner/OpenTripPlanner/pull/6170) +- Disable protocol upgrades for the HTTP client by default. [#6194](https://github.com/opentripplanner/OpenTripPlanner/pull/6194) [](AUTOMATIC_CHANGELOG_PLACEHOLDER_DO_NOT_REMOVE) ## 2.6.0 (2024-09-18) From 833e5e33d86c10736874f8ec968ffe850f8ca561 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 20:11:01 +0000 Subject: [PATCH 071/110] fix(deps): update dependency org.apache.httpcomponents.client5:httpclient5 to v5.4.1 --- application/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/pom.xml b/application/pom.xml index b13806e6a0a..4a7afe8747b 100644 --- a/application/pom.xml +++ b/application/pom.xml @@ -325,7 +325,7 @@ org.apache.httpcomponents.client5 httpclient5 - 5.4 + 5.4.1 commons-cli From 6fdfef894c579e859571b155de234246e56d9d4b Mon Sep 17 00:00:00 2001 From: Sam Kim <21956685+sam-k@users.noreply.github.com> Date: Mon, 28 Oct 2024 15:50:20 -0700 Subject: [PATCH 072/110] Address PR comments --- doc/dev/decisionrecords/Codestyle.md | 11 +++++------ doc/dev/decisionrecords/NamingConventions.md | 2 +- doc/dev/decisionrecords/RecordsPOJOsBuilders.md | 4 ++-- doc/dev/decisionrecords/UseDecisionRecords.md | 2 +- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/doc/dev/decisionrecords/Codestyle.md b/doc/dev/decisionrecords/Codestyle.md index 72db4796291..170c592f437 100644 --- a/doc/dev/decisionrecords/Codestyle.md +++ b/doc/dev/decisionrecords/Codestyle.md @@ -53,7 +53,7 @@ But, if you have set a custom code style in your settings (as we used until OTP to change to the _Project_ code style. Open the `Preferences` from the menu and select _Editor > Code Style_. Then select **Project** in the \_Scheme drop down. -#### Run Prettier Maven Plugin as an external tool in IntelliJ +#### Run Prettier Maven Plugin as an External Tool in IntelliJ You can run the Prettier Maven plugin as an external tool in IntelliJ. Set it up as an `External tool` and assign a keyboard shortcut to the tool execution. @@ -70,7 +70,7 @@ Working Directory: $ProjectFileDir$ > **Tip!** Add an unused key shortcut to execute the external tool. Then you can use the old > shortcut to format other file types. -#### Install File Watchers plugin in IntelliJ +#### Install File Watchers Plugin in IntelliJ You can also configure IntelliJ to run Prettier every time IntelliJ saves a Java file. But if you are editing the file at the same time, you will get a warning that the file in memory and the file @@ -106,9 +106,8 @@ feel free to share it. Some of the classes in OTP have a lot of fields and methods. Keeping members sorted reduces merge conflicts. Adding fields and methods to the end of the list will cause merge conflicts more often -than will inserting methods and fields in an ordered list. Fields and methods can be sorted in -"feature" sections or alphabetically, but stick to it and respect it when adding new methods and -fields. +than inserting methods and fields in an ordered list. Fields and methods can be sorted in "feature" +sections or alphabetically, but stick to it and respect it when adding new methods and fields. The provided formatter will group class members in this order: @@ -166,7 +165,7 @@ context. Please avoid including trivial Javadoc or the empty Javadoc stubs added - On fields: - Fields should be marked as `@Nullable` if they are nullable. -Use of `@NonNull` annotation is not allowed. It should be assumed methods/parameters/fields are +Use of `@Nonnull` annotation is not allowed. It should be assumed methods/parameters/fields are non-null if they are not marked as `@Nullable`. However, there are places where the `@Nullable` annotation is missing even if it should have been used. Those can be updated to use the `@Nullable` annotation. diff --git a/doc/dev/decisionrecords/NamingConventions.md b/doc/dev/decisionrecords/NamingConventions.md index 0c7cd201d7d..53c783950d9 100644 --- a/doc/dev/decisionrecords/NamingConventions.md +++ b/doc/dev/decisionrecords/NamingConventions.md @@ -63,7 +63,7 @@ them. Naming convention for builders with and without a context. -#### Graph builds and tests run without a context +#### Graph Builds and Tests Run Without a Context ```java // Create a new Stop diff --git a/doc/dev/decisionrecords/RecordsPOJOsBuilders.md b/doc/dev/decisionrecords/RecordsPOJOsBuilders.md index 3112760cbe7..d34fd3ab6b7 100644 --- a/doc/dev/decisionrecords/RecordsPOJOsBuilders.md +++ b/doc/dev/decisionrecords/RecordsPOJOsBuilders.md @@ -27,7 +27,7 @@ types of these fields. OTP used a simple builder pattern in many places, especially when creating immutable types. -#### Builder conventions +#### Builder Conventions - Use factory methods to create builder—either `of` or `copyOf`. The `copyOf` uses an existing instance as its base. The `of` creates a builder with all default values set. All constructors @@ -47,7 +47,7 @@ OTP used a simple builder pattern in many places, especially when creating immut - For nested builders, see the field `nested` in the example.

- Builder example + Builder Example ```java /** diff --git a/doc/dev/decisionrecords/UseDecisionRecords.md b/doc/dev/decisionrecords/UseDecisionRecords.md index 0c07f89fd12..9635c36fe88 100644 --- a/doc/dev/decisionrecords/UseDecisionRecords.md +++ b/doc/dev/decisionrecords/UseDecisionRecords.md @@ -15,7 +15,7 @@ a bit more discussion and explanation, then we will create a PR with a document Use the [template](/doc/dev/decisionrecords/_TEMPLATE.md) as a starting point for documenting the decision. -### How to discuss and document a Decision Record +### How to Discuss and Document a Decision Record - Create a new pull request and describe the decision record by adding a document to the `/doc/dev/decisionrecords` folder. Use the [template](/doc/dev/decisionrecords/_TEMPLATE.md). From 7d4bdf271add54801810dcf1cbe9185923ab4a48 Mon Sep 17 00:00:00 2001 From: Sam Kim <21956685+sam-k@users.noreply.github.com> Date: Mon, 28 Oct 2024 15:54:49 -0700 Subject: [PATCH 073/110] Minor edits --- doc/dev/decisionrecords/UseDecisionRecords.md | 2 +- doc/dev/decisionrecords/_TEMPLATE.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/dev/decisionrecords/UseDecisionRecords.md b/doc/dev/decisionrecords/UseDecisionRecords.md index 9635c36fe88..0cdca42e16d 100644 --- a/doc/dev/decisionrecords/UseDecisionRecords.md +++ b/doc/dev/decisionrecords/UseDecisionRecords.md @@ -2,7 +2,7 @@ An OTP Decision Record is a justified software design choice that addresses a significant functional or non-functional requirement. [Architectural Decision Records](https://adr.github.io/) -is a similar concept, but we have widened the scope to include any relevant decision about OTP +is a similar concept, but we have widened the scope to include any relevant decision about OTP development. ## Process diff --git a/doc/dev/decisionrecords/_TEMPLATE.md b/doc/dev/decisionrecords/_TEMPLATE.md index b628d74c6a7..88c492ca2df 100644 --- a/doc/dev/decisionrecords/_TEMPLATE.md +++ b/doc/dev/decisionrecords/_TEMPLATE.md @@ -6,7 +6,7 @@ document later. --> -Original pull-request: {#NNNN} +Original pull request: {#NNNN} ### Context and Problem Statement @@ -20,7 +20,7 @@ Original pull-request: {#NNNN} - -### Decision & Consequences +### Decision and Consequences From 7b55ee03e3c0642f80c0335ec4fda892fc5aa1d6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 02:24:54 +0000 Subject: [PATCH 074/110] fix(deps): update jackson.version to v2.18.1 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e590501e6c4..57539cd8144 100644 --- a/pom.xml +++ b/pom.xml @@ -62,7 +62,7 @@ 32.0 2.52 - 2.18.0 + 2.18.1 3.1.9 5.11.2 1.13.5 From 59b31ad1d7c0a1730bb52816635478943ff109ea Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Tue, 29 Oct 2024 17:19:48 +0100 Subject: [PATCH 075/110] Update performance-test.yml Fix and run performance tests with Multi-module Mavan --- .github/workflows/performance-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/performance-test.yml b/.github/workflows/performance-test.yml index 45ea9413d36..79d61098f5c 100644 --- a/.github/workflows/performance-test.yml +++ b/.github/workflows/performance-test.yml @@ -98,7 +98,7 @@ jobs: SPEEDTEST_LOCATION: ${{ matrix.location }} MAVEN_OPTS: "-Xmx50g -XX:StartFlightRecording=delay=${{ matrix.jfr-delay }},duration=30m,filename=${{ matrix.location}}-speed-test.jfr -Dmaven.repo.local=/home/lenni/.m2/repository/" run: | - mvn exec:java -Dexec.mainClass="org.opentripplanner.transit.speed_test.SpeedTest" -Dexec.classpathScope=test -Dexec.args="--dir=test/performance/${{ matrix.location }} -p md -n ${{ matrix.iterations }} -i 3 -0" -P prettierSkip -pl application -am + mvn --projects application exec:java -Dexec.mainClass="org.opentripplanner.transit.speed_test.SpeedTest" -Dexec.classpathScope=test -Dexec.args="--dir=test/performance/${{ matrix.location }} -p md -n ${{ matrix.iterations }} -i 3 -0" - name: Archive travel results file if: matrix.profile == 'core' || github.ref == 'refs/heads/dev-2.x' From 447adcfcd82bac22203cdd04ff3af84fd69f9ecd Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Tue, 29 Oct 2024 17:39:12 +0100 Subject: [PATCH 076/110] Fix and run performance tests - install jars to make them available in sub-modules --- .github/workflows/performance-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/performance-test.yml b/.github/workflows/performance-test.yml index 79d61098f5c..1e470d2f83c 100644 --- a/.github/workflows/performance-test.yml +++ b/.github/workflows/performance-test.yml @@ -83,7 +83,7 @@ jobs: if: matrix.profile == 'core' || github.ref == 'refs/heads/dev-2.x' env: MAVEN_OPTS: "-Dmaven.repo.local=/home/lenni/.m2/repository/" - run: mvn -DskipTests --batch-mode package -P prettierSkip + run: mvn -DskipTests --batch-mode install -P prettierSkip - name: Build graph if: matrix.profile == 'core' || github.ref == 'refs/heads/dev-2.x' @@ -98,7 +98,7 @@ jobs: SPEEDTEST_LOCATION: ${{ matrix.location }} MAVEN_OPTS: "-Xmx50g -XX:StartFlightRecording=delay=${{ matrix.jfr-delay }},duration=30m,filename=${{ matrix.location}}-speed-test.jfr -Dmaven.repo.local=/home/lenni/.m2/repository/" run: | - mvn --projects application exec:java -Dexec.mainClass="org.opentripplanner.transit.speed_test.SpeedTest" -Dexec.classpathScope=test -Dexec.args="--dir=test/performance/${{ matrix.location }} -p md -n ${{ matrix.iterations }} -i 3 -0" + mvn exec:java -Dexec.mainClass="org.opentripplanner.transit.speed_test.SpeedTest" -Dexec.classpathScope=test -Dexec.args="--dir=test/performance/${{ matrix.location }} -p md -n ${{ matrix.iterations }} -i 3 -0" -P prettierSkip -pl application -am - name: Archive travel results file if: matrix.profile == 'core' || github.ref == 'refs/heads/dev-2.x' From 433acece5656666835fc92de6f2595408625183f Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Tue, 29 Oct 2024 17:52:37 +0100 Subject: [PATCH 077/110] Fix and run performance tests - run SpeedTest with the application aggregator --- .github/workflows/performance-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/performance-test.yml b/.github/workflows/performance-test.yml index 1e470d2f83c..ad3b843dd12 100644 --- a/.github/workflows/performance-test.yml +++ b/.github/workflows/performance-test.yml @@ -98,7 +98,7 @@ jobs: SPEEDTEST_LOCATION: ${{ matrix.location }} MAVEN_OPTS: "-Xmx50g -XX:StartFlightRecording=delay=${{ matrix.jfr-delay }},duration=30m,filename=${{ matrix.location}}-speed-test.jfr -Dmaven.repo.local=/home/lenni/.m2/repository/" run: | - mvn exec:java -Dexec.mainClass="org.opentripplanner.transit.speed_test.SpeedTest" -Dexec.classpathScope=test -Dexec.args="--dir=test/performance/${{ matrix.location }} -p md -n ${{ matrix.iterations }} -i 3 -0" -P prettierSkip -pl application -am + mvn --projects application exec:java -Dexec.mainClass="org.opentripplanner.transit.speed_test.SpeedTest" -Dexec.classpathScope=test -Dexec.args="--dir=test/performance/${{ matrix.location }} -p md -n ${{ matrix.iterations }} -i 3 -0" - name: Archive travel results file if: matrix.profile == 'core' || github.ref == 'refs/heads/dev-2.x' From 17de4e571e0e3e6854ecfcbb27e43f8fcd017d30 Mon Sep 17 00:00:00 2001 From: OTP Changelog Bot Date: Tue, 29 Oct 2024 19:49:35 +0000 Subject: [PATCH 078/110] Add changelog entry for #6189 [ci skip] --- doc/user/Changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/user/Changelog.md b/doc/user/Changelog.md index 37646716f66..a38cce53676 100644 --- a/doc/user/Changelog.md +++ b/doc/user/Changelog.md @@ -24,6 +24,7 @@ based on merged pull requests. Search GitHub issues and pull requests for smalle - Change GraphQL tooltip for searchWindowUsed to say minutes, instead of seconds [#6185](https://github.com/opentripplanner/OpenTripPlanner/pull/6185) - Interpret GTFS extended route types 801-899 also as trolleybus service [#6170](https://github.com/opentripplanner/OpenTripPlanner/pull/6170) - Disable protocol upgrades for the HTTP client by default. [#6194](https://github.com/opentripplanner/OpenTripPlanner/pull/6194) +- Fix max search-window when paging [#6189](https://github.com/opentripplanner/OpenTripPlanner/pull/6189) [](AUTOMATIC_CHANGELOG_PLACEHOLDER_DO_NOT_REMOVE) ## 2.6.0 (2024-09-18) From aa0c69cde738a9fa75bcb6be630f6c3252b0efd9 Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Tue, 29 Oct 2024 21:03:46 +0100 Subject: [PATCH 079/110] Apply suggestions from code review Co-authored-by: Vincent Paturet <46598384+vpaturet@users.noreply.github.com> Co-authored-by: Henrik Abrahamsson <127481124+habrahamsson-skanetrafiken@users.noreply.github.com> --- .../ext/sorlandsbanen/CoachCostCalculator.java | 2 +- .../org/opentripplanner/ext/sorlandsbanen/MergePaths.java | 2 +- .../ext/sorlandsbanen/SorlandsbanenNorwayService.java | 6 +++--- .../opentripplanner/framework/application/OTPFeature.java | 2 +- .../opentripplanner/framework/geometry/WgsCoordinate.java | 2 +- .../raptor/rangeraptor/CompositeResult.java | 8 ++++---- .../rangeraptor/ConcurrentCompositeRaptorRouter.java | 2 +- .../opentripplanner/raptor/spi/ExtraMcRouterSearch.java | 4 ++-- doc/user/sandbox/Sorlandsbanen.md | 6 +++--- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/CoachCostCalculator.java b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/CoachCostCalculator.java index 204878072d5..89a3071f975 100644 --- a/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/CoachCostCalculator.java +++ b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/CoachCostCalculator.java @@ -56,7 +56,7 @@ public int transitArrivalCost( ) { int cost = delegate.transitArrivalCost(boardCost, alightSlack, transitTime, trip, toStop); - // This is a bit ugly, since it relays on the fact that the 'transitReluctanceFactorIndex' + // This is a bit ugly, since it relies on the fact that the 'transitReluctanceFactorIndex' // returns the 'route.getMode().ordinal()' if(trip.transitReluctanceFactorIndex() == TransitMode.COACH.ordinal()) { cost += transitTime * EXTRA_RELUCTANCE_ON_COACH; diff --git a/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/MergePaths.java b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/MergePaths.java index 8abf35ffa4c..2f7b38a7a08 100644 --- a/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/MergePaths.java +++ b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/MergePaths.java @@ -35,7 +35,7 @@ private void addRailToMap(Map> map, Collection it); } } diff --git a/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/SorlandsbanenNorwayService.java b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/SorlandsbanenNorwayService.java index 9314400c649..ecccb5d2370 100644 --- a/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/SorlandsbanenNorwayService.java +++ b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/SorlandsbanenNorwayService.java @@ -19,9 +19,9 @@ /** * This service is responsible for producing results with rail for the south of Norway. The rail - * line is called "Sørlandsbanen". This rail line is slow and goes inland fare from where people + * line is called "Sørlandsbanen". This rail line is slow and goes inland far from where people * live. Despite this, people and the operator want to show it in the results for log travel along - * the southern part of Norway where ii is an option. Tuning the search has proven to be + * the southern part of Norway where it is an option. Tuning the search has proven to be * challenging. It is solved here by doing two searches. One normal search and one where the rail * is given a big cost advantage over coach. If train results are found in the second search, then * it is added to the results of the first search. Everything found in the first search is always @@ -72,7 +72,7 @@ public BiFunction>, Collection implements RaptorRouterResult { - public static final String UNSOPORTED_OPERATION = + private static final String UNSUPPORTED_OPERATION = "Merging all stop arrivals will be a complicated and memory intensive process, unless we need this this should not be done."; private final Collection> result; @@ -39,17 +39,17 @@ public Collection> extractPaths() { @Override public SingleCriteriaStopArrivals extractBestOverallArrivals() { - throw new UnsupportedOperationException(UNSOPORTED_OPERATION); + throw new UnsupportedOperationException(UNSUPPORTED_OPERATION); } @Override public SingleCriteriaStopArrivals extractBestTransitArrivals() { - throw new UnsupportedOperationException(UNSOPORTED_OPERATION); + throw new UnsupportedOperationException(UNSUPPORTED_OPERATION); } @Override public SingleCriteriaStopArrivals extractBestNumberOfTransfers() { - throw new UnsupportedOperationException(UNSOPORTED_OPERATION); + throw new UnsupportedOperationException(UNSUPPORTED_OPERATION); } /** diff --git a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/ConcurrentCompositeRaptorRouter.java b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/ConcurrentCompositeRaptorRouter.java index 5cc0b7f2189..a4ddf36347f 100644 --- a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/ConcurrentCompositeRaptorRouter.java +++ b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/ConcurrentCompositeRaptorRouter.java @@ -12,7 +12,7 @@ import org.opentripplanner.raptor.rangeraptor.internalapi.RaptorRouterResult; /** - * Run two Raptor routers and join the result. The two searches are run concurrent if an + * Run two Raptor routers and join the result. The two searches are run concurrently if an * {@link ExecutorService} is provided. * @see CompositeResult for joining results. */ diff --git a/application/src/main/java/org/opentripplanner/raptor/spi/ExtraMcRouterSearch.java b/application/src/main/java/org/opentripplanner/raptor/spi/ExtraMcRouterSearch.java index deb22107036..e6fdc4fd0d0 100644 --- a/application/src/main/java/org/opentripplanner/raptor/spi/ExtraMcRouterSearch.java +++ b/application/src/main/java/org/opentripplanner/raptor/spi/ExtraMcRouterSearch.java @@ -6,7 +6,7 @@ import org.opentripplanner.raptor.api.path.RaptorPath; /** - * This interface is used to run two mulit-criteria searches and merging the result. Raptor will + * This interface is used to run two multi-criteria searches and merging the result. Raptor will * run the heuristics as normal. Then create two multi-criteria searches, the main search and the * alternative search. The caller must provide a {@code merger} and * {@link RaptorTransitDataProvider}. The transit data is used for the alternative search. This @@ -17,7 +17,7 @@ * For the heuristics to work, you may add extra cost or filter away data. But you cannot decrease * the cost, add transfer or add new trips. *

- * This will alter the multi-criteria search, if only a sadard search is requested any extra + * This will alter the multi-criteria search, if only a standard search is requested any extra * multi-criteria search is ignored. *

* @param The TripSchedule type defined by the user of the raptor API. diff --git a/doc/user/sandbox/Sorlandsbanen.md b/doc/user/sandbox/Sorlandsbanen.md index 4898a29af37..b9846da0f37 100644 --- a/doc/user/sandbox/Sorlandsbanen.md +++ b/doc/user/sandbox/Sorlandsbanen.md @@ -3,7 +3,7 @@ **This sandbox module is only working in Norway**, in particular only in the south of Norway. The feature flag to turn it *on* should only be enabled if you are routing using the norwegian data set. -The railroad in southern Norway is very slow and does not go by the cost where most people live. It +The railroad in southern Norway is very slow and does not go by the coast where most people live. It is easily beaten by coaches in the area. Despite this, we need to include it in results where it is relevant. @@ -24,8 +24,8 @@ in addition to the feature flag. ## Changelog -- 2024-10-14: We have used this feature for som time, but now want it in the Sandbox so we do not - need to merge it everytime we create a new entur release. +- 2024-10-14: We have used this feature for some time, but now want it in the Sandbox so we do not + need to merge it everytime we create a new Entur release. ### Configuration From d5527761c13a68e12593ea5d0bf9a0fee26bbd70 Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Tue, 29 Oct 2024 21:24:16 +0100 Subject: [PATCH 080/110] review: Update JavaDoc for PathKey --- .../opentripplanner/ext/sorlandsbanen/PathKey.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/PathKey.java b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/PathKey.java index 9d0d1a14936..e4504b3ed14 100644 --- a/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/PathKey.java +++ b/application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/PathKey.java @@ -5,10 +5,15 @@ /** - * Uses a hash to create a key for access, egress and transit legs in a path. Transfers - * are not included. The key is used to exclude duplicates. This approach may drop valid results - * when there is a hash collision, but this whole sandbox feature is a hack - so we can tolerate - * this here. + * The purpose of this class is to create a key to be able to compare paths so duplicate results + * can be ignored. + *

+ * Creating a good key for a path is not easy. For example, should a small variation in the street + * routing for an access/egress leg count as a significant difference? The solution here is + * straightforward. It creates a hash of the access-, egress- and transit-legs in the path, + * ignoring transfer legs. This approach may drop valid results if there are hash collisions, + * but since this is a Sandbox module and the investment in this code is minimal, we will accept + * the risk. */ final class PathKey { From a3548650878377c8b0a60ca018196c2090b95486 Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Tue, 29 Oct 2024 21:24:49 +0100 Subject: [PATCH 081/110] review: Generate updated doc --- doc/user/Configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/user/Configuration.md b/doc/user/Configuration.md index a45e4253a06..8d94e332e40 100644 --- a/doc/user/Configuration.md +++ b/doc/user/Configuration.md @@ -250,7 +250,7 @@ Here is a list of all features which can be toggled on/off and their default val | `SandboxAPIGeocoder` | Enable the Geocoder API. | | ✓️ | | `SandboxAPIMapboxVectorTilesApi` | Enable Mapbox vector tiles API. | | ✓️ | | `SandboxAPIParkAndRideApi` | Enable park-and-ride endpoint. | | ✓️ | -| `Sorlandsbanen` | Include train Sørlandsbanen in results when searchig in south of Norway. Only relevant in Norway. | | ✓️ | +| `Sorlandsbanen` | Include train Sørlandsbanen in results when searching in south of Norway. Only relevant in Norway. | | ✓️ | | `TransferAnalyzer` | Analyze transfers during graph build. | | ✓️ | From eb5588750fffa03d3414a3983c9e2f0f938e6ba8 Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Tue, 29 Oct 2024 21:42:24 +0100 Subject: [PATCH 082/110] review: Improve Sandbox documentation --- doc/user/sandbox/Sorlandsbanen.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/user/sandbox/Sorlandsbanen.md b/doc/user/sandbox/Sorlandsbanen.md index b9846da0f37..13bc9163456 100644 --- a/doc/user/sandbox/Sorlandsbanen.md +++ b/doc/user/sandbox/Sorlandsbanen.md @@ -14,8 +14,11 @@ rail results(if they exist) from the second search and add it two to the results search. The new set of results will contain everything we found in the first search, plus the train results in the second results. -Note! This is a hack and the logic to enable this look at the origin and destination coordinates -in addition to the feature flag. +Note! This looks at origin and destination coordinates in addition to the feature flag to enable +the second search. It is automatically enabled if: + - the `OTPFeature.Sorlandsbanen` is on. + - the origin and/or destination is in the south of Norway. + - the search is a long-distance search, origin and destination are fare apart from each other. ## Contact Info From d49c4a6850b48147ee827a5b46bef5212d575200 Mon Sep 17 00:00:00 2001 From: OTP Changelog Bot Date: Tue, 29 Oct 2024 21:37:14 +0000 Subject: [PATCH 083/110] Add changelog entry for #5966 [ci skip] --- doc/user/Changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/user/Changelog.md b/doc/user/Changelog.md index a38cce53676..4ed08a6fafe 100644 --- a/doc/user/Changelog.md +++ b/doc/user/Changelog.md @@ -25,6 +25,7 @@ based on merged pull requests. Search GitHub issues and pull requests for smalle - Interpret GTFS extended route types 801-899 also as trolleybus service [#6170](https://github.com/opentripplanner/OpenTripPlanner/pull/6170) - Disable protocol upgrades for the HTTP client by default. [#6194](https://github.com/opentripplanner/OpenTripPlanner/pull/6194) - Fix max search-window when paging [#6189](https://github.com/opentripplanner/OpenTripPlanner/pull/6189) +- Add car ferry functionality [#5966](https://github.com/opentripplanner/OpenTripPlanner/pull/5966) [](AUTOMATIC_CHANGELOG_PLACEHOLDER_DO_NOT_REMOVE) ## 2.6.0 (2024-09-18) From 53a2132fe4d6e50778d8fe46d27b6978eb189a73 Mon Sep 17 00:00:00 2001 From: OTP Serialization Version Bot Date: Tue, 29 Oct 2024 21:37:37 +0000 Subject: [PATCH 084/110] Bump serialization version id for #5966 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e590501e6c4..9b19d252bd9 100644 --- a/pom.xml +++ b/pom.xml @@ -58,7 +58,7 @@ - 167 + 168 32.0 2.52 From cfc2b412eb8f0091d10994c0d17e8658d4f90537 Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Tue, 22 Oct 2024 23:20:08 +0200 Subject: [PATCH 085/110] Create OTP framework module for "extended" programming language features. --- application/pom.xml | 5 +++ .../framework/collection/ToveUtils.java | 17 ++++++++ .../graph_builder/module/osm/DisjointSet.java | 4 +- .../graph_builder/module/osm/OsmDatabase.java | 6 +-- framework/pom.xml | 41 +++++++++++++++++++ .../framework/collection/CollectionUtils.java | 0 .../framework/collection/CollectionsView.java | 0 .../collection/CompositeComparator.java | 0 .../framework/collection/ListSection.java | 0 .../framework/collection/ListUtils.java | 0 .../framework/collection/MapUtils.java | 12 ------ .../framework/collection/SetUtils.java | 0 .../framework/lang/ArrayUtils.java | 0 .../framework/lang/BitSetUtils.java | 0 .../opentripplanner/framework/lang/Box.java | 0 .../framework/lang/DoubleUtils.java | 0 .../framework/lang/IntBox.java | 0 .../framework/lang/IntRange.java | 0 .../framework/lang/IntUtils.java | 0 .../lang/MemEfficientArrayBuilder.java | 0 .../framework/lang/ObjectUtils.java | 0 .../framework/lang/OtpNumberFormat.java | 0 .../framework/lang/Sandbox.java | 0 .../framework/lang/StringUtils.java | 0 .../framework/logging/ProgressTracker.java | 0 .../logging/ProgressTrackerInputStream.java | 0 .../logging/ProgressTrackerOutputStream.java | 0 .../framework/logging/Throttle.java | 0 .../text/CharacterEscapeFormatter.java | 0 .../text/FileSizeToTextConverter.java | 0 .../framework/text/HexString.java | 0 .../framework/text/MarkdownFormatter.java | 0 .../opentripplanner/framework/text/Table.java | 0 .../framework/text/TableBuilder.java | 0 .../framework/text/TableRowFormatter.java | 0 .../framework/time/CountdownTimer.java | 0 .../framework/time/DateUtils.java | 0 .../framework/time/DurationUtils.java | 0 .../framework/time/LocalDateUtils.java | 0 .../framework/time/OffsetDateTimeParser.java | 0 .../framework/time/RelativeTime.java | 0 .../framework/time/ServiceDateUtils.java | 0 .../framework/time/TimeUtils.java | 0 .../tostring/MultiLineToStringBuilder.java | 0 .../framework/tostring/ToStringBuilder.java | 0 .../tostring/ValueObjectToStringBuilder.java | 0 .../collection/CollectionUtilsTest.java | 2 +- .../collection/CollectionsViewTest.java | 0 .../collection/CompositeComparatorTest.java | 0 .../framework/collection/ListSectionTest.java | 0 .../framework/collection/ListUtilsTest.java | 0 .../framework/collection/MapUtilsTest.java | 0 .../framework/collection/SetUtilsTest.java | 0 .../framework/lang/ArrayUtilsTest.java | 0 .../framework/lang/BitSetUtilsTest.java | 0 .../framework/lang/BoxTest.java | 0 .../framework/lang/DoubleUtilsTest.java | 0 .../framework/lang/IntBoxTest.java | 0 .../framework/lang/IntRangeTest.java | 0 .../framework/lang/IntUtilsTest.java | 0 .../lang/MemEfficientArrayBuilderTest.java | 0 .../framework/lang/ObjectUtilsTest.java | 0 .../framework/lang/OtpNumberFormatTest.java | 0 .../framework/lang/StringUtilsTest.java | 0 .../logging/ProgressTrackerTest.java | 0 .../framework/logging/ThrottleTest.java | 0 .../text/CharacterEscapeFormatterTest.java | 0 .../text/FileSizeToTextConverterTest.java | 0 .../framework/text/HexStringTest.java | 0 .../framework/text/MarkdownFormatterTest.java | 0 .../framework/text/TableTest.java | 0 .../framework/time/CountdownTimerTest.java | 0 .../framework/time/DateUtilsTest.java | 1 - .../framework/time/DurationUtilsTest.java | 0 .../framework/time/LocalDateUtilsTest.java | 0 .../time/OffsetDateTimeParserTest.java | 0 .../framework/time/ServiceDateUtilsTest.java | 1 - .../framework/time/TimeUtilsTest.java | 1 - .../framework/time/ZoneIds.java | 11 +++++ .../MultiLineToStringBuilderTest.java | 0 .../tostring/ToStringBuilderTest.java | 2 +- .../ValueObjectToStringBuilderTest.java | 0 pom.xml | 1 + 83 files changed, 82 insertions(+), 22 deletions(-) create mode 100644 application/src/main/java/org/opentripplanner/framework/collection/ToveUtils.java create mode 100644 framework/pom.xml rename {application => framework}/src/main/java/org/opentripplanner/framework/collection/CollectionUtils.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/collection/CollectionsView.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/collection/CompositeComparator.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/collection/ListSection.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/collection/ListUtils.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/collection/MapUtils.java (77%) rename {application => framework}/src/main/java/org/opentripplanner/framework/collection/SetUtils.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/lang/ArrayUtils.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/lang/BitSetUtils.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/lang/Box.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/lang/DoubleUtils.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/lang/IntBox.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/lang/IntRange.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/lang/IntUtils.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/lang/MemEfficientArrayBuilder.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/lang/ObjectUtils.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/lang/OtpNumberFormat.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/lang/Sandbox.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/lang/StringUtils.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/logging/ProgressTracker.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/logging/ProgressTrackerInputStream.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/logging/ProgressTrackerOutputStream.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/logging/Throttle.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/text/CharacterEscapeFormatter.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/text/FileSizeToTextConverter.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/text/HexString.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/text/MarkdownFormatter.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/text/Table.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/text/TableBuilder.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/text/TableRowFormatter.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/time/CountdownTimer.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/time/DateUtils.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/time/DurationUtils.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/time/LocalDateUtils.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/time/OffsetDateTimeParser.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/time/RelativeTime.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/time/ServiceDateUtils.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/time/TimeUtils.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/tostring/MultiLineToStringBuilder.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/tostring/ToStringBuilder.java (100%) rename {application => framework}/src/main/java/org/opentripplanner/framework/tostring/ValueObjectToStringBuilder.java (100%) rename {application => framework}/src/test/java/org/opentripplanner/framework/collection/CollectionUtilsTest.java (98%) rename {application => framework}/src/test/java/org/opentripplanner/framework/collection/CollectionsViewTest.java (100%) rename {application => framework}/src/test/java/org/opentripplanner/framework/collection/CompositeComparatorTest.java (100%) rename {application => framework}/src/test/java/org/opentripplanner/framework/collection/ListSectionTest.java (100%) rename {application => framework}/src/test/java/org/opentripplanner/framework/collection/ListUtilsTest.java (100%) rename {application => framework}/src/test/java/org/opentripplanner/framework/collection/MapUtilsTest.java (100%) rename {application => framework}/src/test/java/org/opentripplanner/framework/collection/SetUtilsTest.java (100%) rename {application => framework}/src/test/java/org/opentripplanner/framework/lang/ArrayUtilsTest.java (100%) rename {application => framework}/src/test/java/org/opentripplanner/framework/lang/BitSetUtilsTest.java (100%) rename {application => framework}/src/test/java/org/opentripplanner/framework/lang/BoxTest.java (100%) rename {application => framework}/src/test/java/org/opentripplanner/framework/lang/DoubleUtilsTest.java (100%) rename {application => framework}/src/test/java/org/opentripplanner/framework/lang/IntBoxTest.java (100%) rename {application => framework}/src/test/java/org/opentripplanner/framework/lang/IntRangeTest.java (100%) rename {application => framework}/src/test/java/org/opentripplanner/framework/lang/IntUtilsTest.java (100%) rename {application => framework}/src/test/java/org/opentripplanner/framework/lang/MemEfficientArrayBuilderTest.java (100%) rename {application => framework}/src/test/java/org/opentripplanner/framework/lang/ObjectUtilsTest.java (100%) rename {application => framework}/src/test/java/org/opentripplanner/framework/lang/OtpNumberFormatTest.java (100%) rename {application => framework}/src/test/java/org/opentripplanner/framework/lang/StringUtilsTest.java (100%) rename {application => framework}/src/test/java/org/opentripplanner/framework/logging/ProgressTrackerTest.java (100%) rename {application => framework}/src/test/java/org/opentripplanner/framework/logging/ThrottleTest.java (100%) rename {application => framework}/src/test/java/org/opentripplanner/framework/text/CharacterEscapeFormatterTest.java (100%) rename {application => framework}/src/test/java/org/opentripplanner/framework/text/FileSizeToTextConverterTest.java (100%) rename {application => framework}/src/test/java/org/opentripplanner/framework/text/HexStringTest.java (100%) rename {application => framework}/src/test/java/org/opentripplanner/framework/text/MarkdownFormatterTest.java (100%) rename {application => framework}/src/test/java/org/opentripplanner/framework/text/TableTest.java (100%) rename {application => framework}/src/test/java/org/opentripplanner/framework/time/CountdownTimerTest.java (100%) rename {application => framework}/src/test/java/org/opentripplanner/framework/time/DateUtilsTest.java (98%) rename {application => framework}/src/test/java/org/opentripplanner/framework/time/DurationUtilsTest.java (100%) rename {application => framework}/src/test/java/org/opentripplanner/framework/time/LocalDateUtilsTest.java (100%) rename {application => framework}/src/test/java/org/opentripplanner/framework/time/OffsetDateTimeParserTest.java (100%) rename {application => framework}/src/test/java/org/opentripplanner/framework/time/ServiceDateUtilsTest.java (99%) rename {application => framework}/src/test/java/org/opentripplanner/framework/time/TimeUtilsTest.java (99%) create mode 100644 framework/src/test/java/org/opentripplanner/framework/time/ZoneIds.java rename {application => framework}/src/test/java/org/opentripplanner/framework/tostring/MultiLineToStringBuilderTest.java (100%) rename {application => framework}/src/test/java/org/opentripplanner/framework/tostring/ToStringBuilderTest.java (99%) rename {application => framework}/src/test/java/org/opentripplanner/framework/tostring/ValueObjectToStringBuilderTest.java (100%) diff --git a/application/pom.xml b/application/pom.xml index b13806e6a0a..60765797344 100644 --- a/application/pom.xml +++ b/application/pom.xml @@ -18,6 +18,11 @@ gtfs-realtime-protobuf ${project.version} + + ${project.groupId} + otp-framework + ${project.version} + diff --git a/application/src/main/java/org/opentripplanner/framework/collection/ToveUtils.java b/application/src/main/java/org/opentripplanner/framework/collection/ToveUtils.java new file mode 100644 index 00000000000..5958845e2b5 --- /dev/null +++ b/application/src/main/java/org/opentripplanner/framework/collection/ToveUtils.java @@ -0,0 +1,17 @@ +package org.opentripplanner.framework.collection; + +import gnu.trove.map.TLongObjectMap; +import java.util.HashSet; +import java.util.Set; + +public class ToveUtils { + + public static void addToMapSet(TLongObjectMap> mapSet, long key, U value) { + Set set = mapSet.get(key); + if (set == null) { + set = new HashSet<>(); + mapSet.put(key, set); + } + set.add(value); + } +} diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/osm/DisjointSet.java b/application/src/main/java/org/opentripplanner/graph_builder/module/osm/DisjointSet.java index 15bfc3605b5..369e5c20a14 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/osm/DisjointSet.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/osm/DisjointSet.java @@ -9,7 +9,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Set; -import org.opentripplanner.framework.collection.MapUtils; +import org.opentripplanner.framework.collection.ToveUtils; /** Basic union-find data structure with path compression */ class DisjointSet { @@ -62,7 +62,7 @@ public boolean exists(T element) { public List> sets() { TLongObjectMap> out = new TLongObjectHashMap<>(); setMapping.forEachEntry((k, v) -> { - MapUtils.addToMapSet(out, compact(v), k); + ToveUtils.addToMapSet(out, compact(v), k); return true; }); return new ArrayList<>(out.valueCollection()); diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmDatabase.java b/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmDatabase.java index 88b1fe9f7da..0fa3c4cbd3b 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmDatabase.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmDatabase.java @@ -24,7 +24,7 @@ import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.LineString; import org.locationtech.jts.geom.Point; -import org.opentripplanner.framework.collection.MapUtils; +import org.opentripplanner.framework.collection.ToveUtils; import org.opentripplanner.framework.geometry.GeometryUtils; import org.opentripplanner.framework.geometry.HashGridSpatialIndex; import org.opentripplanner.framework.lang.StringUtils; @@ -267,7 +267,7 @@ public void addWay(OsmWay way) { way .getNodeRefs() .forEach(node -> { - MapUtils.addToMapSet(areasForNode, node, way); + ToveUtils.addToMapSet(areasForNode, node, way); return true; }); } @@ -738,7 +738,7 @@ private void processMultipolygonRelations() { while (wayNodeIterator.hasNext()) { long nodeId = wayNodeIterator.next(); if (nodesById.containsKey(nodeId)) { - MapUtils.addToMapSet(areasForNode, nodeId, way); + ToveUtils.addToMapSet(areasForNode, nodeId, way); } else { // this area is missing some nodes, perhaps because it is on // the edge of the region, so we will simply not route on it. diff --git a/framework/pom.xml b/framework/pom.xml new file mode 100644 index 00000000000..bc210986a7e --- /dev/null +++ b/framework/pom.xml @@ -0,0 +1,41 @@ + + + 4.0.0 + + org.opentripplanner + otp-root + 2.7.0-SNAPSHOT + + + otp-framework + OpenTripPlanner - Framework + + + + + com.google.code.findbugs + jsr305 + + + + + org.slf4j + slf4j-api + + + + + + org.junit.jupiter + junit-jupiter-api + test + + + org.junit.jupiter + junit-jupiter-params + test + + + diff --git a/application/src/main/java/org/opentripplanner/framework/collection/CollectionUtils.java b/framework/src/main/java/org/opentripplanner/framework/collection/CollectionUtils.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/collection/CollectionUtils.java rename to framework/src/main/java/org/opentripplanner/framework/collection/CollectionUtils.java diff --git a/application/src/main/java/org/opentripplanner/framework/collection/CollectionsView.java b/framework/src/main/java/org/opentripplanner/framework/collection/CollectionsView.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/collection/CollectionsView.java rename to framework/src/main/java/org/opentripplanner/framework/collection/CollectionsView.java diff --git a/application/src/main/java/org/opentripplanner/framework/collection/CompositeComparator.java b/framework/src/main/java/org/opentripplanner/framework/collection/CompositeComparator.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/collection/CompositeComparator.java rename to framework/src/main/java/org/opentripplanner/framework/collection/CompositeComparator.java diff --git a/application/src/main/java/org/opentripplanner/framework/collection/ListSection.java b/framework/src/main/java/org/opentripplanner/framework/collection/ListSection.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/collection/ListSection.java rename to framework/src/main/java/org/opentripplanner/framework/collection/ListSection.java diff --git a/application/src/main/java/org/opentripplanner/framework/collection/ListUtils.java b/framework/src/main/java/org/opentripplanner/framework/collection/ListUtils.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/collection/ListUtils.java rename to framework/src/main/java/org/opentripplanner/framework/collection/ListUtils.java diff --git a/application/src/main/java/org/opentripplanner/framework/collection/MapUtils.java b/framework/src/main/java/org/opentripplanner/framework/collection/MapUtils.java similarity index 77% rename from application/src/main/java/org/opentripplanner/framework/collection/MapUtils.java rename to framework/src/main/java/org/opentripplanner/framework/collection/MapUtils.java index c68527b6d0e..afd1e87aec2 100644 --- a/application/src/main/java/org/opentripplanner/framework/collection/MapUtils.java +++ b/framework/src/main/java/org/opentripplanner/framework/collection/MapUtils.java @@ -1,27 +1,15 @@ package org.opentripplanner.framework.collection; -import gnu.trove.map.TLongObjectMap; import java.util.Arrays; import java.util.Collection; import java.util.HashMap; -import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Set; import java.util.function.Function; import java.util.stream.Collectors; public class MapUtils { - public static void addToMapSet(TLongObjectMap> mapSet, long key, U value) { - Set set = mapSet.get(key); - if (set == null) { - set = new HashSet<>(); - mapSet.put(key, set); - } - set.add(value); - } - /** * Map a collection of objects of type S to a list of type T using the provided * mapping function. diff --git a/application/src/main/java/org/opentripplanner/framework/collection/SetUtils.java b/framework/src/main/java/org/opentripplanner/framework/collection/SetUtils.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/collection/SetUtils.java rename to framework/src/main/java/org/opentripplanner/framework/collection/SetUtils.java diff --git a/application/src/main/java/org/opentripplanner/framework/lang/ArrayUtils.java b/framework/src/main/java/org/opentripplanner/framework/lang/ArrayUtils.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/lang/ArrayUtils.java rename to framework/src/main/java/org/opentripplanner/framework/lang/ArrayUtils.java diff --git a/application/src/main/java/org/opentripplanner/framework/lang/BitSetUtils.java b/framework/src/main/java/org/opentripplanner/framework/lang/BitSetUtils.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/lang/BitSetUtils.java rename to framework/src/main/java/org/opentripplanner/framework/lang/BitSetUtils.java diff --git a/application/src/main/java/org/opentripplanner/framework/lang/Box.java b/framework/src/main/java/org/opentripplanner/framework/lang/Box.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/lang/Box.java rename to framework/src/main/java/org/opentripplanner/framework/lang/Box.java diff --git a/application/src/main/java/org/opentripplanner/framework/lang/DoubleUtils.java b/framework/src/main/java/org/opentripplanner/framework/lang/DoubleUtils.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/lang/DoubleUtils.java rename to framework/src/main/java/org/opentripplanner/framework/lang/DoubleUtils.java diff --git a/application/src/main/java/org/opentripplanner/framework/lang/IntBox.java b/framework/src/main/java/org/opentripplanner/framework/lang/IntBox.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/lang/IntBox.java rename to framework/src/main/java/org/opentripplanner/framework/lang/IntBox.java diff --git a/application/src/main/java/org/opentripplanner/framework/lang/IntRange.java b/framework/src/main/java/org/opentripplanner/framework/lang/IntRange.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/lang/IntRange.java rename to framework/src/main/java/org/opentripplanner/framework/lang/IntRange.java diff --git a/application/src/main/java/org/opentripplanner/framework/lang/IntUtils.java b/framework/src/main/java/org/opentripplanner/framework/lang/IntUtils.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/lang/IntUtils.java rename to framework/src/main/java/org/opentripplanner/framework/lang/IntUtils.java diff --git a/application/src/main/java/org/opentripplanner/framework/lang/MemEfficientArrayBuilder.java b/framework/src/main/java/org/opentripplanner/framework/lang/MemEfficientArrayBuilder.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/lang/MemEfficientArrayBuilder.java rename to framework/src/main/java/org/opentripplanner/framework/lang/MemEfficientArrayBuilder.java diff --git a/application/src/main/java/org/opentripplanner/framework/lang/ObjectUtils.java b/framework/src/main/java/org/opentripplanner/framework/lang/ObjectUtils.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/lang/ObjectUtils.java rename to framework/src/main/java/org/opentripplanner/framework/lang/ObjectUtils.java diff --git a/application/src/main/java/org/opentripplanner/framework/lang/OtpNumberFormat.java b/framework/src/main/java/org/opentripplanner/framework/lang/OtpNumberFormat.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/lang/OtpNumberFormat.java rename to framework/src/main/java/org/opentripplanner/framework/lang/OtpNumberFormat.java diff --git a/application/src/main/java/org/opentripplanner/framework/lang/Sandbox.java b/framework/src/main/java/org/opentripplanner/framework/lang/Sandbox.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/lang/Sandbox.java rename to framework/src/main/java/org/opentripplanner/framework/lang/Sandbox.java diff --git a/application/src/main/java/org/opentripplanner/framework/lang/StringUtils.java b/framework/src/main/java/org/opentripplanner/framework/lang/StringUtils.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/lang/StringUtils.java rename to framework/src/main/java/org/opentripplanner/framework/lang/StringUtils.java diff --git a/application/src/main/java/org/opentripplanner/framework/logging/ProgressTracker.java b/framework/src/main/java/org/opentripplanner/framework/logging/ProgressTracker.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/logging/ProgressTracker.java rename to framework/src/main/java/org/opentripplanner/framework/logging/ProgressTracker.java diff --git a/application/src/main/java/org/opentripplanner/framework/logging/ProgressTrackerInputStream.java b/framework/src/main/java/org/opentripplanner/framework/logging/ProgressTrackerInputStream.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/logging/ProgressTrackerInputStream.java rename to framework/src/main/java/org/opentripplanner/framework/logging/ProgressTrackerInputStream.java diff --git a/application/src/main/java/org/opentripplanner/framework/logging/ProgressTrackerOutputStream.java b/framework/src/main/java/org/opentripplanner/framework/logging/ProgressTrackerOutputStream.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/logging/ProgressTrackerOutputStream.java rename to framework/src/main/java/org/opentripplanner/framework/logging/ProgressTrackerOutputStream.java diff --git a/application/src/main/java/org/opentripplanner/framework/logging/Throttle.java b/framework/src/main/java/org/opentripplanner/framework/logging/Throttle.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/logging/Throttle.java rename to framework/src/main/java/org/opentripplanner/framework/logging/Throttle.java diff --git a/application/src/main/java/org/opentripplanner/framework/text/CharacterEscapeFormatter.java b/framework/src/main/java/org/opentripplanner/framework/text/CharacterEscapeFormatter.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/text/CharacterEscapeFormatter.java rename to framework/src/main/java/org/opentripplanner/framework/text/CharacterEscapeFormatter.java diff --git a/application/src/main/java/org/opentripplanner/framework/text/FileSizeToTextConverter.java b/framework/src/main/java/org/opentripplanner/framework/text/FileSizeToTextConverter.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/text/FileSizeToTextConverter.java rename to framework/src/main/java/org/opentripplanner/framework/text/FileSizeToTextConverter.java diff --git a/application/src/main/java/org/opentripplanner/framework/text/HexString.java b/framework/src/main/java/org/opentripplanner/framework/text/HexString.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/text/HexString.java rename to framework/src/main/java/org/opentripplanner/framework/text/HexString.java diff --git a/application/src/main/java/org/opentripplanner/framework/text/MarkdownFormatter.java b/framework/src/main/java/org/opentripplanner/framework/text/MarkdownFormatter.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/text/MarkdownFormatter.java rename to framework/src/main/java/org/opentripplanner/framework/text/MarkdownFormatter.java diff --git a/application/src/main/java/org/opentripplanner/framework/text/Table.java b/framework/src/main/java/org/opentripplanner/framework/text/Table.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/text/Table.java rename to framework/src/main/java/org/opentripplanner/framework/text/Table.java diff --git a/application/src/main/java/org/opentripplanner/framework/text/TableBuilder.java b/framework/src/main/java/org/opentripplanner/framework/text/TableBuilder.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/text/TableBuilder.java rename to framework/src/main/java/org/opentripplanner/framework/text/TableBuilder.java diff --git a/application/src/main/java/org/opentripplanner/framework/text/TableRowFormatter.java b/framework/src/main/java/org/opentripplanner/framework/text/TableRowFormatter.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/text/TableRowFormatter.java rename to framework/src/main/java/org/opentripplanner/framework/text/TableRowFormatter.java diff --git a/application/src/main/java/org/opentripplanner/framework/time/CountdownTimer.java b/framework/src/main/java/org/opentripplanner/framework/time/CountdownTimer.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/time/CountdownTimer.java rename to framework/src/main/java/org/opentripplanner/framework/time/CountdownTimer.java diff --git a/application/src/main/java/org/opentripplanner/framework/time/DateUtils.java b/framework/src/main/java/org/opentripplanner/framework/time/DateUtils.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/time/DateUtils.java rename to framework/src/main/java/org/opentripplanner/framework/time/DateUtils.java diff --git a/application/src/main/java/org/opentripplanner/framework/time/DurationUtils.java b/framework/src/main/java/org/opentripplanner/framework/time/DurationUtils.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/time/DurationUtils.java rename to framework/src/main/java/org/opentripplanner/framework/time/DurationUtils.java diff --git a/application/src/main/java/org/opentripplanner/framework/time/LocalDateUtils.java b/framework/src/main/java/org/opentripplanner/framework/time/LocalDateUtils.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/time/LocalDateUtils.java rename to framework/src/main/java/org/opentripplanner/framework/time/LocalDateUtils.java diff --git a/application/src/main/java/org/opentripplanner/framework/time/OffsetDateTimeParser.java b/framework/src/main/java/org/opentripplanner/framework/time/OffsetDateTimeParser.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/time/OffsetDateTimeParser.java rename to framework/src/main/java/org/opentripplanner/framework/time/OffsetDateTimeParser.java diff --git a/application/src/main/java/org/opentripplanner/framework/time/RelativeTime.java b/framework/src/main/java/org/opentripplanner/framework/time/RelativeTime.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/time/RelativeTime.java rename to framework/src/main/java/org/opentripplanner/framework/time/RelativeTime.java diff --git a/application/src/main/java/org/opentripplanner/framework/time/ServiceDateUtils.java b/framework/src/main/java/org/opentripplanner/framework/time/ServiceDateUtils.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/time/ServiceDateUtils.java rename to framework/src/main/java/org/opentripplanner/framework/time/ServiceDateUtils.java diff --git a/application/src/main/java/org/opentripplanner/framework/time/TimeUtils.java b/framework/src/main/java/org/opentripplanner/framework/time/TimeUtils.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/time/TimeUtils.java rename to framework/src/main/java/org/opentripplanner/framework/time/TimeUtils.java diff --git a/application/src/main/java/org/opentripplanner/framework/tostring/MultiLineToStringBuilder.java b/framework/src/main/java/org/opentripplanner/framework/tostring/MultiLineToStringBuilder.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/tostring/MultiLineToStringBuilder.java rename to framework/src/main/java/org/opentripplanner/framework/tostring/MultiLineToStringBuilder.java diff --git a/application/src/main/java/org/opentripplanner/framework/tostring/ToStringBuilder.java b/framework/src/main/java/org/opentripplanner/framework/tostring/ToStringBuilder.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/tostring/ToStringBuilder.java rename to framework/src/main/java/org/opentripplanner/framework/tostring/ToStringBuilder.java diff --git a/application/src/main/java/org/opentripplanner/framework/tostring/ValueObjectToStringBuilder.java b/framework/src/main/java/org/opentripplanner/framework/tostring/ValueObjectToStringBuilder.java similarity index 100% rename from application/src/main/java/org/opentripplanner/framework/tostring/ValueObjectToStringBuilder.java rename to framework/src/main/java/org/opentripplanner/framework/tostring/ValueObjectToStringBuilder.java diff --git a/application/src/test/java/org/opentripplanner/framework/collection/CollectionUtilsTest.java b/framework/src/test/java/org/opentripplanner/framework/collection/CollectionUtilsTest.java similarity index 98% rename from application/src/test/java/org/opentripplanner/framework/collection/CollectionUtilsTest.java rename to framework/src/test/java/org/opentripplanner/framework/collection/CollectionUtilsTest.java index 6686ac8e0d9..9cfe118f984 100644 --- a/application/src/test/java/org/opentripplanner/framework/collection/CollectionUtilsTest.java +++ b/framework/src/test/java/org/opentripplanner/framework/collection/CollectionUtilsTest.java @@ -4,8 +4,8 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; -import com.google.type.Month; import java.time.Duration; +import java.time.Month; import java.util.ArrayList; import java.util.Collection; import java.util.EnumSet; diff --git a/application/src/test/java/org/opentripplanner/framework/collection/CollectionsViewTest.java b/framework/src/test/java/org/opentripplanner/framework/collection/CollectionsViewTest.java similarity index 100% rename from application/src/test/java/org/opentripplanner/framework/collection/CollectionsViewTest.java rename to framework/src/test/java/org/opentripplanner/framework/collection/CollectionsViewTest.java diff --git a/application/src/test/java/org/opentripplanner/framework/collection/CompositeComparatorTest.java b/framework/src/test/java/org/opentripplanner/framework/collection/CompositeComparatorTest.java similarity index 100% rename from application/src/test/java/org/opentripplanner/framework/collection/CompositeComparatorTest.java rename to framework/src/test/java/org/opentripplanner/framework/collection/CompositeComparatorTest.java diff --git a/application/src/test/java/org/opentripplanner/framework/collection/ListSectionTest.java b/framework/src/test/java/org/opentripplanner/framework/collection/ListSectionTest.java similarity index 100% rename from application/src/test/java/org/opentripplanner/framework/collection/ListSectionTest.java rename to framework/src/test/java/org/opentripplanner/framework/collection/ListSectionTest.java diff --git a/application/src/test/java/org/opentripplanner/framework/collection/ListUtilsTest.java b/framework/src/test/java/org/opentripplanner/framework/collection/ListUtilsTest.java similarity index 100% rename from application/src/test/java/org/opentripplanner/framework/collection/ListUtilsTest.java rename to framework/src/test/java/org/opentripplanner/framework/collection/ListUtilsTest.java diff --git a/application/src/test/java/org/opentripplanner/framework/collection/MapUtilsTest.java b/framework/src/test/java/org/opentripplanner/framework/collection/MapUtilsTest.java similarity index 100% rename from application/src/test/java/org/opentripplanner/framework/collection/MapUtilsTest.java rename to framework/src/test/java/org/opentripplanner/framework/collection/MapUtilsTest.java diff --git a/application/src/test/java/org/opentripplanner/framework/collection/SetUtilsTest.java b/framework/src/test/java/org/opentripplanner/framework/collection/SetUtilsTest.java similarity index 100% rename from application/src/test/java/org/opentripplanner/framework/collection/SetUtilsTest.java rename to framework/src/test/java/org/opentripplanner/framework/collection/SetUtilsTest.java diff --git a/application/src/test/java/org/opentripplanner/framework/lang/ArrayUtilsTest.java b/framework/src/test/java/org/opentripplanner/framework/lang/ArrayUtilsTest.java similarity index 100% rename from application/src/test/java/org/opentripplanner/framework/lang/ArrayUtilsTest.java rename to framework/src/test/java/org/opentripplanner/framework/lang/ArrayUtilsTest.java diff --git a/application/src/test/java/org/opentripplanner/framework/lang/BitSetUtilsTest.java b/framework/src/test/java/org/opentripplanner/framework/lang/BitSetUtilsTest.java similarity index 100% rename from application/src/test/java/org/opentripplanner/framework/lang/BitSetUtilsTest.java rename to framework/src/test/java/org/opentripplanner/framework/lang/BitSetUtilsTest.java diff --git a/application/src/test/java/org/opentripplanner/framework/lang/BoxTest.java b/framework/src/test/java/org/opentripplanner/framework/lang/BoxTest.java similarity index 100% rename from application/src/test/java/org/opentripplanner/framework/lang/BoxTest.java rename to framework/src/test/java/org/opentripplanner/framework/lang/BoxTest.java diff --git a/application/src/test/java/org/opentripplanner/framework/lang/DoubleUtilsTest.java b/framework/src/test/java/org/opentripplanner/framework/lang/DoubleUtilsTest.java similarity index 100% rename from application/src/test/java/org/opentripplanner/framework/lang/DoubleUtilsTest.java rename to framework/src/test/java/org/opentripplanner/framework/lang/DoubleUtilsTest.java diff --git a/application/src/test/java/org/opentripplanner/framework/lang/IntBoxTest.java b/framework/src/test/java/org/opentripplanner/framework/lang/IntBoxTest.java similarity index 100% rename from application/src/test/java/org/opentripplanner/framework/lang/IntBoxTest.java rename to framework/src/test/java/org/opentripplanner/framework/lang/IntBoxTest.java diff --git a/application/src/test/java/org/opentripplanner/framework/lang/IntRangeTest.java b/framework/src/test/java/org/opentripplanner/framework/lang/IntRangeTest.java similarity index 100% rename from application/src/test/java/org/opentripplanner/framework/lang/IntRangeTest.java rename to framework/src/test/java/org/opentripplanner/framework/lang/IntRangeTest.java diff --git a/application/src/test/java/org/opentripplanner/framework/lang/IntUtilsTest.java b/framework/src/test/java/org/opentripplanner/framework/lang/IntUtilsTest.java similarity index 100% rename from application/src/test/java/org/opentripplanner/framework/lang/IntUtilsTest.java rename to framework/src/test/java/org/opentripplanner/framework/lang/IntUtilsTest.java diff --git a/application/src/test/java/org/opentripplanner/framework/lang/MemEfficientArrayBuilderTest.java b/framework/src/test/java/org/opentripplanner/framework/lang/MemEfficientArrayBuilderTest.java similarity index 100% rename from application/src/test/java/org/opentripplanner/framework/lang/MemEfficientArrayBuilderTest.java rename to framework/src/test/java/org/opentripplanner/framework/lang/MemEfficientArrayBuilderTest.java diff --git a/application/src/test/java/org/opentripplanner/framework/lang/ObjectUtilsTest.java b/framework/src/test/java/org/opentripplanner/framework/lang/ObjectUtilsTest.java similarity index 100% rename from application/src/test/java/org/opentripplanner/framework/lang/ObjectUtilsTest.java rename to framework/src/test/java/org/opentripplanner/framework/lang/ObjectUtilsTest.java diff --git a/application/src/test/java/org/opentripplanner/framework/lang/OtpNumberFormatTest.java b/framework/src/test/java/org/opentripplanner/framework/lang/OtpNumberFormatTest.java similarity index 100% rename from application/src/test/java/org/opentripplanner/framework/lang/OtpNumberFormatTest.java rename to framework/src/test/java/org/opentripplanner/framework/lang/OtpNumberFormatTest.java diff --git a/application/src/test/java/org/opentripplanner/framework/lang/StringUtilsTest.java b/framework/src/test/java/org/opentripplanner/framework/lang/StringUtilsTest.java similarity index 100% rename from application/src/test/java/org/opentripplanner/framework/lang/StringUtilsTest.java rename to framework/src/test/java/org/opentripplanner/framework/lang/StringUtilsTest.java diff --git a/application/src/test/java/org/opentripplanner/framework/logging/ProgressTrackerTest.java b/framework/src/test/java/org/opentripplanner/framework/logging/ProgressTrackerTest.java similarity index 100% rename from application/src/test/java/org/opentripplanner/framework/logging/ProgressTrackerTest.java rename to framework/src/test/java/org/opentripplanner/framework/logging/ProgressTrackerTest.java diff --git a/application/src/test/java/org/opentripplanner/framework/logging/ThrottleTest.java b/framework/src/test/java/org/opentripplanner/framework/logging/ThrottleTest.java similarity index 100% rename from application/src/test/java/org/opentripplanner/framework/logging/ThrottleTest.java rename to framework/src/test/java/org/opentripplanner/framework/logging/ThrottleTest.java diff --git a/application/src/test/java/org/opentripplanner/framework/text/CharacterEscapeFormatterTest.java b/framework/src/test/java/org/opentripplanner/framework/text/CharacterEscapeFormatterTest.java similarity index 100% rename from application/src/test/java/org/opentripplanner/framework/text/CharacterEscapeFormatterTest.java rename to framework/src/test/java/org/opentripplanner/framework/text/CharacterEscapeFormatterTest.java diff --git a/application/src/test/java/org/opentripplanner/framework/text/FileSizeToTextConverterTest.java b/framework/src/test/java/org/opentripplanner/framework/text/FileSizeToTextConverterTest.java similarity index 100% rename from application/src/test/java/org/opentripplanner/framework/text/FileSizeToTextConverterTest.java rename to framework/src/test/java/org/opentripplanner/framework/text/FileSizeToTextConverterTest.java diff --git a/application/src/test/java/org/opentripplanner/framework/text/HexStringTest.java b/framework/src/test/java/org/opentripplanner/framework/text/HexStringTest.java similarity index 100% rename from application/src/test/java/org/opentripplanner/framework/text/HexStringTest.java rename to framework/src/test/java/org/opentripplanner/framework/text/HexStringTest.java diff --git a/application/src/test/java/org/opentripplanner/framework/text/MarkdownFormatterTest.java b/framework/src/test/java/org/opentripplanner/framework/text/MarkdownFormatterTest.java similarity index 100% rename from application/src/test/java/org/opentripplanner/framework/text/MarkdownFormatterTest.java rename to framework/src/test/java/org/opentripplanner/framework/text/MarkdownFormatterTest.java diff --git a/application/src/test/java/org/opentripplanner/framework/text/TableTest.java b/framework/src/test/java/org/opentripplanner/framework/text/TableTest.java similarity index 100% rename from application/src/test/java/org/opentripplanner/framework/text/TableTest.java rename to framework/src/test/java/org/opentripplanner/framework/text/TableTest.java diff --git a/application/src/test/java/org/opentripplanner/framework/time/CountdownTimerTest.java b/framework/src/test/java/org/opentripplanner/framework/time/CountdownTimerTest.java similarity index 100% rename from application/src/test/java/org/opentripplanner/framework/time/CountdownTimerTest.java rename to framework/src/test/java/org/opentripplanner/framework/time/CountdownTimerTest.java diff --git a/application/src/test/java/org/opentripplanner/framework/time/DateUtilsTest.java b/framework/src/test/java/org/opentripplanner/framework/time/DateUtilsTest.java similarity index 98% rename from application/src/test/java/org/opentripplanner/framework/time/DateUtilsTest.java rename to framework/src/test/java/org/opentripplanner/framework/time/DateUtilsTest.java index d89eea5d73b..6b2e493b735 100644 --- a/application/src/test/java/org/opentripplanner/framework/time/DateUtilsTest.java +++ b/framework/src/test/java/org/opentripplanner/framework/time/DateUtilsTest.java @@ -7,7 +7,6 @@ import java.time.ZoneId; import java.time.ZonedDateTime; import org.junit.jupiter.api.Test; -import org.opentripplanner._support.time.ZoneIds; public class DateUtilsTest { diff --git a/application/src/test/java/org/opentripplanner/framework/time/DurationUtilsTest.java b/framework/src/test/java/org/opentripplanner/framework/time/DurationUtilsTest.java similarity index 100% rename from application/src/test/java/org/opentripplanner/framework/time/DurationUtilsTest.java rename to framework/src/test/java/org/opentripplanner/framework/time/DurationUtilsTest.java diff --git a/application/src/test/java/org/opentripplanner/framework/time/LocalDateUtilsTest.java b/framework/src/test/java/org/opentripplanner/framework/time/LocalDateUtilsTest.java similarity index 100% rename from application/src/test/java/org/opentripplanner/framework/time/LocalDateUtilsTest.java rename to framework/src/test/java/org/opentripplanner/framework/time/LocalDateUtilsTest.java diff --git a/application/src/test/java/org/opentripplanner/framework/time/OffsetDateTimeParserTest.java b/framework/src/test/java/org/opentripplanner/framework/time/OffsetDateTimeParserTest.java similarity index 100% rename from application/src/test/java/org/opentripplanner/framework/time/OffsetDateTimeParserTest.java rename to framework/src/test/java/org/opentripplanner/framework/time/OffsetDateTimeParserTest.java diff --git a/application/src/test/java/org/opentripplanner/framework/time/ServiceDateUtilsTest.java b/framework/src/test/java/org/opentripplanner/framework/time/ServiceDateUtilsTest.java similarity index 99% rename from application/src/test/java/org/opentripplanner/framework/time/ServiceDateUtilsTest.java rename to framework/src/test/java/org/opentripplanner/framework/time/ServiceDateUtilsTest.java index 4c22b414537..92a67df9110 100644 --- a/application/src/test/java/org/opentripplanner/framework/time/ServiceDateUtilsTest.java +++ b/framework/src/test/java/org/opentripplanner/framework/time/ServiceDateUtilsTest.java @@ -17,7 +17,6 @@ import java.time.ZoneId; import java.time.ZonedDateTime; import org.junit.jupiter.api.Test; -import org.opentripplanner._support.time.ZoneIds; public class ServiceDateUtilsTest { diff --git a/application/src/test/java/org/opentripplanner/framework/time/TimeUtilsTest.java b/framework/src/test/java/org/opentripplanner/framework/time/TimeUtilsTest.java similarity index 99% rename from application/src/test/java/org/opentripplanner/framework/time/TimeUtilsTest.java rename to framework/src/test/java/org/opentripplanner/framework/time/TimeUtilsTest.java index c2eb828cc21..936102f3496 100644 --- a/application/src/test/java/org/opentripplanner/framework/time/TimeUtilsTest.java +++ b/framework/src/test/java/org/opentripplanner/framework/time/TimeUtilsTest.java @@ -11,7 +11,6 @@ import java.time.ZonedDateTime; import java.util.Arrays; import org.junit.jupiter.api.Test; -import org.opentripplanner._support.time.ZoneIds; public class TimeUtilsTest { diff --git a/framework/src/test/java/org/opentripplanner/framework/time/ZoneIds.java b/framework/src/test/java/org/opentripplanner/framework/time/ZoneIds.java new file mode 100644 index 00000000000..e42dc718790 --- /dev/null +++ b/framework/src/test/java/org/opentripplanner/framework/time/ZoneIds.java @@ -0,0 +1,11 @@ +package org.opentripplanner.framework.time; + +import java.time.ZoneId; + +public class ZoneIds { + + public static final ZoneId UTC = ZoneId.of("UTC"); + public static final ZoneId CET = ZoneId.of("CET"); + public static final ZoneId OSLO = ZoneId.of("Europe/Oslo"); + public static final ZoneId PARIS = ZoneId.of("Europe/Paris"); +} diff --git a/application/src/test/java/org/opentripplanner/framework/tostring/MultiLineToStringBuilderTest.java b/framework/src/test/java/org/opentripplanner/framework/tostring/MultiLineToStringBuilderTest.java similarity index 100% rename from application/src/test/java/org/opentripplanner/framework/tostring/MultiLineToStringBuilderTest.java rename to framework/src/test/java/org/opentripplanner/framework/tostring/MultiLineToStringBuilderTest.java diff --git a/application/src/test/java/org/opentripplanner/framework/tostring/ToStringBuilderTest.java b/framework/src/test/java/org/opentripplanner/framework/tostring/ToStringBuilderTest.java similarity index 99% rename from application/src/test/java/org/opentripplanner/framework/tostring/ToStringBuilderTest.java rename to framework/src/test/java/org/opentripplanner/framework/tostring/ToStringBuilderTest.java index 90254c321a1..59d1eea4d0b 100644 --- a/application/src/test/java/org/opentripplanner/framework/tostring/ToStringBuilderTest.java +++ b/framework/src/test/java/org/opentripplanner/framework/tostring/ToStringBuilderTest.java @@ -13,8 +13,8 @@ import java.util.Objects; import java.util.function.Function; import org.junit.jupiter.api.Test; -import org.opentripplanner._support.time.ZoneIds; import org.opentripplanner.framework.time.TimeUtils; +import org.opentripplanner.framework.time.ZoneIds; public class ToStringBuilderTest { diff --git a/application/src/test/java/org/opentripplanner/framework/tostring/ValueObjectToStringBuilderTest.java b/framework/src/test/java/org/opentripplanner/framework/tostring/ValueObjectToStringBuilderTest.java similarity index 100% rename from application/src/test/java/org/opentripplanner/framework/tostring/ValueObjectToStringBuilderTest.java rename to framework/src/test/java/org/opentripplanner/framework/tostring/ValueObjectToStringBuilderTest.java diff --git a/pom.xml b/pom.xml index e590501e6c4..3b1ff48c427 100644 --- a/pom.xml +++ b/pom.xml @@ -96,6 +96,7 @@ application gtfs-realtime-protobuf + framework From 0f685399b9ca4fe6205b321775aefc0947363787 Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Tue, 29 Oct 2024 22:08:10 +0100 Subject: [PATCH 086/110] Rename Maven module to utils --- pom.xml | 2 +- {framework => utils}/pom.xml | 4 ++-- .../opentripplanner/utils}/collection/CollectionUtils.java | 0 .../opentripplanner/utils}/collection/CollectionsView.java | 0 .../utils}/collection/CompositeComparator.java | 0 .../org/opentripplanner/utils}/collection/ListSection.java | 0 .../java/org/opentripplanner/utils}/collection/ListUtils.java | 0 .../java/org/opentripplanner/utils}/collection/MapUtils.java | 0 .../java/org/opentripplanner/utils}/collection/SetUtils.java | 0 .../main/java/org/opentripplanner/utils}/lang/ArrayUtils.java | 0 .../java/org/opentripplanner/utils}/lang/BitSetUtils.java | 0 .../src/main/java/org/opentripplanner/utils}/lang/Box.java | 0 .../java/org/opentripplanner/utils}/lang/DoubleUtils.java | 0 .../src/main/java/org/opentripplanner/utils}/lang/IntBox.java | 0 .../main/java/org/opentripplanner/utils}/lang/IntRange.java | 0 .../main/java/org/opentripplanner/utils}/lang/IntUtils.java | 0 .../opentripplanner/utils}/lang/MemEfficientArrayBuilder.java | 0 .../java/org/opentripplanner/utils}/lang/ObjectUtils.java | 0 .../java/org/opentripplanner/utils}/lang/OtpNumberFormat.java | 0 .../main/java/org/opentripplanner/utils}/lang/Sandbox.java | 0 .../java/org/opentripplanner/utils}/lang/StringUtils.java | 0 .../org/opentripplanner/utils}/logging/ProgressTracker.java | 0 .../utils}/logging/ProgressTrackerInputStream.java | 0 .../utils}/logging/ProgressTrackerOutputStream.java | 0 .../java/org/opentripplanner/utils}/logging/Throttle.java | 0 .../opentripplanner/utils}/text/CharacterEscapeFormatter.java | 0 .../opentripplanner/utils}/text/FileSizeToTextConverter.java | 0 .../main/java/org/opentripplanner/utils}/text/HexString.java | 0 .../org/opentripplanner/utils}/text/MarkdownFormatter.java | 0 .../src/main/java/org/opentripplanner/utils}/text/Table.java | 0 .../java/org/opentripplanner/utils}/text/TableBuilder.java | 0 .../org/opentripplanner/utils}/text/TableRowFormatter.java | 0 .../java/org/opentripplanner/utils}/time/CountdownTimer.java | 0 .../main/java/org/opentripplanner/utils}/time/DateUtils.java | 0 .../java/org/opentripplanner/utils}/time/DurationUtils.java | 0 .../java/org/opentripplanner/utils}/time/LocalDateUtils.java | 0 .../org/opentripplanner/utils}/time/OffsetDateTimeParser.java | 0 .../java/org/opentripplanner/utils}/time/RelativeTime.java | 0 .../org/opentripplanner/utils}/time/ServiceDateUtils.java | 0 .../main/java/org/opentripplanner/utils}/time/TimeUtils.java | 0 .../utils}/tostring/MultiLineToStringBuilder.java | 0 .../org/opentripplanner/utils}/tostring/ToStringBuilder.java | 0 .../utils}/tostring/ValueObjectToStringBuilder.java | 0 .../utils}/collection/CollectionUtilsTest.java | 0 .../utils}/collection/CollectionsViewTest.java | 0 .../utils}/collection/CompositeComparatorTest.java | 0 .../opentripplanner/utils}/collection/ListSectionTest.java | 0 .../org/opentripplanner/utils}/collection/ListUtilsTest.java | 0 .../org/opentripplanner/utils}/collection/MapUtilsTest.java | 0 .../org/opentripplanner/utils}/collection/SetUtilsTest.java | 0 .../java/org/opentripplanner/utils}/lang/ArrayUtilsTest.java | 0 .../java/org/opentripplanner/utils}/lang/BitSetUtilsTest.java | 0 .../test/java/org/opentripplanner/utils}/lang/BoxTest.java | 0 .../java/org/opentripplanner/utils}/lang/DoubleUtilsTest.java | 0 .../test/java/org/opentripplanner/utils}/lang/IntBoxTest.java | 0 .../java/org/opentripplanner/utils}/lang/IntRangeTest.java | 0 .../java/org/opentripplanner/utils}/lang/IntUtilsTest.java | 0 .../utils}/lang/MemEfficientArrayBuilderTest.java | 0 .../java/org/opentripplanner/utils}/lang/ObjectUtilsTest.java | 0 .../org/opentripplanner/utils}/lang/OtpNumberFormatTest.java | 0 .../java/org/opentripplanner/utils}/lang/StringUtilsTest.java | 0 .../opentripplanner/utils}/logging/ProgressTrackerTest.java | 0 .../java/org/opentripplanner/utils}/logging/ThrottleTest.java | 0 .../utils}/text/CharacterEscapeFormatterTest.java | 0 .../utils}/text/FileSizeToTextConverterTest.java | 0 .../java/org/opentripplanner/utils}/text/HexStringTest.java | 0 .../opentripplanner/utils}/text/MarkdownFormatterTest.java | 0 .../test/java/org/opentripplanner/utils}/text/TableTest.java | 0 .../org/opentripplanner/utils}/time/CountdownTimerTest.java | 0 .../java/org/opentripplanner/utils}/time/DateUtilsTest.java | 0 .../org/opentripplanner/utils}/time/DurationUtilsTest.java | 0 .../org/opentripplanner/utils}/time/LocalDateUtilsTest.java | 0 .../opentripplanner/utils}/time/OffsetDateTimeParserTest.java | 0 .../org/opentripplanner/utils}/time/ServiceDateUtilsTest.java | 0 .../java/org/opentripplanner/utils}/time/TimeUtilsTest.java | 0 .../test/java/org/opentripplanner/utils}/time/ZoneIds.java | 0 .../utils}/tostring/MultiLineToStringBuilderTest.java | 0 .../opentripplanner/utils}/tostring/ToStringBuilderTest.java | 0 .../utils}/tostring/ValueObjectToStringBuilderTest.java | 0 79 files changed, 3 insertions(+), 3 deletions(-) rename {framework => utils}/pom.xml (93%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/collection/CollectionUtils.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/collection/CollectionsView.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/collection/CompositeComparator.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/collection/ListSection.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/collection/ListUtils.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/collection/MapUtils.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/collection/SetUtils.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/lang/ArrayUtils.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/lang/BitSetUtils.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/lang/Box.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/lang/DoubleUtils.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/lang/IntBox.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/lang/IntRange.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/lang/IntUtils.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/lang/MemEfficientArrayBuilder.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/lang/ObjectUtils.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/lang/OtpNumberFormat.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/lang/Sandbox.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/lang/StringUtils.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/logging/ProgressTracker.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/logging/ProgressTrackerInputStream.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/logging/ProgressTrackerOutputStream.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/logging/Throttle.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/text/CharacterEscapeFormatter.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/text/FileSizeToTextConverter.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/text/HexString.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/text/MarkdownFormatter.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/text/Table.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/text/TableBuilder.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/text/TableRowFormatter.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/time/CountdownTimer.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/time/DateUtils.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/time/DurationUtils.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/time/LocalDateUtils.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/time/OffsetDateTimeParser.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/time/RelativeTime.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/time/ServiceDateUtils.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/time/TimeUtils.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/tostring/MultiLineToStringBuilder.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/tostring/ToStringBuilder.java (100%) rename {framework/src/main/java/org/opentripplanner/framework => utils/src/main/java/org/opentripplanner/utils}/tostring/ValueObjectToStringBuilder.java (100%) rename {framework/src/test/java/org/opentripplanner/framework => utils/src/test/java/org/opentripplanner/utils}/collection/CollectionUtilsTest.java (100%) rename {framework/src/test/java/org/opentripplanner/framework => utils/src/test/java/org/opentripplanner/utils}/collection/CollectionsViewTest.java (100%) rename {framework/src/test/java/org/opentripplanner/framework => utils/src/test/java/org/opentripplanner/utils}/collection/CompositeComparatorTest.java (100%) rename {framework/src/test/java/org/opentripplanner/framework => utils/src/test/java/org/opentripplanner/utils}/collection/ListSectionTest.java (100%) rename {framework/src/test/java/org/opentripplanner/framework => utils/src/test/java/org/opentripplanner/utils}/collection/ListUtilsTest.java (100%) rename {framework/src/test/java/org/opentripplanner/framework => utils/src/test/java/org/opentripplanner/utils}/collection/MapUtilsTest.java (100%) rename {framework/src/test/java/org/opentripplanner/framework => utils/src/test/java/org/opentripplanner/utils}/collection/SetUtilsTest.java (100%) rename {framework/src/test/java/org/opentripplanner/framework => utils/src/test/java/org/opentripplanner/utils}/lang/ArrayUtilsTest.java (100%) rename {framework/src/test/java/org/opentripplanner/framework => utils/src/test/java/org/opentripplanner/utils}/lang/BitSetUtilsTest.java (100%) rename {framework/src/test/java/org/opentripplanner/framework => utils/src/test/java/org/opentripplanner/utils}/lang/BoxTest.java (100%) rename {framework/src/test/java/org/opentripplanner/framework => utils/src/test/java/org/opentripplanner/utils}/lang/DoubleUtilsTest.java (100%) rename {framework/src/test/java/org/opentripplanner/framework => utils/src/test/java/org/opentripplanner/utils}/lang/IntBoxTest.java (100%) rename {framework/src/test/java/org/opentripplanner/framework => utils/src/test/java/org/opentripplanner/utils}/lang/IntRangeTest.java (100%) rename {framework/src/test/java/org/opentripplanner/framework => utils/src/test/java/org/opentripplanner/utils}/lang/IntUtilsTest.java (100%) rename {framework/src/test/java/org/opentripplanner/framework => utils/src/test/java/org/opentripplanner/utils}/lang/MemEfficientArrayBuilderTest.java (100%) rename {framework/src/test/java/org/opentripplanner/framework => utils/src/test/java/org/opentripplanner/utils}/lang/ObjectUtilsTest.java (100%) rename {framework/src/test/java/org/opentripplanner/framework => utils/src/test/java/org/opentripplanner/utils}/lang/OtpNumberFormatTest.java (100%) rename {framework/src/test/java/org/opentripplanner/framework => utils/src/test/java/org/opentripplanner/utils}/lang/StringUtilsTest.java (100%) rename {framework/src/test/java/org/opentripplanner/framework => utils/src/test/java/org/opentripplanner/utils}/logging/ProgressTrackerTest.java (100%) rename {framework/src/test/java/org/opentripplanner/framework => utils/src/test/java/org/opentripplanner/utils}/logging/ThrottleTest.java (100%) rename {framework/src/test/java/org/opentripplanner/framework => utils/src/test/java/org/opentripplanner/utils}/text/CharacterEscapeFormatterTest.java (100%) rename {framework/src/test/java/org/opentripplanner/framework => utils/src/test/java/org/opentripplanner/utils}/text/FileSizeToTextConverterTest.java (100%) rename {framework/src/test/java/org/opentripplanner/framework => utils/src/test/java/org/opentripplanner/utils}/text/HexStringTest.java (100%) rename {framework/src/test/java/org/opentripplanner/framework => utils/src/test/java/org/opentripplanner/utils}/text/MarkdownFormatterTest.java (100%) rename {framework/src/test/java/org/opentripplanner/framework => utils/src/test/java/org/opentripplanner/utils}/text/TableTest.java (100%) rename {framework/src/test/java/org/opentripplanner/framework => utils/src/test/java/org/opentripplanner/utils}/time/CountdownTimerTest.java (100%) rename {framework/src/test/java/org/opentripplanner/framework => utils/src/test/java/org/opentripplanner/utils}/time/DateUtilsTest.java (100%) rename {framework/src/test/java/org/opentripplanner/framework => utils/src/test/java/org/opentripplanner/utils}/time/DurationUtilsTest.java (100%) rename {framework/src/test/java/org/opentripplanner/framework => utils/src/test/java/org/opentripplanner/utils}/time/LocalDateUtilsTest.java (100%) rename {framework/src/test/java/org/opentripplanner/framework => utils/src/test/java/org/opentripplanner/utils}/time/OffsetDateTimeParserTest.java (100%) rename {framework/src/test/java/org/opentripplanner/framework => utils/src/test/java/org/opentripplanner/utils}/time/ServiceDateUtilsTest.java (100%) rename {framework/src/test/java/org/opentripplanner/framework => utils/src/test/java/org/opentripplanner/utils}/time/TimeUtilsTest.java (100%) rename {framework/src/test/java/org/opentripplanner/framework => utils/src/test/java/org/opentripplanner/utils}/time/ZoneIds.java (100%) rename {framework/src/test/java/org/opentripplanner/framework => utils/src/test/java/org/opentripplanner/utils}/tostring/MultiLineToStringBuilderTest.java (100%) rename {framework/src/test/java/org/opentripplanner/framework => utils/src/test/java/org/opentripplanner/utils}/tostring/ToStringBuilderTest.java (100%) rename {framework/src/test/java/org/opentripplanner/framework => utils/src/test/java/org/opentripplanner/utils}/tostring/ValueObjectToStringBuilderTest.java (100%) diff --git a/pom.xml b/pom.xml index 3b1ff48c427..6aedbf90268 100644 --- a/pom.xml +++ b/pom.xml @@ -96,7 +96,7 @@ application gtfs-realtime-protobuf - framework + utils diff --git a/framework/pom.xml b/utils/pom.xml similarity index 93% rename from framework/pom.xml rename to utils/pom.xml index bc210986a7e..1cace007d00 100644 --- a/framework/pom.xml +++ b/utils/pom.xml @@ -9,8 +9,8 @@ 2.7.0-SNAPSHOT - otp-framework - OpenTripPlanner - Framework + otp-utils + OpenTripPlanner - Utils diff --git a/framework/src/main/java/org/opentripplanner/framework/collection/CollectionUtils.java b/utils/src/main/java/org/opentripplanner/utils/collection/CollectionUtils.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/collection/CollectionUtils.java rename to utils/src/main/java/org/opentripplanner/utils/collection/CollectionUtils.java diff --git a/framework/src/main/java/org/opentripplanner/framework/collection/CollectionsView.java b/utils/src/main/java/org/opentripplanner/utils/collection/CollectionsView.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/collection/CollectionsView.java rename to utils/src/main/java/org/opentripplanner/utils/collection/CollectionsView.java diff --git a/framework/src/main/java/org/opentripplanner/framework/collection/CompositeComparator.java b/utils/src/main/java/org/opentripplanner/utils/collection/CompositeComparator.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/collection/CompositeComparator.java rename to utils/src/main/java/org/opentripplanner/utils/collection/CompositeComparator.java diff --git a/framework/src/main/java/org/opentripplanner/framework/collection/ListSection.java b/utils/src/main/java/org/opentripplanner/utils/collection/ListSection.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/collection/ListSection.java rename to utils/src/main/java/org/opentripplanner/utils/collection/ListSection.java diff --git a/framework/src/main/java/org/opentripplanner/framework/collection/ListUtils.java b/utils/src/main/java/org/opentripplanner/utils/collection/ListUtils.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/collection/ListUtils.java rename to utils/src/main/java/org/opentripplanner/utils/collection/ListUtils.java diff --git a/framework/src/main/java/org/opentripplanner/framework/collection/MapUtils.java b/utils/src/main/java/org/opentripplanner/utils/collection/MapUtils.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/collection/MapUtils.java rename to utils/src/main/java/org/opentripplanner/utils/collection/MapUtils.java diff --git a/framework/src/main/java/org/opentripplanner/framework/collection/SetUtils.java b/utils/src/main/java/org/opentripplanner/utils/collection/SetUtils.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/collection/SetUtils.java rename to utils/src/main/java/org/opentripplanner/utils/collection/SetUtils.java diff --git a/framework/src/main/java/org/opentripplanner/framework/lang/ArrayUtils.java b/utils/src/main/java/org/opentripplanner/utils/lang/ArrayUtils.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/lang/ArrayUtils.java rename to utils/src/main/java/org/opentripplanner/utils/lang/ArrayUtils.java diff --git a/framework/src/main/java/org/opentripplanner/framework/lang/BitSetUtils.java b/utils/src/main/java/org/opentripplanner/utils/lang/BitSetUtils.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/lang/BitSetUtils.java rename to utils/src/main/java/org/opentripplanner/utils/lang/BitSetUtils.java diff --git a/framework/src/main/java/org/opentripplanner/framework/lang/Box.java b/utils/src/main/java/org/opentripplanner/utils/lang/Box.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/lang/Box.java rename to utils/src/main/java/org/opentripplanner/utils/lang/Box.java diff --git a/framework/src/main/java/org/opentripplanner/framework/lang/DoubleUtils.java b/utils/src/main/java/org/opentripplanner/utils/lang/DoubleUtils.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/lang/DoubleUtils.java rename to utils/src/main/java/org/opentripplanner/utils/lang/DoubleUtils.java diff --git a/framework/src/main/java/org/opentripplanner/framework/lang/IntBox.java b/utils/src/main/java/org/opentripplanner/utils/lang/IntBox.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/lang/IntBox.java rename to utils/src/main/java/org/opentripplanner/utils/lang/IntBox.java diff --git a/framework/src/main/java/org/opentripplanner/framework/lang/IntRange.java b/utils/src/main/java/org/opentripplanner/utils/lang/IntRange.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/lang/IntRange.java rename to utils/src/main/java/org/opentripplanner/utils/lang/IntRange.java diff --git a/framework/src/main/java/org/opentripplanner/framework/lang/IntUtils.java b/utils/src/main/java/org/opentripplanner/utils/lang/IntUtils.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/lang/IntUtils.java rename to utils/src/main/java/org/opentripplanner/utils/lang/IntUtils.java diff --git a/framework/src/main/java/org/opentripplanner/framework/lang/MemEfficientArrayBuilder.java b/utils/src/main/java/org/opentripplanner/utils/lang/MemEfficientArrayBuilder.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/lang/MemEfficientArrayBuilder.java rename to utils/src/main/java/org/opentripplanner/utils/lang/MemEfficientArrayBuilder.java diff --git a/framework/src/main/java/org/opentripplanner/framework/lang/ObjectUtils.java b/utils/src/main/java/org/opentripplanner/utils/lang/ObjectUtils.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/lang/ObjectUtils.java rename to utils/src/main/java/org/opentripplanner/utils/lang/ObjectUtils.java diff --git a/framework/src/main/java/org/opentripplanner/framework/lang/OtpNumberFormat.java b/utils/src/main/java/org/opentripplanner/utils/lang/OtpNumberFormat.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/lang/OtpNumberFormat.java rename to utils/src/main/java/org/opentripplanner/utils/lang/OtpNumberFormat.java diff --git a/framework/src/main/java/org/opentripplanner/framework/lang/Sandbox.java b/utils/src/main/java/org/opentripplanner/utils/lang/Sandbox.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/lang/Sandbox.java rename to utils/src/main/java/org/opentripplanner/utils/lang/Sandbox.java diff --git a/framework/src/main/java/org/opentripplanner/framework/lang/StringUtils.java b/utils/src/main/java/org/opentripplanner/utils/lang/StringUtils.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/lang/StringUtils.java rename to utils/src/main/java/org/opentripplanner/utils/lang/StringUtils.java diff --git a/framework/src/main/java/org/opentripplanner/framework/logging/ProgressTracker.java b/utils/src/main/java/org/opentripplanner/utils/logging/ProgressTracker.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/logging/ProgressTracker.java rename to utils/src/main/java/org/opentripplanner/utils/logging/ProgressTracker.java diff --git a/framework/src/main/java/org/opentripplanner/framework/logging/ProgressTrackerInputStream.java b/utils/src/main/java/org/opentripplanner/utils/logging/ProgressTrackerInputStream.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/logging/ProgressTrackerInputStream.java rename to utils/src/main/java/org/opentripplanner/utils/logging/ProgressTrackerInputStream.java diff --git a/framework/src/main/java/org/opentripplanner/framework/logging/ProgressTrackerOutputStream.java b/utils/src/main/java/org/opentripplanner/utils/logging/ProgressTrackerOutputStream.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/logging/ProgressTrackerOutputStream.java rename to utils/src/main/java/org/opentripplanner/utils/logging/ProgressTrackerOutputStream.java diff --git a/framework/src/main/java/org/opentripplanner/framework/logging/Throttle.java b/utils/src/main/java/org/opentripplanner/utils/logging/Throttle.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/logging/Throttle.java rename to utils/src/main/java/org/opentripplanner/utils/logging/Throttle.java diff --git a/framework/src/main/java/org/opentripplanner/framework/text/CharacterEscapeFormatter.java b/utils/src/main/java/org/opentripplanner/utils/text/CharacterEscapeFormatter.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/text/CharacterEscapeFormatter.java rename to utils/src/main/java/org/opentripplanner/utils/text/CharacterEscapeFormatter.java diff --git a/framework/src/main/java/org/opentripplanner/framework/text/FileSizeToTextConverter.java b/utils/src/main/java/org/opentripplanner/utils/text/FileSizeToTextConverter.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/text/FileSizeToTextConverter.java rename to utils/src/main/java/org/opentripplanner/utils/text/FileSizeToTextConverter.java diff --git a/framework/src/main/java/org/opentripplanner/framework/text/HexString.java b/utils/src/main/java/org/opentripplanner/utils/text/HexString.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/text/HexString.java rename to utils/src/main/java/org/opentripplanner/utils/text/HexString.java diff --git a/framework/src/main/java/org/opentripplanner/framework/text/MarkdownFormatter.java b/utils/src/main/java/org/opentripplanner/utils/text/MarkdownFormatter.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/text/MarkdownFormatter.java rename to utils/src/main/java/org/opentripplanner/utils/text/MarkdownFormatter.java diff --git a/framework/src/main/java/org/opentripplanner/framework/text/Table.java b/utils/src/main/java/org/opentripplanner/utils/text/Table.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/text/Table.java rename to utils/src/main/java/org/opentripplanner/utils/text/Table.java diff --git a/framework/src/main/java/org/opentripplanner/framework/text/TableBuilder.java b/utils/src/main/java/org/opentripplanner/utils/text/TableBuilder.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/text/TableBuilder.java rename to utils/src/main/java/org/opentripplanner/utils/text/TableBuilder.java diff --git a/framework/src/main/java/org/opentripplanner/framework/text/TableRowFormatter.java b/utils/src/main/java/org/opentripplanner/utils/text/TableRowFormatter.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/text/TableRowFormatter.java rename to utils/src/main/java/org/opentripplanner/utils/text/TableRowFormatter.java diff --git a/framework/src/main/java/org/opentripplanner/framework/time/CountdownTimer.java b/utils/src/main/java/org/opentripplanner/utils/time/CountdownTimer.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/time/CountdownTimer.java rename to utils/src/main/java/org/opentripplanner/utils/time/CountdownTimer.java diff --git a/framework/src/main/java/org/opentripplanner/framework/time/DateUtils.java b/utils/src/main/java/org/opentripplanner/utils/time/DateUtils.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/time/DateUtils.java rename to utils/src/main/java/org/opentripplanner/utils/time/DateUtils.java diff --git a/framework/src/main/java/org/opentripplanner/framework/time/DurationUtils.java b/utils/src/main/java/org/opentripplanner/utils/time/DurationUtils.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/time/DurationUtils.java rename to utils/src/main/java/org/opentripplanner/utils/time/DurationUtils.java diff --git a/framework/src/main/java/org/opentripplanner/framework/time/LocalDateUtils.java b/utils/src/main/java/org/opentripplanner/utils/time/LocalDateUtils.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/time/LocalDateUtils.java rename to utils/src/main/java/org/opentripplanner/utils/time/LocalDateUtils.java diff --git a/framework/src/main/java/org/opentripplanner/framework/time/OffsetDateTimeParser.java b/utils/src/main/java/org/opentripplanner/utils/time/OffsetDateTimeParser.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/time/OffsetDateTimeParser.java rename to utils/src/main/java/org/opentripplanner/utils/time/OffsetDateTimeParser.java diff --git a/framework/src/main/java/org/opentripplanner/framework/time/RelativeTime.java b/utils/src/main/java/org/opentripplanner/utils/time/RelativeTime.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/time/RelativeTime.java rename to utils/src/main/java/org/opentripplanner/utils/time/RelativeTime.java diff --git a/framework/src/main/java/org/opentripplanner/framework/time/ServiceDateUtils.java b/utils/src/main/java/org/opentripplanner/utils/time/ServiceDateUtils.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/time/ServiceDateUtils.java rename to utils/src/main/java/org/opentripplanner/utils/time/ServiceDateUtils.java diff --git a/framework/src/main/java/org/opentripplanner/framework/time/TimeUtils.java b/utils/src/main/java/org/opentripplanner/utils/time/TimeUtils.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/time/TimeUtils.java rename to utils/src/main/java/org/opentripplanner/utils/time/TimeUtils.java diff --git a/framework/src/main/java/org/opentripplanner/framework/tostring/MultiLineToStringBuilder.java b/utils/src/main/java/org/opentripplanner/utils/tostring/MultiLineToStringBuilder.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/tostring/MultiLineToStringBuilder.java rename to utils/src/main/java/org/opentripplanner/utils/tostring/MultiLineToStringBuilder.java diff --git a/framework/src/main/java/org/opentripplanner/framework/tostring/ToStringBuilder.java b/utils/src/main/java/org/opentripplanner/utils/tostring/ToStringBuilder.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/tostring/ToStringBuilder.java rename to utils/src/main/java/org/opentripplanner/utils/tostring/ToStringBuilder.java diff --git a/framework/src/main/java/org/opentripplanner/framework/tostring/ValueObjectToStringBuilder.java b/utils/src/main/java/org/opentripplanner/utils/tostring/ValueObjectToStringBuilder.java similarity index 100% rename from framework/src/main/java/org/opentripplanner/framework/tostring/ValueObjectToStringBuilder.java rename to utils/src/main/java/org/opentripplanner/utils/tostring/ValueObjectToStringBuilder.java diff --git a/framework/src/test/java/org/opentripplanner/framework/collection/CollectionUtilsTest.java b/utils/src/test/java/org/opentripplanner/utils/collection/CollectionUtilsTest.java similarity index 100% rename from framework/src/test/java/org/opentripplanner/framework/collection/CollectionUtilsTest.java rename to utils/src/test/java/org/opentripplanner/utils/collection/CollectionUtilsTest.java diff --git a/framework/src/test/java/org/opentripplanner/framework/collection/CollectionsViewTest.java b/utils/src/test/java/org/opentripplanner/utils/collection/CollectionsViewTest.java similarity index 100% rename from framework/src/test/java/org/opentripplanner/framework/collection/CollectionsViewTest.java rename to utils/src/test/java/org/opentripplanner/utils/collection/CollectionsViewTest.java diff --git a/framework/src/test/java/org/opentripplanner/framework/collection/CompositeComparatorTest.java b/utils/src/test/java/org/opentripplanner/utils/collection/CompositeComparatorTest.java similarity index 100% rename from framework/src/test/java/org/opentripplanner/framework/collection/CompositeComparatorTest.java rename to utils/src/test/java/org/opentripplanner/utils/collection/CompositeComparatorTest.java diff --git a/framework/src/test/java/org/opentripplanner/framework/collection/ListSectionTest.java b/utils/src/test/java/org/opentripplanner/utils/collection/ListSectionTest.java similarity index 100% rename from framework/src/test/java/org/opentripplanner/framework/collection/ListSectionTest.java rename to utils/src/test/java/org/opentripplanner/utils/collection/ListSectionTest.java diff --git a/framework/src/test/java/org/opentripplanner/framework/collection/ListUtilsTest.java b/utils/src/test/java/org/opentripplanner/utils/collection/ListUtilsTest.java similarity index 100% rename from framework/src/test/java/org/opentripplanner/framework/collection/ListUtilsTest.java rename to utils/src/test/java/org/opentripplanner/utils/collection/ListUtilsTest.java diff --git a/framework/src/test/java/org/opentripplanner/framework/collection/MapUtilsTest.java b/utils/src/test/java/org/opentripplanner/utils/collection/MapUtilsTest.java similarity index 100% rename from framework/src/test/java/org/opentripplanner/framework/collection/MapUtilsTest.java rename to utils/src/test/java/org/opentripplanner/utils/collection/MapUtilsTest.java diff --git a/framework/src/test/java/org/opentripplanner/framework/collection/SetUtilsTest.java b/utils/src/test/java/org/opentripplanner/utils/collection/SetUtilsTest.java similarity index 100% rename from framework/src/test/java/org/opentripplanner/framework/collection/SetUtilsTest.java rename to utils/src/test/java/org/opentripplanner/utils/collection/SetUtilsTest.java diff --git a/framework/src/test/java/org/opentripplanner/framework/lang/ArrayUtilsTest.java b/utils/src/test/java/org/opentripplanner/utils/lang/ArrayUtilsTest.java similarity index 100% rename from framework/src/test/java/org/opentripplanner/framework/lang/ArrayUtilsTest.java rename to utils/src/test/java/org/opentripplanner/utils/lang/ArrayUtilsTest.java diff --git a/framework/src/test/java/org/opentripplanner/framework/lang/BitSetUtilsTest.java b/utils/src/test/java/org/opentripplanner/utils/lang/BitSetUtilsTest.java similarity index 100% rename from framework/src/test/java/org/opentripplanner/framework/lang/BitSetUtilsTest.java rename to utils/src/test/java/org/opentripplanner/utils/lang/BitSetUtilsTest.java diff --git a/framework/src/test/java/org/opentripplanner/framework/lang/BoxTest.java b/utils/src/test/java/org/opentripplanner/utils/lang/BoxTest.java similarity index 100% rename from framework/src/test/java/org/opentripplanner/framework/lang/BoxTest.java rename to utils/src/test/java/org/opentripplanner/utils/lang/BoxTest.java diff --git a/framework/src/test/java/org/opentripplanner/framework/lang/DoubleUtilsTest.java b/utils/src/test/java/org/opentripplanner/utils/lang/DoubleUtilsTest.java similarity index 100% rename from framework/src/test/java/org/opentripplanner/framework/lang/DoubleUtilsTest.java rename to utils/src/test/java/org/opentripplanner/utils/lang/DoubleUtilsTest.java diff --git a/framework/src/test/java/org/opentripplanner/framework/lang/IntBoxTest.java b/utils/src/test/java/org/opentripplanner/utils/lang/IntBoxTest.java similarity index 100% rename from framework/src/test/java/org/opentripplanner/framework/lang/IntBoxTest.java rename to utils/src/test/java/org/opentripplanner/utils/lang/IntBoxTest.java diff --git a/framework/src/test/java/org/opentripplanner/framework/lang/IntRangeTest.java b/utils/src/test/java/org/opentripplanner/utils/lang/IntRangeTest.java similarity index 100% rename from framework/src/test/java/org/opentripplanner/framework/lang/IntRangeTest.java rename to utils/src/test/java/org/opentripplanner/utils/lang/IntRangeTest.java diff --git a/framework/src/test/java/org/opentripplanner/framework/lang/IntUtilsTest.java b/utils/src/test/java/org/opentripplanner/utils/lang/IntUtilsTest.java similarity index 100% rename from framework/src/test/java/org/opentripplanner/framework/lang/IntUtilsTest.java rename to utils/src/test/java/org/opentripplanner/utils/lang/IntUtilsTest.java diff --git a/framework/src/test/java/org/opentripplanner/framework/lang/MemEfficientArrayBuilderTest.java b/utils/src/test/java/org/opentripplanner/utils/lang/MemEfficientArrayBuilderTest.java similarity index 100% rename from framework/src/test/java/org/opentripplanner/framework/lang/MemEfficientArrayBuilderTest.java rename to utils/src/test/java/org/opentripplanner/utils/lang/MemEfficientArrayBuilderTest.java diff --git a/framework/src/test/java/org/opentripplanner/framework/lang/ObjectUtilsTest.java b/utils/src/test/java/org/opentripplanner/utils/lang/ObjectUtilsTest.java similarity index 100% rename from framework/src/test/java/org/opentripplanner/framework/lang/ObjectUtilsTest.java rename to utils/src/test/java/org/opentripplanner/utils/lang/ObjectUtilsTest.java diff --git a/framework/src/test/java/org/opentripplanner/framework/lang/OtpNumberFormatTest.java b/utils/src/test/java/org/opentripplanner/utils/lang/OtpNumberFormatTest.java similarity index 100% rename from framework/src/test/java/org/opentripplanner/framework/lang/OtpNumberFormatTest.java rename to utils/src/test/java/org/opentripplanner/utils/lang/OtpNumberFormatTest.java diff --git a/framework/src/test/java/org/opentripplanner/framework/lang/StringUtilsTest.java b/utils/src/test/java/org/opentripplanner/utils/lang/StringUtilsTest.java similarity index 100% rename from framework/src/test/java/org/opentripplanner/framework/lang/StringUtilsTest.java rename to utils/src/test/java/org/opentripplanner/utils/lang/StringUtilsTest.java diff --git a/framework/src/test/java/org/opentripplanner/framework/logging/ProgressTrackerTest.java b/utils/src/test/java/org/opentripplanner/utils/logging/ProgressTrackerTest.java similarity index 100% rename from framework/src/test/java/org/opentripplanner/framework/logging/ProgressTrackerTest.java rename to utils/src/test/java/org/opentripplanner/utils/logging/ProgressTrackerTest.java diff --git a/framework/src/test/java/org/opentripplanner/framework/logging/ThrottleTest.java b/utils/src/test/java/org/opentripplanner/utils/logging/ThrottleTest.java similarity index 100% rename from framework/src/test/java/org/opentripplanner/framework/logging/ThrottleTest.java rename to utils/src/test/java/org/opentripplanner/utils/logging/ThrottleTest.java diff --git a/framework/src/test/java/org/opentripplanner/framework/text/CharacterEscapeFormatterTest.java b/utils/src/test/java/org/opentripplanner/utils/text/CharacterEscapeFormatterTest.java similarity index 100% rename from framework/src/test/java/org/opentripplanner/framework/text/CharacterEscapeFormatterTest.java rename to utils/src/test/java/org/opentripplanner/utils/text/CharacterEscapeFormatterTest.java diff --git a/framework/src/test/java/org/opentripplanner/framework/text/FileSizeToTextConverterTest.java b/utils/src/test/java/org/opentripplanner/utils/text/FileSizeToTextConverterTest.java similarity index 100% rename from framework/src/test/java/org/opentripplanner/framework/text/FileSizeToTextConverterTest.java rename to utils/src/test/java/org/opentripplanner/utils/text/FileSizeToTextConverterTest.java diff --git a/framework/src/test/java/org/opentripplanner/framework/text/HexStringTest.java b/utils/src/test/java/org/opentripplanner/utils/text/HexStringTest.java similarity index 100% rename from framework/src/test/java/org/opentripplanner/framework/text/HexStringTest.java rename to utils/src/test/java/org/opentripplanner/utils/text/HexStringTest.java diff --git a/framework/src/test/java/org/opentripplanner/framework/text/MarkdownFormatterTest.java b/utils/src/test/java/org/opentripplanner/utils/text/MarkdownFormatterTest.java similarity index 100% rename from framework/src/test/java/org/opentripplanner/framework/text/MarkdownFormatterTest.java rename to utils/src/test/java/org/opentripplanner/utils/text/MarkdownFormatterTest.java diff --git a/framework/src/test/java/org/opentripplanner/framework/text/TableTest.java b/utils/src/test/java/org/opentripplanner/utils/text/TableTest.java similarity index 100% rename from framework/src/test/java/org/opentripplanner/framework/text/TableTest.java rename to utils/src/test/java/org/opentripplanner/utils/text/TableTest.java diff --git a/framework/src/test/java/org/opentripplanner/framework/time/CountdownTimerTest.java b/utils/src/test/java/org/opentripplanner/utils/time/CountdownTimerTest.java similarity index 100% rename from framework/src/test/java/org/opentripplanner/framework/time/CountdownTimerTest.java rename to utils/src/test/java/org/opentripplanner/utils/time/CountdownTimerTest.java diff --git a/framework/src/test/java/org/opentripplanner/framework/time/DateUtilsTest.java b/utils/src/test/java/org/opentripplanner/utils/time/DateUtilsTest.java similarity index 100% rename from framework/src/test/java/org/opentripplanner/framework/time/DateUtilsTest.java rename to utils/src/test/java/org/opentripplanner/utils/time/DateUtilsTest.java diff --git a/framework/src/test/java/org/opentripplanner/framework/time/DurationUtilsTest.java b/utils/src/test/java/org/opentripplanner/utils/time/DurationUtilsTest.java similarity index 100% rename from framework/src/test/java/org/opentripplanner/framework/time/DurationUtilsTest.java rename to utils/src/test/java/org/opentripplanner/utils/time/DurationUtilsTest.java diff --git a/framework/src/test/java/org/opentripplanner/framework/time/LocalDateUtilsTest.java b/utils/src/test/java/org/opentripplanner/utils/time/LocalDateUtilsTest.java similarity index 100% rename from framework/src/test/java/org/opentripplanner/framework/time/LocalDateUtilsTest.java rename to utils/src/test/java/org/opentripplanner/utils/time/LocalDateUtilsTest.java diff --git a/framework/src/test/java/org/opentripplanner/framework/time/OffsetDateTimeParserTest.java b/utils/src/test/java/org/opentripplanner/utils/time/OffsetDateTimeParserTest.java similarity index 100% rename from framework/src/test/java/org/opentripplanner/framework/time/OffsetDateTimeParserTest.java rename to utils/src/test/java/org/opentripplanner/utils/time/OffsetDateTimeParserTest.java diff --git a/framework/src/test/java/org/opentripplanner/framework/time/ServiceDateUtilsTest.java b/utils/src/test/java/org/opentripplanner/utils/time/ServiceDateUtilsTest.java similarity index 100% rename from framework/src/test/java/org/opentripplanner/framework/time/ServiceDateUtilsTest.java rename to utils/src/test/java/org/opentripplanner/utils/time/ServiceDateUtilsTest.java diff --git a/framework/src/test/java/org/opentripplanner/framework/time/TimeUtilsTest.java b/utils/src/test/java/org/opentripplanner/utils/time/TimeUtilsTest.java similarity index 100% rename from framework/src/test/java/org/opentripplanner/framework/time/TimeUtilsTest.java rename to utils/src/test/java/org/opentripplanner/utils/time/TimeUtilsTest.java diff --git a/framework/src/test/java/org/opentripplanner/framework/time/ZoneIds.java b/utils/src/test/java/org/opentripplanner/utils/time/ZoneIds.java similarity index 100% rename from framework/src/test/java/org/opentripplanner/framework/time/ZoneIds.java rename to utils/src/test/java/org/opentripplanner/utils/time/ZoneIds.java diff --git a/framework/src/test/java/org/opentripplanner/framework/tostring/MultiLineToStringBuilderTest.java b/utils/src/test/java/org/opentripplanner/utils/tostring/MultiLineToStringBuilderTest.java similarity index 100% rename from framework/src/test/java/org/opentripplanner/framework/tostring/MultiLineToStringBuilderTest.java rename to utils/src/test/java/org/opentripplanner/utils/tostring/MultiLineToStringBuilderTest.java diff --git a/framework/src/test/java/org/opentripplanner/framework/tostring/ToStringBuilderTest.java b/utils/src/test/java/org/opentripplanner/utils/tostring/ToStringBuilderTest.java similarity index 100% rename from framework/src/test/java/org/opentripplanner/framework/tostring/ToStringBuilderTest.java rename to utils/src/test/java/org/opentripplanner/utils/tostring/ToStringBuilderTest.java diff --git a/framework/src/test/java/org/opentripplanner/framework/tostring/ValueObjectToStringBuilderTest.java b/utils/src/test/java/org/opentripplanner/utils/tostring/ValueObjectToStringBuilderTest.java similarity index 100% rename from framework/src/test/java/org/opentripplanner/framework/tostring/ValueObjectToStringBuilderTest.java rename to utils/src/test/java/org/opentripplanner/utils/tostring/ValueObjectToStringBuilderTest.java From 09e2de79e913a931c90958d24352bd40d6797827 Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Tue, 29 Oct 2024 22:42:43 +0100 Subject: [PATCH 087/110] Rename all packages in utils from framework to utils We do this in a separate PR from moving the files to keep git-history. --- application/pom.xml | 2 +- .../ext/flex/FlexStopTimesForTest.java | 2 +- .../template/FlexTemplateFactoryTest.java | 2 +- .../flex/trip/ScheduledDeviatedTripTest.java | 2 +- .../ext/flex/trip/UnscheduledTripTest.java | 6 +++--- .../RealtimeResolverTest.java | 2 +- .../vectortiles/VectorTilesConfigDocTest.java | 2 +- .../layers/stops/RealtimeStopsLayerTest.java | 2 +- ...leRentalServiceDirectoryConfigDocTest.java | 2 +- .../api/DataOverlayParameters.java | 2 +- .../configuration/DataOverlayConfig.java | 2 +- .../DataOverlayParameterBindings.java | 2 +- .../configuration/IndexVariable.java | 2 +- .../configuration/ParameterBinding.java | 2 +- .../ext/dataoverlay/routing/Parameter.java | 2 +- .../ext/emissions/Co2EmissionsDataReader.java | 4 ++-- .../ext/emissions/DecorateWithEmission.java | 2 +- .../emissions/DefaultEmissionsService.java | 2 +- .../ext/emissions/EmissionsService.java | 2 +- .../ext/fares/FaresToItineraryMapper.java | 2 +- .../impl/CombinedInterlinedTransitLeg.java | 2 +- .../ext/fares/model/Distance.java | 2 +- .../ext/fares/model/FareRule.java | 2 +- .../ext/flex/AreaStopsToVerticesMapper.java | 2 +- .../ext/flex/FlexAccessEgress.java | 2 +- .../ext/flex/FlexPathDurations.java | 2 +- .../opentripplanner/ext/flex/FlexRouter.java | 2 +- .../ext/flex/FlexTripsMapper.java | 2 +- .../ext/flex/FlexibleTransitLeg.java | 4 ++-- .../ext/flex/flexpathcalculator/FlexPath.java | 2 +- .../flex/template/AbstractFlexTemplate.java | 2 +- .../ext/flex/template/ClosestTrip.java | 2 +- .../ext/flex/trip/StopTimeWindow.java | 2 +- .../ext/flex/trip/UnscheduledTrip.java | 6 +++--- .../ext/geocoder/LuceneIndex.java | 2 +- .../ext/geocoder/StopClusterMapper.java | 2 +- .../debug/raptor/RaptorDebugModel.java | 2 +- .../ext/reportapi/model/CsvReportBuilder.java | 4 ++-- .../ext/reportapi/model/TransfersReport.java | 2 +- .../ext/restapi/mapping/LocalDateMapper.java | 2 +- .../ext/restapi/model/ApiBookingInfo.java | 2 +- .../ext/restapi/model/ApiBookingTime.java | 2 +- .../ext/restapi/model/ApiContactInfo.java | 2 +- .../ext/restapi/resources/IndexAPI.java | 2 +- .../resources/RequestToPreferencesMapper.java | 2 +- .../restapi/resources/RoutingResource.java | 4 ++-- ...DigitransitRealtimeStopPropertyMapper.java | 2 +- .../vehicleparking/bikeep/BikeepUpdater.java | 2 +- .../parkapi/ParkAPIUpdater.java | 2 +- .../sirifm/SiriFmDatasource.java | 2 +- .../apis/gtfs/GraphQLScalars.java | 2 +- .../apis/gtfs/datafetchers/PatternImpl.java | 2 +- .../apis/gtfs/datafetchers/QueryTypeImpl.java | 2 +- .../apis/gtfs/datafetchers/StopImpl.java | 2 +- .../apis/gtfs/datafetchers/TripImpl.java | 2 +- .../BicyclePreferencesMapper.java | 2 +- .../routerequest/RouteRequestMapper.java | 2 +- .../TransitPreferencesMapper.java | 4 ++-- .../apis/transmodel/TransmodelGraph.java | 2 +- .../transmodel/mapping/TransitIdMapper.java | 2 +- .../framework/PenaltyForStreetModeType.java | 2 +- .../StreetModeDurationInputType.java | 2 +- .../transmodel/model/plan/RelaxCostType.java | 2 +- .../plan/TripPatternTimePenaltyType.java | 2 +- .../model/scalars/DateTimeScalarFactory.java | 2 +- ...UnprocessableRequestExecutionStrategy.java | 2 +- .../apis/vectortiles/DebugStyleSpec.java | 2 +- .../apis/vectortiles/model/StyleBuilder.java | 2 +- .../model/ZoomDependentNumber.java | 3 --- .../java/org/opentripplanner/astar/AStar.java | 2 +- .../datastore/api/DataSource.java | 2 +- .../https/HttpsDataSourceMetadata.java | 2 +- .../framework/application/LogMDCSupport.java | 2 +- .../geometry/CompactElevationProfile.java | 2 +- .../geometry/CompactLineStringUtils.java | 2 +- .../geometry/HashGridSpatialIndex.java | 2 +- .../framework/geometry/WgsCoordinate.java | 4 ++-- .../graphql/scalar/CostScalarFactory.java | 2 +- .../graphql/scalar/DurationScalarFactory.java | 2 +- .../opentripplanner/framework/model/Cost.java | 4 ++-- .../framework/model/TimeAndCost.java | 2 +- .../framework/model/Units.java | 4 ++-- .../framework/time/ZoneIdFallback.java | 2 +- .../framework/token/Serializer.java | 2 +- .../framework/token/TokenBuilder.java | 2 +- .../framework/token/TokenDefinition.java | 2 +- .../token/TokenDefinitionBuilder.java | 4 ++-- .../token/TokenFormatterConfiguration.java | 2 +- .../framework/token/TokenSchema.java | 2 +- .../framework/token/TokenType.java | 2 +- .../graph_builder/GraphBuilder.java | 4 ++-- .../graph_builder/issue/api/Issue.java | 2 +- .../issue/report/DataImportIssueReporter.java | 2 +- .../graph_builder/issues/HopZeroDistance.java | 2 +- .../module/DirectTransferGenerator.java | 2 +- .../module/StreetLinkerModule.java | 2 +- ...ateAndInterpolateStopTimesForEachTrip.java | 2 +- .../CalculateWorldEnvelopeModule.java | 2 +- .../module/ned/ElevationModule.java | 6 +++--- .../module/ned/MissingElevationHandler.java | 2 +- .../graph_builder/module/osm/OsmDatabase.java | 2 +- .../graph_builder/module/osm/OsmModule.java | 2 +- .../module/osm/naming/SidewalkNamer.java | 4 ++-- .../gtfs/GenerateTripPatternsOperation.java | 2 +- .../gtfs/interlining/InterlineProcessor.java | 2 +- .../gtfs/mapping/AgencyMapper.java | 2 +- .../gtfs/mapping/BoardingAreaMapper.java | 2 +- .../gtfs/mapping/EntranceMapper.java | 2 +- .../gtfs/mapping/FareAttributeMapper.java | 2 +- .../gtfs/mapping/FareRuleMapper.java | 2 +- .../gtfs/mapping/FeedInfoMapper.java | 2 +- .../gtfs/mapping/FrequencyMapper.java | 2 +- .../gtfs/mapping/LocationGroupMapper.java | 2 +- .../gtfs/mapping/LocationMapper.java | 2 +- .../gtfs/mapping/PathwayMapper.java | 2 +- .../gtfs/mapping/PathwayNodeMapper.java | 2 +- .../gtfs/mapping/RouteMapper.java | 2 +- .../mapping/ServiceCalendarDateMapper.java | 2 +- .../gtfs/mapping/ServiceCalendarMapper.java | 2 +- .../gtfs/mapping/ShapePointMapper.java | 2 +- .../gtfs/mapping/StopMapper.java | 2 +- .../gtfs/mapping/StopTimeMapper.java | 2 +- .../gtfs/mapping/TripMapper.java | 2 +- .../vector/edge/EdgePropertyMapper.java | 4 ++-- .../vector/vertex/VertexPropertyMapper.java | 2 +- .../org/opentripplanner/model/Frequency.java | 2 +- .../model/GenericLocation.java | 4 ++-- .../opentripplanner/model/PathTransfer.java | 2 +- .../org/opentripplanner/model/StopTime.java | 2 +- .../opentripplanner/model/SystemNotice.java | 2 +- .../org/opentripplanner/model/Timetable.java | 2 +- .../model/TimetableSnapshot.java | 2 +- .../model/calendar/CalendarServiceData.java | 2 +- .../model/calendar/ServiceCalendarDate.java | 2 +- .../model/calendar/ServiceDateInterval.java | 2 +- .../calendar/openinghours/OHCalendar.java | 2 +- .../calendar/openinghours/OpeningHours.java | 2 +- .../openinghours/OsmOpeningHoursSupport.java | 2 +- .../model/fare/FareMedium.java | 2 +- .../model/fare/FareProduct.java | 4 ++-- .../model/fare/FareProductUse.java | 2 +- .../model/fare/ItineraryFares.java | 4 ++-- .../model/fare/RiderCategory.java | 2 +- .../modes/AllowMainAndSubModeFilter.java | 2 +- .../modes/AllowMainAndSubModesFilter.java | 2 +- .../model/modes/AllowMainModeFilter.java | 2 +- .../model/modes/AllowMainModesFilter.java | 2 +- .../model/modes/ExcludeAllTransitFilter.java | 2 +- .../model/plan/ElevationProfile.java | 4 ++-- .../opentripplanner/model/plan/Emissions.java | 2 +- .../model/plan/FrequencyTransitLeg.java | 2 +- .../opentripplanner/model/plan/Itinerary.java | 4 ++-- .../model/plan/ItinerarySortKey.java | 2 +- .../org/opentripplanner/model/plan/Leg.java | 2 +- .../org/opentripplanner/model/plan/Place.java | 2 +- .../model/plan/ScheduledTransitLeg.java | 6 +++--- .../model/plan/StopArrival.java | 2 +- .../model/plan/StopArrivalMapper.java | 2 +- .../opentripplanner/model/plan/StreetLeg.java | 4 ++-- .../opentripplanner/model/plan/TripPlan.java | 2 +- .../model/plan/UnknownTransitPathLeg.java | 4 ++-- .../opentripplanner/model/plan/WalkStep.java | 4 ++-- .../model/plan/WalkStepBuilder.java | 4 ++-- .../ScheduledTransitLegReference.java | 2 +- .../model/plan/paging/cursor/PageCursor.java | 4 ++-- .../plan/paging/cursor/PageCursorFactory.java | 2 +- .../paging/cursor/PageCursorSerializer.java | 2 +- .../model/projectinfo/VersionControlInfo.java | 2 +- .../model/transfer/ConstrainedTransfer.java | 2 +- .../transfer/RouteStopTransferPoint.java | 2 +- .../model/transfer/StationTransferPoint.java | 2 +- .../model/transfer/TransferConstraint.java | 2 +- .../model/transfer/TripTransferPoint.java | 2 +- .../netex/config/NetexFeedParameters.java | 2 +- .../mapping/AuthorityToAgencyMapper.java | 2 +- .../mapping/MultilingualStringMapper.java | 2 +- .../netex/mapping/OperatorToAgencyMapper.java | 2 +- .../org/opentripplanner/osm/OsmProvider.java | 4 ++-- .../osm/model/OsmWithTags.java | 2 +- .../specifier/BestMatchSpecifier.java | 2 +- .../raptor/api/debug/DebugEvent.java | 2 +- .../model/GeneralizedCostRelaxFunction.java | 4 ++-- .../raptor/api/model/RaptorAccessEgress.java | 4 ++-- .../raptor/api/model/RaptorTransfer.java | 2 +- .../raptor/api/path/PathLeg.java | 4 ++-- .../raptor/api/path/PathStringBuilder.java | 4 ++-- .../raptor/api/request/DebugRequest.java | 2 +- .../api/request/MultiCriteriaRequest.java | 2 +- .../raptor/api/request/PassThroughPoint.java | 2 +- .../raptor/api/request/RaptorRequest.java | 2 +- .../api/request/RaptorViaConnection.java | 2 +- .../raptor/api/request/RaptorViaLocation.java | 4 ++-- .../raptor/api/request/SearchParams.java | 2 +- .../api/request/SearchParamsBuilder.java | 2 +- .../raptor/api/response/RaptorResponse.java | 2 +- .../raptor/api/view/ArrivalView.java | 2 +- .../raptor/path/PathBuilderLeg.java | 2 +- .../rangeraptor/SystemErrDebugLogger.java | 20 +++++++++---------- .../internalapi/HeuristicAtStop.java | 4 ++-- .../multicriteria/ride/c1/PatternRideC1.java | 2 +- .../ride/c2/PassThroughRideFactory.java | 2 +- .../multicriteria/ride/c2/PatternRideC2.java | 2 +- .../path/DestinationArrivalPaths.java | 4 ++-- .../MinTravelDurationRoutingStrategy.java | 2 +- .../standard/besttimes/BestTimes.java | 4 ++-- .../SimpleBestNumberOfTransfers.java | 2 +- .../heuristics/HeuristicsAdapter.java | 6 +++--- .../stoparrivals/AccessStopArrivalState.java | 2 +- .../stoparrivals/DefaultStopArrivalState.java | 2 +- .../stoparrivals/EgressStopArrivalState.java | 2 +- .../path/EgressArrivalToPathAdapter.java | 4 ++-- .../ForwardRaptorTransitCalculator.java | 2 +- .../transit/RaptorTransitCalculator.java | 2 +- .../ReverseRaptorTransitCalculator.java | 2 +- .../transit/TripScheduleExactMatchSearch.java | 2 +- .../rangeraptor/transit/TripTimesSearch.java | 2 +- .../raptor/service/DebugHeuristics.java | 2 +- .../raptor/service/HeuristicSearchTask.java | 2 +- .../raptor/spi/BoardAndAlightTime.java | 4 ++-- .../raptor/util/CompareIntArrays.java | 2 +- .../routing/TripTimeOnDateHelper.java | 2 +- .../routing/algorithm/RoutingWorker.java | 2 +- .../ItineraryListFilterChainBuilder.java | 4 ++-- .../filterchain/api/GroupBySimilarity.java | 2 +- .../TransitGeneralizedCostFilterParams.java | 2 +- .../filters/system/NumItinerariesFilter.java | 2 +- .../system/NumItinerariesFilterResults.java | 6 +++--- .../filters/system/PagingFilter.java | 2 +- .../transit/TransitGeneralizedCostFilter.java | 2 +- .../framework/groupids/GroupByDistance.java | 2 +- .../framework/sort/SortOrderComparator.java | 2 +- .../raptoradapter/path/PathDiff.java | 16 +++++++-------- .../router/street/AccessEgressRouter.java | 2 +- .../raptoradapter/transit/Transfer.java | 4 ++-- .../transit/TransitTuningParameters.java | 2 +- .../transit/TripPatternForDate.java | 2 +- .../ConstrainedTransfersForPatterns.java | 2 +- .../cost/GeneralizedCostParameters.java | 2 +- .../request/RaptorRequestTransferCache.java | 2 +- .../RaptorRoutingRequestTransitData.java | 2 +- ...aptorRoutingRequestTransitDataCreator.java | 6 +++--- .../transit/request/TripPatternForDates.java | 2 +- .../request/TripScheduleAlightSearch.java | 2 +- .../request/TripScheduleBoardSearch.java | 2 +- .../request/TripScheduleWithOffset.java | 2 +- .../OptimizeTransferService.java | 2 +- .../model/BasicStopTime.java | 2 +- .../model/MinSafeTransferTimeCalculator.java | 4 ++-- .../model/OptimizedPathTail.java | 2 +- .../model/StopPriorityCostCalculator.java | 2 +- .../model/TripStopTime.java | 2 +- .../model/TripToTripTransfer.java | 2 +- .../costfilter/MinCostPathTailFilter.java | 2 +- .../PassThroughPathTailFilter.java | 2 +- .../services/TransitPathLegSelector.java | 2 +- .../alternativelegs/AlternativeLegs.java | 2 +- .../routing/api/request/DebugRaptor.java | 2 +- .../routing/api/request/RequestModes.java | 2 +- .../routing/api/request/RouteRequest.java | 10 +++++----- .../request/framework/DurationForEnum.java | 2 +- .../LinearFunctionSerialization.java | 6 +++--- .../framework/TimeAndCostPenaltyForEnum.java | 2 +- .../api/request/framework/TimePenalty.java | 4 ++-- .../preference/AccessEgressPreferences.java | 2 +- .../preference/AccessibilityPreferences.java | 2 +- .../request/preference/BikePreferences.java | 6 +++--- .../request/preference/CarPreferences.java | 6 +++--- .../preference/ElevatorPreferences.java | 2 +- .../ItineraryFilterPreferences.java | 2 +- .../request/preference/RaptorPreferences.java | 2 +- .../routing/api/request/preference/Relax.java | 4 ++-- .../preference/RoutingPreferences.java | 2 +- .../preference/ScooterPreferences.java | 6 +++--- .../request/preference/StreetPreferences.java | 6 ++---- .../request/preference/SystemPreferences.java | 2 +- .../preference/TimeSlopeSafetyTriangle.java | 4 ++-- .../TransferOptimizationPreferences.java | 4 ++-- .../preference/TransferPreferences.java | 6 +++--- .../preference/TransitPreferences.java | 2 +- .../preference/VehicleParkingPreferences.java | 2 +- .../preference/VehicleRentalPreferences.java | 2 +- .../preference/VehicleWalkingPreferences.java | 2 +- .../request/preference/WalkPreferences.java | 4 ++-- .../preference/WheelchairPreferences.java | 2 +- .../filter/VehicleParkingFilter.java | 2 +- .../request/request/filter/SelectRequest.java | 2 +- .../request/filter/TransitFilterRequest.java | 2 +- .../request/filter/TransitGroupSelect.java | 2 +- .../request/via/PassThroughViaLocation.java | 2 +- .../api/request/via/VisitViaLocation.java | 4 ++-- .../routing/api/response/RoutingError.java | 2 +- .../routing/api/response/RoutingResponse.java | 2 +- .../api/response/TripSearchMetadata.java | 2 +- .../routing/graph/SerializedGraphObject.java | 4 ++-- .../routing/graph/index/StreetIndex.java | 2 +- .../routing/graphfinder/PatternAtStop.java | 2 +- .../StopFinderTraverseVisitor.java | 2 +- .../service/DefaultRoutingService.java | 2 +- .../routing/stoptimes/StopTimesHelper.java | 2 +- .../vehicle_parking/VehicleParking.java | 2 +- .../VehicleParkingEntrance.java | 2 +- .../vehicle_parking/VehicleParkingGroup.java | 2 +- .../vehicle_parking/VehicleParkingSpaces.java | 2 +- .../service/paging/PagingService.java | 2 +- .../model/VehicleRentalStation.java | 2 +- .../worldenvelope/model/WorldEnvelope.java | 2 +- .../standalone/config/BuildConfig.java | 2 +- .../config/framework/json/ConfigType.java | 6 +++--- .../config/framework/json/EnumMapper.java | 2 +- .../config/framework/json/NodeInfo.java | 4 ++-- .../framework/json/ParameterBuilder.java | 4 ++-- .../routerequest/RouteRequestConfig.java | 2 +- .../configure/ConstructApplication.java | 2 +- .../standalone/server/EtagRequestFilter.java | 2 +- .../standalone/server/RequestTraceFilter.java | 2 +- .../server/RequestTraceParameter.java | 2 +- .../street/model/edge/ElevatorBoardEdge.java | 1 - .../street/model/edge/ElevatorHopEdge.java | 1 - .../street/model/edge/StreetEdge.java | 4 ++-- .../street/model/edge/StreetEdgeBuilder.java | 2 +- .../model/edge/StreetElevationExtension.java | 2 +- .../model/edge/StreetTransitEntityLink.java | 1 - .../model/edge/StreetVehicleParkingLink.java | 1 - .../model/note/StreetNoteAndMatcher.java | 2 +- .../model/vertex/IntersectionVertex.java | 2 +- .../vertex/OsmBoardingLocationVertex.java | 2 +- .../street/search/state/State.java | 4 ++-- .../api/request/TripOnServiceDateRequest.java | 2 +- .../transit/model/basic/Money.java | 2 +- .../transit/model/framework/Deduplicator.java | 2 +- .../transit/model/framework/FeedScopedId.java | 4 ++-- .../transit/model/network/Route.java | 2 +- .../transit/model/network/StopPattern.java | 2 +- .../transit/model/network/TripPattern.java | 2 +- .../TransitGroupPriorityService.java | 2 +- .../transit/model/organization/Agency.java | 2 +- .../model/organization/ContactInfo.java | 2 +- .../transit/model/organization/Operator.java | 2 +- .../transit/model/site/StopLocation.java | 2 +- .../model/site/StopLocationsGroup.java | 2 +- .../model/timetable/ScheduledTripTimes.java | 6 +++--- .../timetable/ScheduledTripTimesBuilder.java | 2 +- .../transit/model/timetable/Trip.java | 4 ++-- .../timetable/TripTimesStringBuilder.java | 2 +- .../model/timetable/booking/BookingInfo.java | 2 +- .../model/timetable/booking/BookingTime.java | 2 +- .../timetable/booking/RoutingBookingInfo.java | 2 +- .../service/DefaultTransitService.java | 2 +- .../transit/service/SiteRepository.java | 4 ++-- .../transit/service/StopModelIndex.java | 2 +- .../transit/service/TimetableRepository.java | 4 ++-- .../updater/GtfsRealtimeFuzzyTripMatcher.java | 4 ++-- .../alert/GtfsRealtimeAlertsUpdater.java | 2 +- .../updater/siri/AddedTripBuilder.java | 2 +- .../updater/siri/DebugString.java | 2 +- .../updater/siri/ModifiedTripBuilder.java | 2 +- .../updater/siri/SiriFuzzyTripMatcher.java | 2 +- .../updater/siri/TimetableHelper.java | 2 +- .../GooglePubsubEstimatedTimetableSource.java | 4 ++-- .../SiriETGooglePubsubUpdaterParameters.java | 2 +- .../updater/spi/ResultLogger.java | 2 +- .../updater/spi/UpdateSuccess.java | 2 +- .../trip/GtfsRealtimeTripUpdateSource.java | 2 +- .../updater/trip/MqttGtfsRealtimeUpdater.java | 2 +- .../updater/trip/PollingTripUpdater.java | 2 +- .../updater/trip/TimetableSnapshotSource.java | 4 ++-- .../vehicle_parking/AvailabiltyUpdate.java | 2 +- .../VehicleParkingAvailabilityUpdater.java | 2 +- .../VehicleParkingUpdater.java | 2 +- ...GtfsRealtimeHttpVehiclePositionSource.java | 2 +- .../PollingVehiclePositionUpdater.java | 2 +- .../RealtimeVehiclePatternMatcher.java | 4 ++-- .../vehicle_rental/VehicleRentalUpdater.java | 10 +++++----- .../datasources/GbfsGeofencingZoneMapper.java | 2 +- .../GbfsVehicleRentalDataSource.java | 2 +- .../org/opentripplanner/DateTimeHelper.java | 2 +- .../apis/gtfs/GraphQLIntegrationTest.java | 2 +- .../mapping/TripRequestMapperTest.java | 2 +- .../plan/TripPlanTimePenaltyDtoTest.java | 2 +- .../support/ExecutionResultMapperTest.java | 2 +- .../datastore/OtpDataStoreTest.java | 2 +- .../framework/model/TimeAndCostTest.java | 2 +- .../token/TestTokenSchemaConstants.java | 2 +- .../doc/BuildConfigurationDocTest.java | 2 +- .../doc/EmissionsConfigurationDocTest.java | 2 +- .../doc/FlexConfigurationDocTest.java | 2 +- .../generate/doc/OsmMapperDocTest.java | 4 ++-- .../generate/doc/RideHailingDocTest.java | 2 +- .../generate/doc/RouteRequestDocTest.java | 2 +- .../doc/RouterConfigurationDocTest.java | 2 +- .../generate/doc/SiriAzureConfigDocTest.java | 2 +- .../generate/doc/SiriConfigDocTest.java | 2 +- .../doc/SiriGooglePubSubConfigDocTest.java | 2 +- .../generate/doc/UpdaterConfigDocTest.java | 2 +- .../generate/doc/VehicleParkingDocTest.java | 2 +- .../generate/doc/framework/AbstractTable.java | 10 +++++----- .../generate/doc/framework/DocBuilder.java | 4 ++-- .../doc/framework/DocBuilderTest.java | 2 +- .../doc/framework/ParameterDetailsList.java | 2 +- .../doc/framework/ParameterSummaryTable.java | 10 +++++----- .../generate/doc/support/ConfigTypeTable.java | 4 ++-- .../generate/doc/support/OTPFeatureTable.java | 10 +++++----- .../issue/api/DataImportIssueSummaryTest.java | 2 +- .../module/DirectTransferGeneratorTest.java | 2 +- .../ServiceCalendarDateMapperTest.java | 2 +- .../mapping/ServiceCalendarMapperTest.java | 2 +- .../CalendarServiceDataFactoryImplTest.java | 2 +- .../model/plan/PlanTestConstants.java | 4 ++-- .../model/plan/TestItineraryBuilder.java | 4 ++-- .../PagingSearchWindowAdjusterTest.java | 2 +- .../paging/cursor/PageCursorFactoryTest.java | 2 +- .../cursor/PageCursorSerializerTest.java | 2 +- .../plan/paging/cursor/PageCursorTest.java | 6 +++--- .../transfer/TransferConstraintTest.java | 2 +- .../raptor/_data/RaptorTestConstants.java | 4 ++-- .../_data/api/TestPathBuilderTestRaptor.java | 5 ++--- .../_data/stoparrival/BasicPathTestCase.java | 4 ++-- .../raptor/_data/stoparrival/Egress.java | 2 +- .../FlexAccessAndEgressPathTestCase.java | 6 +++--- .../_data/transit/TestAccessEgress.java | 2 +- .../TestConstrainedBoardingSearch.java | 2 +- .../transit/TestConstrainedTransfer.java | 2 +- .../raptor/_data/transit/TestRoute.java | 2 +- .../_data/transit/TestTransferPoint.java | 2 +- .../raptor/_data/transit/TestTripPattern.java | 2 +- .../_data/transit/TestTripSchedule.java | 6 +++--- .../raptor/api/path/PathTest.java | 4 ++-- .../raptor/moduletests/B01_AccessTest.java | 2 +- .../moduletests/F02_EgressWithRidesTest.java | 2 +- .../G01_AccessWithOpeningHoursTest.java | 2 +- .../G02_EgressWithOpeningHoursTest.java | 2 +- .../L01_TimePenaltyAccessTest.java | 2 +- .../L01_TimePenaltyEgressTest.java | 2 +- .../support/RaptorModuleTestCaseFactory.java | 2 +- .../arrivals/c1/StopArrivalFactoryC1Test.java | 4 ++-- .../arrivals/c2/StopArrivalFactoryC2Test.java | 4 ++-- .../rangeraptor/transit/EgressPathsTest.java | 2 +- .../ForwardRaptorTransitCalculatorTest.java | 2 +- .../transit/ForwardTransitCalculatorTest.java | 2 +- .../ReverseRaptorTransitCalculatorTest.java | 2 +- .../transit/TripTimesSearchTest.java | 4 ++-- .../raptor/spi/RaptorTripScheduleTest.java | 2 +- .../raptor/util/paretoset/ParetoSetTest.java | 2 +- ...RemoveBikeRentalWithMostlyWalkingTest.java | 4 ++-- ...emoveParkAndRideWithMostlyWalkingTest.java | 4 ++-- .../street/RemoveWalkOnlyFilterTest.java | 4 ++-- .../system/FlexSearchWindowFilterTest.java | 2 +- .../system/NumItinerariesFilterTest.java | 2 +- .../system/OutsideSearchWindowFilterTest.java | 2 +- .../filters/system/PagingFilterTest.java | 8 ++++---- .../mapping/PagingServiceFactoryTest.java | 4 ++-- .../RaptorPathToItineraryMapperTest.java | 2 +- .../algorithm/mapping/SnapshotTestBase.java | 2 +- .../AccessEgressPenaltyDecoratorTest.java | 2 +- ...rRoutingRequestTransitDataCreatorTest.java | 2 +- .../transit/request/TestRouteData.java | 2 +- .../MinSafeTransferTimeCalculatorTest.java | 4 ++-- .../TransferWaitTimeCostCalculatorTest.java | 2 +- .../model/TripStopTimeTest.java | 4 ++-- .../PassThroughNoTransfersTest.java | 2 +- .../PassThroughOneTransferTest.java | 2 +- .../PassThroughTwoTransfersTest.java | 2 +- .../WalkDurationForStopCombinations.java | 2 +- ...imizePathDomainServiceConstrainedTest.java | 2 +- .../OptimizePathDomainServiceTest.java | 2 +- .../services/TestTransferBuilder.java | 2 +- .../services/TransferGeneratorTest.java | 2 +- .../services/TransitPathLegSelectorTest.java | 2 +- .../algorithm/via/ViaRoutingWorkerTest.java | 2 +- .../framework/CostLinearFunctionTest.java | 2 +- .../LinearFunctionSerializationTest.java | 2 +- .../framework/TimeAndCostPenaltyTest.java | 2 +- .../request/framework/TimePenaltyTest.java | 2 +- .../paging/PS1_LegacyMetaDataTest.java | 2 +- ...FewItinerariesOnSearchWindowLimitTest.java | 2 +- .../service/paging/TestDriver.java | 4 ++-- .../service/paging/TestPagingModel.java | 4 ++-- .../config/OtpConfigLoaderTest.java | 2 +- .../framework/file/ConfigFileLoaderTest.java | 2 +- .../file/IncludeFileDirectiveTest.java | 2 +- .../timetable/ScheduledTripTimesTest.java | 2 +- .../timetable/booking/BookingTimeTest.java | 2 +- .../booking/RoutingBookingInfoTest.java | 2 +- .../transit/speed_test/ResultPrinter.java | 6 +++--- .../model/testcase/ItineraryResultMapper.java | 2 +- .../speed_test/model/testcase/Result.java | 6 +++--- .../model/testcase/TableTestReport.java | 12 +++++------ .../model/testcase/TestCaseDefinition.java | 6 +++--- .../model/testcase/io/AbstractCsvFile.java | 4 ++-- .../trip/TimetableSnapshotSourceTest.java | 2 +- .../updater/trip/TripInput.java | 2 +- .../updater/trip/TripUpdateBuilder.java | 2 +- .../utils/collection/CollectionUtils.java | 2 +- .../utils/collection/CollectionsView.java | 2 +- .../utils/collection/CompositeComparator.java | 2 +- .../utils/collection/ListSection.java | 2 +- .../utils/collection/ListUtils.java | 2 +- .../utils/collection/MapUtils.java | 2 +- .../utils/collection/SetUtils.java | 2 +- .../utils/lang/ArrayUtils.java | 2 +- .../utils/lang/BitSetUtils.java | 2 +- .../org/opentripplanner/utils/lang/Box.java | 2 +- .../utils/lang/DoubleUtils.java | 4 ++-- .../opentripplanner/utils/lang/IntBox.java | 2 +- .../opentripplanner/utils/lang/IntRange.java | 2 +- .../opentripplanner/utils/lang/IntUtils.java | 2 +- .../utils/lang/MemEfficientArrayBuilder.java | 2 +- .../utils/lang/ObjectUtils.java | 2 +- .../utils/lang/OtpNumberFormat.java | 2 +- .../opentripplanner/utils/lang/Sandbox.java | 2 +- .../utils/lang/StringUtils.java | 2 +- .../utils/logging/ProgressTracker.java | 6 +++--- .../logging/ProgressTrackerInputStream.java | 2 +- .../logging/ProgressTrackerOutputStream.java | 2 +- .../utils/logging/Throttle.java | 4 ++-- .../utils/text/CharacterEscapeFormatter.java | 2 +- .../utils/text/FileSizeToTextConverter.java | 2 +- .../opentripplanner/utils/text/HexString.java | 2 +- .../utils/text/MarkdownFormatter.java | 2 +- .../org/opentripplanner/utils/text/Table.java | 6 +++--- .../utils/text/TableBuilder.java | 2 +- .../utils/text/TableRowFormatter.java | 6 +++--- .../utils/time/CountdownTimer.java | 2 +- .../opentripplanner/utils/time/DateUtils.java | 2 +- .../utils/time/DurationUtils.java | 2 +- .../utils/time/LocalDateUtils.java | 2 +- .../utils/time/OffsetDateTimeParser.java | 2 +- .../utils/time/RelativeTime.java | 2 +- .../utils/time/ServiceDateUtils.java | 2 +- .../opentripplanner/utils/time/TimeUtils.java | 2 +- .../tostring/MultiLineToStringBuilder.java | 4 ++-- .../utils/tostring/ToStringBuilder.java | 12 +++++------ .../tostring/ValueObjectToStringBuilder.java | 8 ++++---- .../utils/collection/CollectionUtilsTest.java | 2 +- .../utils/collection/CollectionsViewTest.java | 2 +- .../collection/CompositeComparatorTest.java | 2 +- .../utils/collection/ListSectionTest.java | 2 +- .../utils/collection/ListUtilsTest.java | 6 +++--- .../utils/collection/MapUtilsTest.java | 4 ++-- .../utils/collection/SetUtilsTest.java | 2 +- .../utils/lang/ArrayUtilsTest.java | 4 ++-- .../utils/lang/BitSetUtilsTest.java | 2 +- .../opentripplanner/utils/lang/BoxTest.java | 2 +- .../utils/lang/DoubleUtilsTest.java | 14 ++++++------- .../utils/lang/IntBoxTest.java | 2 +- .../utils/lang/IntRangeTest.java | 2 +- .../utils/lang/IntUtilsTest.java | 20 +++++++++---------- .../lang/MemEfficientArrayBuilderTest.java | 2 +- .../utils/lang/ObjectUtilsTest.java | 2 +- .../utils/lang/OtpNumberFormatTest.java | 2 +- .../utils/lang/StringUtilsTest.java | 2 +- .../utils/logging/ProgressTrackerTest.java | 2 +- .../utils/logging/ThrottleTest.java | 2 +- .../text/CharacterEscapeFormatterTest.java | 2 +- .../text/FileSizeToTextConverterTest.java | 4 ++-- .../utils/text/HexStringTest.java | 2 +- .../utils/text/MarkdownFormatterTest.java | 2 +- .../opentripplanner/utils/text/TableTest.java | 8 ++++---- .../utils/time/CountdownTimerTest.java | 2 +- .../utils/time/DateUtilsTest.java | 4 ++-- .../utils/time/DurationUtilsTest.java | 12 +++++------ .../utils/time/LocalDateUtilsTest.java | 2 +- .../utils/time/OffsetDateTimeParserTest.java | 2 +- .../utils/time/ServiceDateUtilsTest.java | 4 ++-- .../utils/time/TimeUtilsTest.java | 2 +- .../opentripplanner/utils/time/ZoneIds.java | 2 +- .../MultiLineToStringBuilderTest.java | 2 +- .../utils/tostring/ToStringBuilderTest.java | 6 +++--- .../ValueObjectToStringBuilderTest.java | 2 +- 569 files changed, 774 insertions(+), 784 deletions(-) diff --git a/application/pom.xml b/application/pom.xml index 60765797344..f7ff90f8db0 100644 --- a/application/pom.xml +++ b/application/pom.xml @@ -20,7 +20,7 @@ ${project.groupId} - otp-framework + otp-utils ${project.version} diff --git a/application/src/ext-test/java/org/opentripplanner/ext/flex/FlexStopTimesForTest.java b/application/src/ext-test/java/org/opentripplanner/ext/flex/FlexStopTimesForTest.java index acf0d3b2699..50c2dd45340 100644 --- a/application/src/ext-test/java/org/opentripplanner/ext/flex/FlexStopTimesForTest.java +++ b/application/src/ext-test/java/org/opentripplanner/ext/flex/FlexStopTimesForTest.java @@ -3,11 +3,11 @@ import static org.opentripplanner.model.StopTime.MISSING_VALUE; import org.opentripplanner._support.geometry.Polygons; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.model.StopTime; import org.opentripplanner.transit.model._data.TimetableRepositoryForTest; import org.opentripplanner.transit.model.site.RegularStop; import org.opentripplanner.transit.model.site.StopLocation; +import org.opentripplanner.utils.time.TimeUtils; public class FlexStopTimesForTest { diff --git a/application/src/ext-test/java/org/opentripplanner/ext/flex/template/FlexTemplateFactoryTest.java b/application/src/ext-test/java/org/opentripplanner/ext/flex/template/FlexTemplateFactoryTest.java index cdb8bb8ff4e..159e25ff113 100644 --- a/application/src/ext-test/java/org/opentripplanner/ext/flex/template/FlexTemplateFactoryTest.java +++ b/application/src/ext-test/java/org/opentripplanner/ext/flex/template/FlexTemplateFactoryTest.java @@ -6,7 +6,7 @@ import static org.opentripplanner.ext.flex.template.BoardAlight.ALIGHT_ONLY; import static org.opentripplanner.ext.flex.template.BoardAlight.BOARD_AND_ALIGHT; import static org.opentripplanner.ext.flex.template.BoardAlight.BOARD_ONLY; -import static org.opentripplanner.framework.time.TimeUtils.time; +import static org.opentripplanner.utils.time.TimeUtils.time; import gnu.trove.set.hash.TIntHashSet; import java.time.Duration; diff --git a/application/src/ext-test/java/org/opentripplanner/ext/flex/trip/ScheduledDeviatedTripTest.java b/application/src/ext-test/java/org/opentripplanner/ext/flex/trip/ScheduledDeviatedTripTest.java index 4c77ecc6134..38f3a1fc2a8 100644 --- a/application/src/ext-test/java/org/opentripplanner/ext/flex/trip/ScheduledDeviatedTripTest.java +++ b/application/src/ext-test/java/org/opentripplanner/ext/flex/trip/ScheduledDeviatedTripTest.java @@ -24,7 +24,6 @@ import org.opentripplanner.framework.application.OTPFeature; import org.opentripplanner.framework.geometry.EncodedPolyline; import org.opentripplanner.framework.i18n.I18NString; -import org.opentripplanner.framework.time.ServiceDateUtils; import org.opentripplanner.graph_builder.module.ValidateAndInterpolateStopTimesForEachTrip; import org.opentripplanner.model.GenericLocation; import org.opentripplanner.model.StopTime; @@ -45,6 +44,7 @@ import org.opentripplanner.transit.model.site.AreaStop; import org.opentripplanner.transit.service.DefaultTransitService; import org.opentripplanner.transit.service.TimetableRepository; +import org.opentripplanner.utils.time.ServiceDateUtils; /** * This tests that the feed for the Cobb County Flex service is processed correctly. This service diff --git a/application/src/ext-test/java/org/opentripplanner/ext/flex/trip/UnscheduledTripTest.java b/application/src/ext-test/java/org/opentripplanner/ext/flex/trip/UnscheduledTripTest.java index d235dd5a950..cfcbc123642 100644 --- a/application/src/ext-test/java/org/opentripplanner/ext/flex/trip/UnscheduledTripTest.java +++ b/application/src/ext-test/java/org/opentripplanner/ext/flex/trip/UnscheduledTripTest.java @@ -17,14 +17,14 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; -import org.opentripplanner.framework.time.DurationUtils; -import org.opentripplanner.framework.time.TimeUtils; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.model.PickDrop; import org.opentripplanner.model.StopTime; import org.opentripplanner.transit.model._data.TimetableRepositoryForTest; import org.opentripplanner.transit.model.site.RegularStop; import org.opentripplanner.transit.model.site.StopLocation; +import org.opentripplanner.utils.time.DurationUtils; +import org.opentripplanner.utils.time.TimeUtils; +import org.opentripplanner.utils.tostring.ToStringBuilder; class UnscheduledTripTest { diff --git a/application/src/ext-test/java/org/opentripplanner/ext/realtimeresolver/RealtimeResolverTest.java b/application/src/ext-test/java/org/opentripplanner/ext/realtimeresolver/RealtimeResolverTest.java index 6150cfc6c18..80e5d1b153b 100644 --- a/application/src/ext-test/java/org/opentripplanner/ext/realtimeresolver/RealtimeResolverTest.java +++ b/application/src/ext-test/java/org/opentripplanner/ext/realtimeresolver/RealtimeResolverTest.java @@ -3,8 +3,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.opentripplanner.framework.time.TimeUtils.time; import static org.opentripplanner.model.plan.TestItineraryBuilder.newItinerary; +import static org.opentripplanner.utils.time.TimeUtils.time; import java.time.LocalDate; import java.util.List; diff --git a/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/VectorTilesConfigDocTest.java b/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/VectorTilesConfigDocTest.java index 51e1738ff6c..3a057182a67 100644 --- a/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/VectorTilesConfigDocTest.java +++ b/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/VectorTilesConfigDocTest.java @@ -3,11 +3,11 @@ import static org.opentripplanner.framework.io.FileUtils.assertFileEquals; import static org.opentripplanner.framework.io.FileUtils.readFile; import static org.opentripplanner.framework.io.FileUtils.writeFile; -import static org.opentripplanner.framework.text.MarkdownFormatter.HEADER_4; import static org.opentripplanner.generate.doc.framework.DocsTestConstants.TEMPLATE_PATH; import static org.opentripplanner.generate.doc.framework.DocsTestConstants.USER_DOC_PATH; import static org.opentripplanner.generate.doc.framework.TemplateUtil.replaceSection; import static org.opentripplanner.standalone.config.framework.json.JsonSupport.jsonNodeFromPath; +import static org.opentripplanner.utils.text.MarkdownFormatter.HEADER_4; import java.io.File; import org.junit.jupiter.api.Test; diff --git a/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/stops/RealtimeStopsLayerTest.java b/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/stops/RealtimeStopsLayerTest.java index 6723034f2a7..0db19baf6e5 100644 --- a/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/stops/RealtimeStopsLayerTest.java +++ b/application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/stops/RealtimeStopsLayerTest.java @@ -1,8 +1,8 @@ package org.opentripplanner.ext.vectortiles.layers.stops; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.opentripplanner.framework.time.TimeUtils.time; import static org.opentripplanner.model.plan.TestItineraryBuilder.newItinerary; +import static org.opentripplanner.utils.time.TimeUtils.time; import java.time.ZonedDateTime; import java.util.HashMap; diff --git a/application/src/ext-test/java/org/opentripplanner/ext/vehiclerentalservicedirectory/generatedoc/VehicleRentalServiceDirectoryConfigDocTest.java b/application/src/ext-test/java/org/opentripplanner/ext/vehiclerentalservicedirectory/generatedoc/VehicleRentalServiceDirectoryConfigDocTest.java index 2afcd95949c..06d75073029 100644 --- a/application/src/ext-test/java/org/opentripplanner/ext/vehiclerentalservicedirectory/generatedoc/VehicleRentalServiceDirectoryConfigDocTest.java +++ b/application/src/ext-test/java/org/opentripplanner/ext/vehiclerentalservicedirectory/generatedoc/VehicleRentalServiceDirectoryConfigDocTest.java @@ -4,13 +4,13 @@ import static org.opentripplanner.framework.io.FileUtils.assertFileEquals; import static org.opentripplanner.framework.io.FileUtils.readFile; import static org.opentripplanner.framework.io.FileUtils.writeFile; -import static org.opentripplanner.framework.text.MarkdownFormatter.HEADER_4; import static org.opentripplanner.generate.doc.framework.DocsTestConstants.TEMPLATE_PATH; import static org.opentripplanner.generate.doc.framework.DocsTestConstants.USER_DOC_PATH; import static org.opentripplanner.generate.doc.framework.TemplateUtil.replaceJsonExample; import static org.opentripplanner.generate.doc.framework.TemplateUtil.replaceParametersDetails; import static org.opentripplanner.generate.doc.framework.TemplateUtil.replaceParametersTable; import static org.opentripplanner.standalone.config.framework.json.JsonSupport.jsonNodeFromResource; +import static org.opentripplanner.utils.text.MarkdownFormatter.HEADER_4; import java.io.File; import org.junit.jupiter.api.Test; diff --git a/application/src/ext/java/org/opentripplanner/ext/dataoverlay/api/DataOverlayParameters.java b/application/src/ext/java/org/opentripplanner/ext/dataoverlay/api/DataOverlayParameters.java index 5e18a914d34..42a0209ba94 100644 --- a/application/src/ext/java/org/opentripplanner/ext/dataoverlay/api/DataOverlayParameters.java +++ b/application/src/ext/java/org/opentripplanner/ext/dataoverlay/api/DataOverlayParameters.java @@ -6,7 +6,7 @@ import java.util.Map; import java.util.stream.Collectors; import javax.annotation.Nullable; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * The purpose of this class is to hold all parameters and their value in a map. It also contains diff --git a/application/src/ext/java/org/opentripplanner/ext/dataoverlay/configuration/DataOverlayConfig.java b/application/src/ext/java/org/opentripplanner/ext/dataoverlay/configuration/DataOverlayConfig.java index c650bdf8a3c..858ac97d8ce 100644 --- a/application/src/ext/java/org/opentripplanner/ext/dataoverlay/configuration/DataOverlayConfig.java +++ b/application/src/ext/java/org/opentripplanner/ext/dataoverlay/configuration/DataOverlayConfig.java @@ -2,7 +2,7 @@ import java.io.Serializable; import java.util.List; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * POJO class describing expected data-overlay-config.json structure diff --git a/application/src/ext/java/org/opentripplanner/ext/dataoverlay/configuration/DataOverlayParameterBindings.java b/application/src/ext/java/org/opentripplanner/ext/dataoverlay/configuration/DataOverlayParameterBindings.java index c86cf24bb79..7b3d1f19bac 100644 --- a/application/src/ext/java/org/opentripplanner/ext/dataoverlay/configuration/DataOverlayParameterBindings.java +++ b/application/src/ext/java/org/opentripplanner/ext/dataoverlay/configuration/DataOverlayParameterBindings.java @@ -4,7 +4,7 @@ import java.util.List; import java.util.Optional; import org.opentripplanner.ext.dataoverlay.api.ParameterName; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; public class DataOverlayParameterBindings implements Serializable { diff --git a/application/src/ext/java/org/opentripplanner/ext/dataoverlay/configuration/IndexVariable.java b/application/src/ext/java/org/opentripplanner/ext/dataoverlay/configuration/IndexVariable.java index 56b55b3a6b0..720ded65f89 100644 --- a/application/src/ext/java/org/opentripplanner/ext/dataoverlay/configuration/IndexVariable.java +++ b/application/src/ext/java/org/opentripplanner/ext/dataoverlay/configuration/IndexVariable.java @@ -1,7 +1,7 @@ package org.opentripplanner.ext.dataoverlay.configuration; import java.io.Serializable; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * This class describes the variables for the incoming .nc data file diff --git a/application/src/ext/java/org/opentripplanner/ext/dataoverlay/configuration/ParameterBinding.java b/application/src/ext/java/org/opentripplanner/ext/dataoverlay/configuration/ParameterBinding.java index 94a992eb552..07a29d4c4c1 100644 --- a/application/src/ext/java/org/opentripplanner/ext/dataoverlay/configuration/ParameterBinding.java +++ b/application/src/ext/java/org/opentripplanner/ext/dataoverlay/configuration/ParameterBinding.java @@ -3,7 +3,7 @@ import java.io.Serializable; import org.opentripplanner.ext.dataoverlay.api.ParameterName; import org.opentripplanner.ext.dataoverlay.routing.Parameter; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * This class describes the expected routing request parameter for the generic data diff --git a/application/src/ext/java/org/opentripplanner/ext/dataoverlay/routing/Parameter.java b/application/src/ext/java/org/opentripplanner/ext/dataoverlay/routing/Parameter.java index 7b6078bb04f..542f7ee26dc 100644 --- a/application/src/ext/java/org/opentripplanner/ext/dataoverlay/routing/Parameter.java +++ b/application/src/ext/java/org/opentripplanner/ext/dataoverlay/routing/Parameter.java @@ -2,7 +2,7 @@ import org.opentripplanner.ext.dataoverlay.api.ParameterName; import org.opentripplanner.ext.dataoverlay.configuration.ParameterBinding; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; public class Parameter { diff --git a/application/src/ext/java/org/opentripplanner/ext/emissions/Co2EmissionsDataReader.java b/application/src/ext/java/org/opentripplanner/ext/emissions/Co2EmissionsDataReader.java index 597a7d89380..f3988265085 100644 --- a/application/src/ext/java/org/opentripplanner/ext/emissions/Co2EmissionsDataReader.java +++ b/application/src/ext/java/org/opentripplanner/ext/emissions/Co2EmissionsDataReader.java @@ -11,10 +11,10 @@ import java.util.Optional; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; -import org.opentripplanner.framework.lang.Sandbox; -import org.opentripplanner.framework.lang.StringUtils; import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.transit.model.framework.FeedScopedId; +import org.opentripplanner.utils.lang.Sandbox; +import org.opentripplanner.utils.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/ext/java/org/opentripplanner/ext/emissions/DecorateWithEmission.java b/application/src/ext/java/org/opentripplanner/ext/emissions/DecorateWithEmission.java index 1f6e79fc4df..9657e053cb9 100644 --- a/application/src/ext/java/org/opentripplanner/ext/emissions/DecorateWithEmission.java +++ b/application/src/ext/java/org/opentripplanner/ext/emissions/DecorateWithEmission.java @@ -3,7 +3,6 @@ import java.util.List; import java.util.Optional; import org.opentripplanner.ext.flex.FlexibleTransitLeg; -import org.opentripplanner.framework.lang.Sandbox; import org.opentripplanner.framework.model.Grams; import org.opentripplanner.model.plan.Emissions; import org.opentripplanner.model.plan.Itinerary; @@ -13,6 +12,7 @@ import org.opentripplanner.routing.algorithm.filterchain.framework.spi.ItineraryDecorator; import org.opentripplanner.street.search.TraverseMode; import org.opentripplanner.transit.model.framework.FeedScopedId; +import org.opentripplanner.utils.lang.Sandbox; /** * Calculates the emissions for the itineraries and adds them. diff --git a/application/src/ext/java/org/opentripplanner/ext/emissions/DefaultEmissionsService.java b/application/src/ext/java/org/opentripplanner/ext/emissions/DefaultEmissionsService.java index 5df2ca17f26..4aaefd5a7a3 100644 --- a/application/src/ext/java/org/opentripplanner/ext/emissions/DefaultEmissionsService.java +++ b/application/src/ext/java/org/opentripplanner/ext/emissions/DefaultEmissionsService.java @@ -2,10 +2,10 @@ import jakarta.inject.Inject; import java.util.Optional; -import org.opentripplanner.framework.lang.Sandbox; import org.opentripplanner.framework.model.Grams; import org.opentripplanner.model.plan.Emissions; import org.opentripplanner.transit.model.framework.FeedScopedId; +import org.opentripplanner.utils.lang.Sandbox; @Sandbox public class DefaultEmissionsService implements EmissionsService { diff --git a/application/src/ext/java/org/opentripplanner/ext/emissions/EmissionsService.java b/application/src/ext/java/org/opentripplanner/ext/emissions/EmissionsService.java index 6f69ac60d06..18712bb590c 100644 --- a/application/src/ext/java/org/opentripplanner/ext/emissions/EmissionsService.java +++ b/application/src/ext/java/org/opentripplanner/ext/emissions/EmissionsService.java @@ -1,9 +1,9 @@ package org.opentripplanner.ext.emissions; import java.util.Optional; -import org.opentripplanner.framework.lang.Sandbox; import org.opentripplanner.model.plan.Emissions; import org.opentripplanner.transit.model.framework.FeedScopedId; +import org.opentripplanner.utils.lang.Sandbox; /** * A service for getting emissions information for routes. diff --git a/application/src/ext/java/org/opentripplanner/ext/fares/FaresToItineraryMapper.java b/application/src/ext/java/org/opentripplanner/ext/fares/FaresToItineraryMapper.java index c545cbbb858..b936e458c00 100644 --- a/application/src/ext/java/org/opentripplanner/ext/fares/FaresToItineraryMapper.java +++ b/application/src/ext/java/org/opentripplanner/ext/fares/FaresToItineraryMapper.java @@ -1,9 +1,9 @@ package org.opentripplanner.ext.fares; -import org.opentripplanner.framework.collection.ListUtils; import org.opentripplanner.model.fare.FareProductUse; import org.opentripplanner.model.fare.ItineraryFares; import org.opentripplanner.model.plan.Itinerary; +import org.opentripplanner.utils.collection.ListUtils; /** * Takes fares and applies them to the legs of an itinerary. diff --git a/application/src/ext/java/org/opentripplanner/ext/fares/impl/CombinedInterlinedTransitLeg.java b/application/src/ext/java/org/opentripplanner/ext/fares/impl/CombinedInterlinedTransitLeg.java index d3608ccf8d9..85aa1a25004 100644 --- a/application/src/ext/java/org/opentripplanner/ext/fares/impl/CombinedInterlinedTransitLeg.java +++ b/application/src/ext/java/org/opentripplanner/ext/fares/impl/CombinedInterlinedTransitLeg.java @@ -7,7 +7,6 @@ import java.util.Set; import javax.annotation.Nullable; import org.locationtech.jts.geom.LineString; -import org.opentripplanner.framework.collection.ListUtils; import org.opentripplanner.model.fare.FareProductUse; import org.opentripplanner.model.plan.Leg; import org.opentripplanner.model.plan.LegTime; @@ -19,6 +18,7 @@ import org.opentripplanner.transit.model.organization.Agency; import org.opentripplanner.transit.model.site.FareZone; import org.opentripplanner.transit.model.timetable.Trip; +import org.opentripplanner.utils.collection.ListUtils; /** * This is a fake leg that combines two interlined legs for the purpose of fare calculation. diff --git a/application/src/ext/java/org/opentripplanner/ext/fares/model/Distance.java b/application/src/ext/java/org/opentripplanner/ext/fares/model/Distance.java index e29282fb4b8..f30712d4cad 100644 --- a/application/src/ext/java/org/opentripplanner/ext/fares/model/Distance.java +++ b/application/src/ext/java/org/opentripplanner/ext/fares/model/Distance.java @@ -1,6 +1,6 @@ package org.opentripplanner.ext.fares.model; -import org.opentripplanner.framework.tostring.ValueObjectToStringBuilder; +import org.opentripplanner.utils.tostring.ValueObjectToStringBuilder; public class Distance { diff --git a/application/src/ext/java/org/opentripplanner/ext/fares/model/FareRule.java b/application/src/ext/java/org/opentripplanner/ext/fares/model/FareRule.java index 3e70ef1cf2e..3b416ec2a6d 100644 --- a/application/src/ext/java/org/opentripplanner/ext/fares/model/FareRule.java +++ b/application/src/ext/java/org/opentripplanner/ext/fares/model/FareRule.java @@ -2,9 +2,9 @@ package org.opentripplanner.ext.fares.model; import java.io.Serializable; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.transit.model.framework.AbstractTransitEntity; import org.opentripplanner.transit.model.network.Route; +import org.opentripplanner.utils.tostring.ToStringBuilder; public final class FareRule implements Serializable { diff --git a/application/src/ext/java/org/opentripplanner/ext/flex/AreaStopsToVerticesMapper.java b/application/src/ext/java/org/opentripplanner/ext/flex/AreaStopsToVerticesMapper.java index 796971a43b5..85a4f749b16 100644 --- a/application/src/ext/java/org/opentripplanner/ext/flex/AreaStopsToVerticesMapper.java +++ b/application/src/ext/java/org/opentripplanner/ext/flex/AreaStopsToVerticesMapper.java @@ -6,13 +6,13 @@ import java.util.stream.Stream; import org.locationtech.jts.geom.Point; import org.opentripplanner.framework.geometry.GeometryUtils; -import org.opentripplanner.framework.logging.ProgressTracker; import org.opentripplanner.graph_builder.model.GraphBuilderModule; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.graph.index.StreetIndex; import org.opentripplanner.street.model.vertex.StreetVertex; import org.opentripplanner.transit.model.site.AreaStop; import org.opentripplanner.transit.service.TimetableRepository; +import org.opentripplanner.utils.logging.ProgressTracker; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/ext/java/org/opentripplanner/ext/flex/FlexAccessEgress.java b/application/src/ext/java/org/opentripplanner/ext/flex/FlexAccessEgress.java index f464f1e1907..9ff2b3f67be 100644 --- a/application/src/ext/java/org/opentripplanner/ext/flex/FlexAccessEgress.java +++ b/application/src/ext/java/org/opentripplanner/ext/flex/FlexAccessEgress.java @@ -4,10 +4,10 @@ import java.util.Objects; import org.opentripplanner.ext.flex.trip.FlexTrip; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.street.search.state.State; import org.opentripplanner.transit.model.site.RegularStop; import org.opentripplanner.transit.model.timetable.booking.RoutingBookingInfo; +import org.opentripplanner.utils.tostring.ToStringBuilder; public final class FlexAccessEgress { diff --git a/application/src/ext/java/org/opentripplanner/ext/flex/FlexPathDurations.java b/application/src/ext/java/org/opentripplanner/ext/flex/FlexPathDurations.java index a77d72185d0..258435a6d6b 100644 --- a/application/src/ext/java/org/opentripplanner/ext/flex/FlexPathDurations.java +++ b/application/src/ext/java/org/opentripplanner/ext/flex/FlexPathDurations.java @@ -1,6 +1,6 @@ package org.opentripplanner.ext.flex; -import org.opentripplanner.framework.time.DurationUtils; +import org.opentripplanner.utils.time.DurationUtils; /** * This value-object contains the durations for a Flex access or egress path. The path may also diff --git a/application/src/ext/java/org/opentripplanner/ext/flex/FlexRouter.java b/application/src/ext/java/org/opentripplanner/ext/flex/FlexRouter.java index 84098db9dc9..103a27e7554 100644 --- a/application/src/ext/java/org/opentripplanner/ext/flex/FlexRouter.java +++ b/application/src/ext/java/org/opentripplanner/ext/flex/FlexRouter.java @@ -20,7 +20,6 @@ import org.opentripplanner.ext.flex.template.FlexServiceDate; import org.opentripplanner.ext.flex.trip.FlexTrip; import org.opentripplanner.framework.application.OTPRequestTimeoutException; -import org.opentripplanner.framework.time.ServiceDateUtils; import org.opentripplanner.model.PathTransfer; import org.opentripplanner.model.plan.Itinerary; import org.opentripplanner.routing.algorithm.mapping.GraphPathToItineraryMapper; @@ -31,6 +30,7 @@ import org.opentripplanner.transit.model.site.StopLocation; import org.opentripplanner.transit.model.timetable.booking.RoutingBookingInfo; import org.opentripplanner.transit.service.TransitService; +import org.opentripplanner.utils.time.ServiceDateUtils; public class FlexRouter { diff --git a/application/src/ext/java/org/opentripplanner/ext/flex/FlexTripsMapper.java b/application/src/ext/java/org/opentripplanner/ext/flex/FlexTripsMapper.java index c4167f2f9e1..696c5df4c2a 100644 --- a/application/src/ext/java/org/opentripplanner/ext/flex/FlexTripsMapper.java +++ b/application/src/ext/java/org/opentripplanner/ext/flex/FlexTripsMapper.java @@ -7,13 +7,13 @@ import org.opentripplanner.ext.flex.trip.FlexTrip; import org.opentripplanner.ext.flex.trip.ScheduledDeviatedTrip; import org.opentripplanner.ext.flex.trip.UnscheduledTrip; -import org.opentripplanner.framework.logging.ProgressTracker; import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.model.StopTime; import org.opentripplanner.model.TripStopTimes; import org.opentripplanner.model.impl.OtpTransitServiceBuilder; import org.opentripplanner.routing.api.request.framework.TimePenalty; import org.opentripplanner.transit.model.timetable.Trip; +import org.opentripplanner.utils.logging.ProgressTracker; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/ext/java/org/opentripplanner/ext/flex/FlexibleTransitLeg.java b/application/src/ext/java/org/opentripplanner/ext/flex/FlexibleTransitLeg.java index cf6c229c46f..25c4abee12e 100644 --- a/application/src/ext/java/org/opentripplanner/ext/flex/FlexibleTransitLeg.java +++ b/application/src/ext/java/org/opentripplanner/ext/flex/FlexibleTransitLeg.java @@ -10,8 +10,6 @@ import org.locationtech.jts.geom.LineString; import org.opentripplanner.ext.flex.edgetype.FlexTripEdge; import org.opentripplanner.framework.i18n.I18NString; -import org.opentripplanner.framework.lang.DoubleUtils; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.model.PickDrop; import org.opentripplanner.model.fare.FareProductUse; import org.opentripplanner.model.plan.Leg; @@ -28,6 +26,8 @@ import org.opentripplanner.transit.model.organization.Operator; import org.opentripplanner.transit.model.timetable.Trip; import org.opentripplanner.transit.model.timetable.booking.BookingInfo; +import org.opentripplanner.utils.lang.DoubleUtils; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * One leg of a trip -- that is, a temporally continuous piece of the journey that takes place on a diff --git a/application/src/ext/java/org/opentripplanner/ext/flex/flexpathcalculator/FlexPath.java b/application/src/ext/java/org/opentripplanner/ext/flex/flexpathcalculator/FlexPath.java index 4a494286313..86934a22310 100644 --- a/application/src/ext/java/org/opentripplanner/ext/flex/flexpathcalculator/FlexPath.java +++ b/application/src/ext/java/org/opentripplanner/ext/flex/flexpathcalculator/FlexPath.java @@ -4,8 +4,8 @@ import java.util.function.Supplier; import javax.annotation.concurrent.Immutable; import org.locationtech.jts.geom.LineString; -import org.opentripplanner.framework.lang.IntUtils; import org.opentripplanner.routing.api.request.framework.TimePenalty; +import org.opentripplanner.utils.lang.IntUtils; /** * This class contains the results from a FlexPathCalculator. diff --git a/application/src/ext/java/org/opentripplanner/ext/flex/template/AbstractFlexTemplate.java b/application/src/ext/java/org/opentripplanner/ext/flex/template/AbstractFlexTemplate.java index 9ce9cf8a4c4..8dbcf4d785e 100644 --- a/application/src/ext/java/org/opentripplanner/ext/flex/template/AbstractFlexTemplate.java +++ b/application/src/ext/java/org/opentripplanner/ext/flex/template/AbstractFlexTemplate.java @@ -13,7 +13,6 @@ import org.opentripplanner.ext.flex.edgetype.FlexTripEdge; import org.opentripplanner.ext.flex.flexpathcalculator.FlexPathCalculator; import org.opentripplanner.ext.flex.trip.FlexTrip; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.model.PathTransfer; import org.opentripplanner.routing.graphfinder.NearbyStop; import org.opentripplanner.street.model.edge.Edge; @@ -22,6 +21,7 @@ import org.opentripplanner.street.search.state.State; import org.opentripplanner.transit.model.site.RegularStop; import org.opentripplanner.transit.model.site.StopLocation; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * A container for a few pieces of information that can be used to calculate flex accesses, egresses, diff --git a/application/src/ext/java/org/opentripplanner/ext/flex/template/ClosestTrip.java b/application/src/ext/java/org/opentripplanner/ext/flex/template/ClosestTrip.java index a30ebacc497..553c8aee6c0 100644 --- a/application/src/ext/java/org/opentripplanner/ext/flex/template/ClosestTrip.java +++ b/application/src/ext/java/org/opentripplanner/ext/flex/template/ClosestTrip.java @@ -7,9 +7,9 @@ import java.util.Map; import java.util.Objects; import org.opentripplanner.ext.flex.trip.FlexTrip; -import org.opentripplanner.framework.lang.IntUtils; import org.opentripplanner.routing.graphfinder.NearbyStop; import org.opentripplanner.transit.model.timetable.booking.RoutingBookingInfo; +import org.opentripplanner.utils.lang.IntUtils; /** * The combination of the closest stop, trip and trip active date. diff --git a/application/src/ext/java/org/opentripplanner/ext/flex/trip/StopTimeWindow.java b/application/src/ext/java/org/opentripplanner/ext/flex/trip/StopTimeWindow.java index 5b7ebbbc575..24b33360fce 100644 --- a/application/src/ext/java/org/opentripplanner/ext/flex/trip/StopTimeWindow.java +++ b/application/src/ext/java/org/opentripplanner/ext/flex/trip/StopTimeWindow.java @@ -3,10 +3,10 @@ import static org.opentripplanner.model.StopTime.MISSING_VALUE; import java.io.Serializable; -import org.opentripplanner.framework.lang.IntRange; import org.opentripplanner.model.PickDrop; import org.opentripplanner.model.StopTime; import org.opentripplanner.transit.model.site.StopLocation; +import org.opentripplanner.utils.lang.IntRange; class StopTimeWindow implements Serializable { diff --git a/application/src/ext/java/org/opentripplanner/ext/flex/trip/UnscheduledTrip.java b/application/src/ext/java/org/opentripplanner/ext/flex/trip/UnscheduledTrip.java index 30c79ac0d1a..b0286541bd2 100644 --- a/application/src/ext/java/org/opentripplanner/ext/flex/trip/UnscheduledTrip.java +++ b/application/src/ext/java/org/opentripplanner/ext/flex/trip/UnscheduledTrip.java @@ -12,9 +12,6 @@ import java.util.stream.Collectors; import org.opentripplanner.ext.flex.flexpathcalculator.FlexPathCalculator; import org.opentripplanner.ext.flex.flexpathcalculator.TimePenaltyCalculator; -import org.opentripplanner.framework.lang.DoubleUtils; -import org.opentripplanner.framework.lang.IntRange; -import org.opentripplanner.framework.time.DurationUtils; import org.opentripplanner.model.PickDrop; import org.opentripplanner.model.StopTime; import org.opentripplanner.routing.api.request.framework.TimePenalty; @@ -23,6 +20,9 @@ import org.opentripplanner.transit.model.site.GroupStop; import org.opentripplanner.transit.model.site.StopLocation; import org.opentripplanner.transit.model.timetable.booking.BookingInfo; +import org.opentripplanner.utils.lang.DoubleUtils; +import org.opentripplanner.utils.lang.IntRange; +import org.opentripplanner.utils.time.DurationUtils; /** * This type of FlexTrip is used when a taxi-type service is modeled, which operates in any number diff --git a/application/src/ext/java/org/opentripplanner/ext/geocoder/LuceneIndex.java b/application/src/ext/java/org/opentripplanner/ext/geocoder/LuceneIndex.java index 72ac22b027a..f742ddb131a 100644 --- a/application/src/ext/java/org/opentripplanner/ext/geocoder/LuceneIndex.java +++ b/application/src/ext/java/org/opentripplanner/ext/geocoder/LuceneIndex.java @@ -42,7 +42,6 @@ import org.apache.lucene.search.suggest.document.SuggestIndexSearcher; import org.apache.lucene.store.ByteBuffersDirectory; import org.opentripplanner.ext.stopconsolidation.StopConsolidationService; -import org.opentripplanner.framework.collection.ListUtils; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.transit.model.site.StopLocation; @@ -50,6 +49,7 @@ import org.opentripplanner.transit.service.DefaultTransitService; import org.opentripplanner.transit.service.TimetableRepository; import org.opentripplanner.transit.service.TransitService; +import org.opentripplanner.utils.collection.ListUtils; public class LuceneIndex implements Serializable { diff --git a/application/src/ext/java/org/opentripplanner/ext/geocoder/StopClusterMapper.java b/application/src/ext/java/org/opentripplanner/ext/geocoder/StopClusterMapper.java index 98a617b809f..3a6546cfe1e 100644 --- a/application/src/ext/java/org/opentripplanner/ext/geocoder/StopClusterMapper.java +++ b/application/src/ext/java/org/opentripplanner/ext/geocoder/StopClusterMapper.java @@ -13,7 +13,6 @@ import javax.annotation.Nullable; import org.opentripplanner.ext.stopconsolidation.StopConsolidationService; import org.opentripplanner.ext.stopconsolidation.model.StopReplacement; -import org.opentripplanner.framework.collection.ListUtils; import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.model.FeedInfo; @@ -24,6 +23,7 @@ import org.opentripplanner.transit.model.site.StopLocation; import org.opentripplanner.transit.model.site.StopLocationsGroup; import org.opentripplanner.transit.service.TransitService; +import org.opentripplanner.utils.collection.ListUtils; /** * Mappers for generating {@link LuceneStopCluster} from the transit model. diff --git a/application/src/ext/java/org/opentripplanner/ext/interactivelauncher/debug/raptor/RaptorDebugModel.java b/application/src/ext/java/org/opentripplanner/ext/interactivelauncher/debug/raptor/RaptorDebugModel.java index 41d6ed6be1a..71fb682581c 100644 --- a/application/src/ext/java/org/opentripplanner/ext/interactivelauncher/debug/raptor/RaptorDebugModel.java +++ b/application/src/ext/java/org/opentripplanner/ext/interactivelauncher/debug/raptor/RaptorDebugModel.java @@ -7,9 +7,9 @@ import java.util.Set; import javax.annotation.Nullable; import org.opentripplanner.ext.interactivelauncher.api.LauncherRequestDecorator; -import org.opentripplanner.framework.lang.StringUtils; import org.opentripplanner.routing.api.request.DebugEventType; import org.opentripplanner.routing.api.request.RouteRequest; +import org.opentripplanner.utils.lang.StringUtils; public class RaptorDebugModel implements LauncherRequestDecorator { diff --git a/application/src/ext/java/org/opentripplanner/ext/reportapi/model/CsvReportBuilder.java b/application/src/ext/java/org/opentripplanner/ext/reportapi/model/CsvReportBuilder.java index f2513159fa6..087ed028a23 100644 --- a/application/src/ext/java/org/opentripplanner/ext/reportapi/model/CsvReportBuilder.java +++ b/application/src/ext/java/org/opentripplanner/ext/reportapi/model/CsvReportBuilder.java @@ -1,7 +1,7 @@ package org.opentripplanner.ext.reportapi.model; -import org.opentripplanner.framework.time.DurationUtils; -import org.opentripplanner.framework.time.TimeUtils; +import org.opentripplanner.utils.time.DurationUtils; +import org.opentripplanner.utils.time.TimeUtils; /** * A very simple CSV builder to create CSV reports. diff --git a/application/src/ext/java/org/opentripplanner/ext/reportapi/model/TransfersReport.java b/application/src/ext/java/org/opentripplanner/ext/reportapi/model/TransfersReport.java index e53cd6c3c58..cff5d2f791e 100644 --- a/application/src/ext/java/org/opentripplanner/ext/reportapi/model/TransfersReport.java +++ b/application/src/ext/java/org/opentripplanner/ext/reportapi/model/TransfersReport.java @@ -1,6 +1,6 @@ package org.opentripplanner.ext.reportapi.model; -import static org.opentripplanner.framework.time.DurationUtils.durationToStr; +import static org.opentripplanner.utils.time.DurationUtils.durationToStr; import java.util.List; import java.util.Optional; diff --git a/application/src/ext/java/org/opentripplanner/ext/restapi/mapping/LocalDateMapper.java b/application/src/ext/java/org/opentripplanner/ext/restapi/mapping/LocalDateMapper.java index 940bcc13d54..09ff79ef9fd 100644 --- a/application/src/ext/java/org/opentripplanner/ext/restapi/mapping/LocalDateMapper.java +++ b/application/src/ext/java/org/opentripplanner/ext/restapi/mapping/LocalDateMapper.java @@ -1,7 +1,7 @@ package org.opentripplanner.ext.restapi.mapping; import java.time.LocalDate; -import org.opentripplanner.framework.time.ServiceDateUtils; +import org.opentripplanner.utils.time.ServiceDateUtils; public class LocalDateMapper { diff --git a/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiBookingInfo.java b/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiBookingInfo.java index c89d6429caa..1fd4566a9b8 100644 --- a/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiBookingInfo.java +++ b/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiBookingInfo.java @@ -3,7 +3,7 @@ import java.io.Serializable; import java.time.Duration; import java.util.Set; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * Info about how a trip might be booked at a particular stop. All of this is pass-through diff --git a/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiBookingTime.java b/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiBookingTime.java index 08eee69a3cf..f2a8d5767ff 100644 --- a/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiBookingTime.java +++ b/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiBookingTime.java @@ -1,7 +1,7 @@ package org.opentripplanner.ext.restapi.model; import java.io.Serializable; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * Represents either an earliest or latest time a trip can be booked relative to the departure day diff --git a/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiContactInfo.java b/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiContactInfo.java index b7c2ec90166..cc7e6d069f1 100644 --- a/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiContactInfo.java +++ b/application/src/ext/java/org/opentripplanner/ext/restapi/model/ApiContactInfo.java @@ -1,7 +1,7 @@ package org.opentripplanner.ext.restapi.model; import java.io.Serializable; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * How to contact the agency to book a trip or requests information. diff --git a/application/src/ext/java/org/opentripplanner/ext/restapi/resources/IndexAPI.java b/application/src/ext/java/org/opentripplanner/ext/restapi/resources/IndexAPI.java index cab2be13ad0..ccf18217148 100644 --- a/application/src/ext/java/org/opentripplanner/ext/restapi/resources/IndexAPI.java +++ b/application/src/ext/java/org/opentripplanner/ext/restapi/resources/IndexAPI.java @@ -51,7 +51,6 @@ import org.opentripplanner.ext.restapi.model.ApiTripShort; import org.opentripplanner.ext.restapi.model.ApiTripTimeShort; import org.opentripplanner.framework.geometry.EncodedPolyline; -import org.opentripplanner.framework.time.ServiceDateUtils; import org.opentripplanner.model.StopTimesInPattern; import org.opentripplanner.model.TripTimeOnDate; import org.opentripplanner.routing.graphfinder.DirectGraphFinder; @@ -64,6 +63,7 @@ import org.opentripplanner.transit.model.site.StopLocation; import org.opentripplanner.transit.model.timetable.Trip; import org.opentripplanner.transit.service.TransitService; +import org.opentripplanner.utils.time.ServiceDateUtils; // TODO move to org.opentripplanner.api.resource, this is a Jersey resource class diff --git a/application/src/ext/java/org/opentripplanner/ext/restapi/resources/RequestToPreferencesMapper.java b/application/src/ext/java/org/opentripplanner/ext/restapi/resources/RequestToPreferencesMapper.java index 51b2fae86b5..22aa194d4bb 100644 --- a/application/src/ext/java/org/opentripplanner/ext/restapi/resources/RequestToPreferencesMapper.java +++ b/application/src/ext/java/org/opentripplanner/ext/restapi/resources/RequestToPreferencesMapper.java @@ -3,7 +3,6 @@ import jakarta.validation.constraints.NotNull; import java.util.function.Consumer; import org.opentripplanner.ext.restapi.mapping.LegacyVehicleRoutingOptimizeType; -import org.opentripplanner.framework.lang.ObjectUtils; import org.opentripplanner.routing.algorithm.filterchain.api.TransitGeneralizedCostFilterParams; import org.opentripplanner.routing.api.request.framework.CostLinearFunction; import org.opentripplanner.routing.api.request.preference.ItineraryFilterPreferences; @@ -11,6 +10,7 @@ import org.opentripplanner.routing.api.request.preference.RoutingPreferences; import org.opentripplanner.routing.api.request.preference.VehicleParkingPreferences; import org.opentripplanner.routing.api.request.preference.VehicleRentalPreferences; +import org.opentripplanner.utils.lang.ObjectUtils; class RequestToPreferencesMapper { diff --git a/application/src/ext/java/org/opentripplanner/ext/restapi/resources/RoutingResource.java b/application/src/ext/java/org/opentripplanner/ext/restapi/resources/RoutingResource.java index 3ae029fdb2d..9a0f030a807 100644 --- a/application/src/ext/java/org/opentripplanner/ext/restapi/resources/RoutingResource.java +++ b/application/src/ext/java/org/opentripplanner/ext/restapi/resources/RoutingResource.java @@ -23,8 +23,6 @@ import org.opentripplanner.ext.dataoverlay.api.DataOverlayParameters; import org.opentripplanner.ext.restapi.mapping.LegacyVehicleRoutingOptimizeType; import org.opentripplanner.framework.application.OTPFeature; -import org.opentripplanner.framework.lang.StringUtils; -import org.opentripplanner.framework.time.DurationUtils; import org.opentripplanner.framework.time.ZoneIdFallback; import org.opentripplanner.routing.api.request.RouteRequest; import org.opentripplanner.routing.api.request.preference.ItineraryFilterDebugProfile; @@ -35,6 +33,8 @@ import org.opentripplanner.standalone.config.framework.json.NodeAdapter; import org.opentripplanner.standalone.config.routerequest.RouteRequestConfig; import org.opentripplanner.transit.model.basic.MainAndSubMode; +import org.opentripplanner.utils.lang.StringUtils; +import org.opentripplanner.utils.time.DurationUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/stops/DigitransitRealtimeStopPropertyMapper.java b/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/stops/DigitransitRealtimeStopPropertyMapper.java index cf555d6412f..af2ec7212ec 100644 --- a/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/stops/DigitransitRealtimeStopPropertyMapper.java +++ b/application/src/ext/java/org/opentripplanner/ext/vectortiles/layers/stops/DigitransitRealtimeStopPropertyMapper.java @@ -8,12 +8,12 @@ import java.util.List; import java.util.Locale; import org.opentripplanner.apis.support.mapping.PropertyMapper; -import org.opentripplanner.framework.collection.ListUtils; import org.opentripplanner.framework.i18n.I18NStringMapper; import org.opentripplanner.inspector.vector.KeyValue; import org.opentripplanner.routing.stoptimes.ArrivalDeparture; import org.opentripplanner.transit.model.site.RegularStop; import org.opentripplanner.transit.service.TransitService; +import org.opentripplanner.utils.collection.ListUtils; public class DigitransitRealtimeStopPropertyMapper extends PropertyMapper { diff --git a/application/src/ext/java/org/opentripplanner/ext/vehicleparking/bikeep/BikeepUpdater.java b/application/src/ext/java/org/opentripplanner/ext/vehicleparking/bikeep/BikeepUpdater.java index 9216eb79995..cd6a39fecd3 100644 --- a/application/src/ext/java/org/opentripplanner/ext/vehicleparking/bikeep/BikeepUpdater.java +++ b/application/src/ext/java/org/opentripplanner/ext/vehicleparking/bikeep/BikeepUpdater.java @@ -7,12 +7,12 @@ import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.framework.i18n.NonLocalizedString; import org.opentripplanner.framework.json.ObjectMappers; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.routing.vehicle_parking.VehicleParking; import org.opentripplanner.routing.vehicle_parking.VehicleParkingSpaces; import org.opentripplanner.routing.vehicle_parking.VehicleParkingState; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.updater.spi.GenericJsonDataSource; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * Vehicle parking updater for Bikeep's API. diff --git a/application/src/ext/java/org/opentripplanner/ext/vehicleparking/parkapi/ParkAPIUpdater.java b/application/src/ext/java/org/opentripplanner/ext/vehicleparking/parkapi/ParkAPIUpdater.java index 59a19b1cce7..c7bd6631a48 100644 --- a/application/src/ext/java/org/opentripplanner/ext/vehicleparking/parkapi/ParkAPIUpdater.java +++ b/application/src/ext/java/org/opentripplanner/ext/vehicleparking/parkapi/ParkAPIUpdater.java @@ -12,7 +12,6 @@ import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.framework.i18n.NonLocalizedString; import org.opentripplanner.framework.i18n.TranslatedString; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.model.calendar.openinghours.OHCalendar; import org.opentripplanner.model.calendar.openinghours.OpeningHoursCalendarService; import org.opentripplanner.osm.OsmOpeningHoursParser; @@ -21,6 +20,7 @@ import org.opentripplanner.routing.vehicle_parking.VehicleParkingState; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.updater.spi.GenericJsonDataSource; +import org.opentripplanner.utils.tostring.ToStringBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/ext/java/org/opentripplanner/ext/vehicleparking/sirifm/SiriFmDatasource.java b/application/src/ext/java/org/opentripplanner/ext/vehicleparking/sirifm/SiriFmDatasource.java index abfdf4d29be..e05cfdb42ad 100644 --- a/application/src/ext/java/org/opentripplanner/ext/vehicleparking/sirifm/SiriFmDatasource.java +++ b/application/src/ext/java/org/opentripplanner/ext/vehicleparking/sirifm/SiriFmDatasource.java @@ -8,11 +8,11 @@ import org.entur.siri21.util.SiriXml; import org.opentripplanner.framework.io.OtpHttpClient; import org.opentripplanner.framework.io.OtpHttpClientFactory; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.updater.spi.DataSource; import org.opentripplanner.updater.spi.HttpHeaders; import org.opentripplanner.updater.vehicle_parking.AvailabiltyUpdate; +import org.opentripplanner.utils.tostring.ToStringBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import uk.org.siri.siri21.FacilityConditionStructure; diff --git a/application/src/main/java/org/opentripplanner/apis/gtfs/GraphQLScalars.java b/application/src/main/java/org/opentripplanner/apis/gtfs/GraphQLScalars.java index 25953652365..8427777bd38 100644 --- a/application/src/main/java/org/opentripplanner/apis/gtfs/GraphQLScalars.java +++ b/application/src/main/java/org/opentripplanner/apis/gtfs/GraphQLScalars.java @@ -22,7 +22,7 @@ import org.opentripplanner.framework.json.ObjectMappers; import org.opentripplanner.framework.model.Cost; import org.opentripplanner.framework.model.Grams; -import org.opentripplanner.framework.time.OffsetDateTimeParser; +import org.opentripplanner.utils.time.OffsetDateTimeParser; public class GraphQLScalars { diff --git a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/PatternImpl.java b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/PatternImpl.java index 88db00c3c4e..fbab1e95400 100644 --- a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/PatternImpl.java +++ b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/PatternImpl.java @@ -18,7 +18,6 @@ import org.opentripplanner.apis.gtfs.generated.GraphQLTypes; import org.opentripplanner.apis.support.SemanticHash; import org.opentripplanner.framework.graphql.GraphQLUtils; -import org.opentripplanner.framework.time.ServiceDateUtils; import org.opentripplanner.routing.alertpatch.EntitySelector; import org.opentripplanner.routing.alertpatch.TransitAlert; import org.opentripplanner.routing.services.TransitAlertService; @@ -31,6 +30,7 @@ import org.opentripplanner.transit.model.timetable.Trip; import org.opentripplanner.transit.model.timetable.TripTimes; import org.opentripplanner.transit.service.TransitService; +import org.opentripplanner.utils.time.ServiceDateUtils; public class PatternImpl implements GraphQLDataFetchers.GraphQLPattern { diff --git a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/QueryTypeImpl.java b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/QueryTypeImpl.java index 95984ba6dd0..9e9d78445f3 100644 --- a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/QueryTypeImpl.java +++ b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/QueryTypeImpl.java @@ -38,7 +38,6 @@ import org.opentripplanner.ext.fares.impl.GtfsFaresService; import org.opentripplanner.ext.fares.model.FareRuleSet; import org.opentripplanner.framework.application.OTPFeature; -import org.opentripplanner.framework.time.ServiceDateUtils; import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.gtfs.mapping.DirectionMapper; import org.opentripplanner.model.TripTimeOnDate; @@ -74,6 +73,7 @@ import org.opentripplanner.transit.model.timetable.Trip; import org.opentripplanner.transit.service.TransitService; import org.opentripplanner.updater.GtfsRealtimeFuzzyTripMatcher; +import org.opentripplanner.utils.time.ServiceDateUtils; public class QueryTypeImpl implements GraphQLDataFetchers.GraphQLQueryType { diff --git a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/StopImpl.java b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/StopImpl.java index 8d9c11bb7d4..2d17326a0ef 100644 --- a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/StopImpl.java +++ b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/StopImpl.java @@ -20,7 +20,6 @@ import org.opentripplanner.apis.gtfs.generated.GraphQLTypes; import org.opentripplanner.apis.gtfs.support.filter.PatternByDateFilterUtil; import org.opentripplanner.apis.gtfs.support.time.LocalDateRangeUtil; -import org.opentripplanner.framework.time.ServiceDateUtils; import org.opentripplanner.model.StopTimesInPattern; import org.opentripplanner.model.TripTimeOnDate; import org.opentripplanner.routing.alertpatch.EntitySelector; @@ -37,6 +36,7 @@ import org.opentripplanner.transit.model.site.Station; import org.opentripplanner.transit.model.site.StopLocation; import org.opentripplanner.transit.service.TransitService; +import org.opentripplanner.utils.time.ServiceDateUtils; public class StopImpl implements GraphQLDataFetchers.GraphQLStop { diff --git a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/TripImpl.java b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/TripImpl.java index 21bff637976..956b35309e2 100644 --- a/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/TripImpl.java +++ b/application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/TripImpl.java @@ -23,7 +23,6 @@ import org.opentripplanner.apis.gtfs.mapping.BikesAllowedMapper; import org.opentripplanner.apis.gtfs.model.TripOccupancy; import org.opentripplanner.apis.support.SemanticHash; -import org.opentripplanner.framework.time.ServiceDateUtils; import org.opentripplanner.model.Timetable; import org.opentripplanner.model.TripTimeOnDate; import org.opentripplanner.routing.alertpatch.EntitySelector; @@ -39,6 +38,7 @@ import org.opentripplanner.transit.model.timetable.Trip; import org.opentripplanner.transit.model.timetable.TripTimes; import org.opentripplanner.transit.service.TransitService; +import org.opentripplanner.utils.time.ServiceDateUtils; public class TripImpl implements GraphQLDataFetchers.GraphQLTrip { diff --git a/application/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/BicyclePreferencesMapper.java b/application/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/BicyclePreferencesMapper.java index cd4d508282e..263f6ee33ee 100644 --- a/application/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/BicyclePreferencesMapper.java +++ b/application/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/BicyclePreferencesMapper.java @@ -8,11 +8,11 @@ import graphql.schema.DataFetchingEnvironment; import java.util.Set; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes; -import org.opentripplanner.framework.time.DurationUtils; import org.opentripplanner.routing.api.request.preference.BikePreferences; import org.opentripplanner.routing.api.request.preference.VehicleParkingPreferences; import org.opentripplanner.routing.api.request.preference.VehicleRentalPreferences; import org.opentripplanner.routing.api.request.preference.VehicleWalkingPreferences; +import org.opentripplanner.utils.time.DurationUtils; public class BicyclePreferencesMapper { diff --git a/application/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/RouteRequestMapper.java b/application/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/RouteRequestMapper.java index 22834b200f6..95752548ca8 100644 --- a/application/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/RouteRequestMapper.java +++ b/application/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/RouteRequestMapper.java @@ -12,12 +12,12 @@ import org.opentripplanner.apis.gtfs.GraphQLRequestContext; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes; import org.opentripplanner.framework.graphql.GraphQLUtils; -import org.opentripplanner.framework.time.DurationUtils; import org.opentripplanner.model.GenericLocation; import org.opentripplanner.routing.api.request.RouteRequest; import org.opentripplanner.routing.api.request.preference.ItineraryFilterPreferences; import org.opentripplanner.routing.api.request.preference.RoutingPreferences; import org.opentripplanner.transit.model.framework.FeedScopedId; +import org.opentripplanner.utils.time.DurationUtils; public class RouteRequestMapper { diff --git a/application/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/TransitPreferencesMapper.java b/application/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/TransitPreferencesMapper.java index f9ef3d2af55..4ac55add5a9 100644 --- a/application/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/TransitPreferencesMapper.java +++ b/application/src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/TransitPreferencesMapper.java @@ -7,10 +7,10 @@ import java.util.stream.Collectors; import org.opentripplanner.apis.gtfs.generated.GraphQLTypes; import org.opentripplanner.apis.gtfs.mapping.TransitModeMapper; -import org.opentripplanner.framework.collection.CollectionUtils; -import org.opentripplanner.framework.time.DurationUtils; import org.opentripplanner.routing.api.request.preference.TransferPreferences; import org.opentripplanner.routing.api.request.preference.TransitPreferences; +import org.opentripplanner.utils.collection.CollectionUtils; +import org.opentripplanner.utils.time.DurationUtils; public class TransitPreferencesMapper { diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/TransmodelGraph.java b/application/src/main/java/org/opentripplanner/apis/transmodel/TransmodelGraph.java index f4241fcbc61..e7f3fc7b8e0 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/TransmodelGraph.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/TransmodelGraph.java @@ -23,9 +23,9 @@ import org.opentripplanner.framework.application.OTPFeature; import org.opentripplanner.framework.application.OTPRequestTimeoutException; import org.opentripplanner.framework.concurrent.OtpRequestThreadFactory; -import org.opentripplanner.framework.lang.ObjectUtils; import org.opentripplanner.standalone.api.OtpServerRequestContext; import org.opentripplanner.transit.model.framework.EntityNotFoundException; +import org.opentripplanner.utils.lang.ObjectUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/mapping/TransitIdMapper.java b/application/src/main/java/org/opentripplanner/apis/transmodel/mapping/TransitIdMapper.java index 1231ebd73b6..4bb1bb556e1 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/mapping/TransitIdMapper.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/mapping/TransitIdMapper.java @@ -5,9 +5,9 @@ import java.util.Map; import java.util.stream.Collectors; import javax.annotation.Nullable; -import org.opentripplanner.framework.lang.StringUtils; import org.opentripplanner.transit.model.framework.AbstractTransitEntity; import org.opentripplanner.transit.model.framework.FeedScopedId; +import org.opentripplanner.utils.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/model/framework/PenaltyForStreetModeType.java b/application/src/main/java/org/opentripplanner/apis/transmodel/model/framework/PenaltyForStreetModeType.java index b899ada3599..c553fccf667 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/model/framework/PenaltyForStreetModeType.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/model/framework/PenaltyForStreetModeType.java @@ -19,10 +19,10 @@ import org.opentripplanner.apis.transmodel.model.EnumTypes; import org.opentripplanner.apis.transmodel.model.scalars.DoubleFunction; import org.opentripplanner.apis.transmodel.support.GqlUtil; -import org.opentripplanner.framework.lang.ObjectUtils; import org.opentripplanner.routing.api.request.StreetMode; import org.opentripplanner.routing.api.request.framework.TimeAndCostPenalty; import org.opentripplanner.routing.api.request.framework.TimeAndCostPenaltyForEnum; +import org.opentripplanner.utils.lang.ObjectUtils; /** * Access and egress penalty: diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/model/framework/StreetModeDurationInputType.java b/application/src/main/java/org/opentripplanner/apis/transmodel/model/framework/StreetModeDurationInputType.java index 2fba22c78b7..9c92d7253d5 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/model/framework/StreetModeDurationInputType.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/model/framework/StreetModeDurationInputType.java @@ -17,9 +17,9 @@ import java.util.Objects; import org.opentripplanner.apis.transmodel.model.EnumTypes; import org.opentripplanner.apis.transmodel.support.GqlUtil; -import org.opentripplanner.framework.time.DurationUtils; import org.opentripplanner.routing.api.request.StreetMode; import org.opentripplanner.routing.api.request.framework.DurationForEnum; +import org.opentripplanner.utils.time.DurationUtils; public class StreetModeDurationInputType { diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/model/plan/RelaxCostType.java b/application/src/main/java/org/opentripplanner/apis/transmodel/model/plan/RelaxCostType.java index 41435c83a2f..9272bd86757 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/model/plan/RelaxCostType.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/model/plan/RelaxCostType.java @@ -10,8 +10,8 @@ import java.util.Map; import org.opentripplanner.framework.graphql.scalar.CostScalarFactory; import org.opentripplanner.framework.model.Cost; -import org.opentripplanner.framework.time.DurationUtils; import org.opentripplanner.routing.api.request.framework.CostLinearFunction; +import org.opentripplanner.utils.time.DurationUtils; public class RelaxCostType { diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/model/plan/TripPatternTimePenaltyType.java b/application/src/main/java/org/opentripplanner/apis/transmodel/model/plan/TripPatternTimePenaltyType.java index 744113929c7..2ad88762408 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/model/plan/TripPatternTimePenaltyType.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/model/plan/TripPatternTimePenaltyType.java @@ -4,7 +4,7 @@ import graphql.schema.DataFetchingEnvironment; import graphql.schema.GraphQLFieldDefinition; import graphql.schema.GraphQLObjectType; -import org.opentripplanner.framework.time.DurationUtils; +import org.opentripplanner.utils.time.DurationUtils; public class TripPatternTimePenaltyType { diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/model/scalars/DateTimeScalarFactory.java b/application/src/main/java/org/opentripplanner/apis/transmodel/model/scalars/DateTimeScalarFactory.java index f539715206e..19681987199 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/model/scalars/DateTimeScalarFactory.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/model/scalars/DateTimeScalarFactory.java @@ -12,7 +12,7 @@ import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; import java.time.temporal.TemporalAccessor; -import org.opentripplanner.framework.time.OffsetDateTimeParser; +import org.opentripplanner.utils.time.OffsetDateTimeParser; public final class DateTimeScalarFactory { diff --git a/application/src/main/java/org/opentripplanner/apis/transmodel/support/AbortOnUnprocessableRequestExecutionStrategy.java b/application/src/main/java/org/opentripplanner/apis/transmodel/support/AbortOnUnprocessableRequestExecutionStrategy.java index c395d359131..f47b2404bb2 100644 --- a/application/src/main/java/org/opentripplanner/apis/transmodel/support/AbortOnUnprocessableRequestExecutionStrategy.java +++ b/application/src/main/java/org/opentripplanner/apis/transmodel/support/AbortOnUnprocessableRequestExecutionStrategy.java @@ -8,7 +8,7 @@ import org.opentripplanner.apis.support.graphql.LoggingDataFetcherExceptionHandler; import org.opentripplanner.apis.transmodel.ResponseTooLargeException; import org.opentripplanner.framework.application.OTPRequestTimeoutException; -import org.opentripplanner.framework.logging.ProgressTracker; +import org.opentripplanner.utils.logging.ProgressTracker; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/apis/vectortiles/DebugStyleSpec.java b/application/src/main/java/org/opentripplanner/apis/vectortiles/DebugStyleSpec.java index 1fc87176af8..3c8423c5270 100644 --- a/application/src/main/java/org/opentripplanner/apis/vectortiles/DebugStyleSpec.java +++ b/application/src/main/java/org/opentripplanner/apis/vectortiles/DebugStyleSpec.java @@ -11,7 +11,6 @@ import org.opentripplanner.apis.vectortiles.model.VectorSourceLayer; import org.opentripplanner.apis.vectortiles.model.ZoomDependentNumber; import org.opentripplanner.apis.vectortiles.model.ZoomDependentNumber.ZoomStop; -import org.opentripplanner.framework.collection.ListUtils; import org.opentripplanner.service.vehiclerental.street.StreetVehicleRentalLink; import org.opentripplanner.street.model.StreetTraversalPermission; import org.opentripplanner.street.model.edge.AreaEdge; @@ -28,6 +27,7 @@ import org.opentripplanner.street.model.edge.TemporaryFreeEdge; import org.opentripplanner.street.model.edge.TemporaryPartialStreetEdge; import org.opentripplanner.street.model.vertex.VehicleParkingEntranceVertex; +import org.opentripplanner.utils.collection.ListUtils; /** * A Mapbox/Mapblibre style specification for rendering debug information about transit and diff --git a/application/src/main/java/org/opentripplanner/apis/vectortiles/model/StyleBuilder.java b/application/src/main/java/org/opentripplanner/apis/vectortiles/model/StyleBuilder.java index 93b7ea91e7c..6f81e7fd998 100644 --- a/application/src/main/java/org/opentripplanner/apis/vectortiles/model/StyleBuilder.java +++ b/application/src/main/java/org/opentripplanner/apis/vectortiles/model/StyleBuilder.java @@ -9,11 +9,11 @@ import java.util.Objects; import java.util.stream.Stream; import org.opentripplanner.apis.vectortiles.model.ZoomDependentNumber.ZoomStop; -import org.opentripplanner.framework.collection.ListUtils; import org.opentripplanner.framework.json.ObjectMappers; import org.opentripplanner.street.model.StreetTraversalPermission; import org.opentripplanner.street.model.edge.Edge; import org.opentripplanner.street.model.vertex.Vertex; +import org.opentripplanner.utils.collection.ListUtils; /** * Builds a Maplibre/Mapbox vector tile diff --git a/application/src/main/java/org/opentripplanner/apis/vectortiles/model/ZoomDependentNumber.java b/application/src/main/java/org/opentripplanner/apis/vectortiles/model/ZoomDependentNumber.java index 4d1d83ee8a9..cc655ba2038 100644 --- a/application/src/main/java/org/opentripplanner/apis/vectortiles/model/ZoomDependentNumber.java +++ b/application/src/main/java/org/opentripplanner/apis/vectortiles/model/ZoomDependentNumber.java @@ -3,10 +3,7 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import java.util.ArrayList; -import java.util.LinkedHashMap; import java.util.List; -import java.util.stream.Stream; -import org.opentripplanner.framework.collection.ListUtils; import org.opentripplanner.framework.json.ObjectMappers; /** diff --git a/application/src/main/java/org/opentripplanner/astar/AStar.java b/application/src/main/java/org/opentripplanner/astar/AStar.java index 9c14669a159..86d48a3cbd8 100644 --- a/application/src/main/java/org/opentripplanner/astar/AStar.java +++ b/application/src/main/java/org/opentripplanner/astar/AStar.java @@ -19,7 +19,7 @@ import org.opentripplanner.astar.spi.SkipEdgeStrategy; import org.opentripplanner.astar.spi.TraverseVisitor; import org.opentripplanner.framework.application.OTPRequestTimeoutException; -import org.opentripplanner.framework.time.DateUtils; +import org.opentripplanner.utils.time.DateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/datastore/api/DataSource.java b/application/src/main/java/org/opentripplanner/datastore/api/DataSource.java index e1eafcbdb2a..ee95f50680e 100644 --- a/application/src/main/java/org/opentripplanner/datastore/api/DataSource.java +++ b/application/src/main/java/org/opentripplanner/datastore/api/DataSource.java @@ -6,7 +6,7 @@ import java.net.URI; import java.text.SimpleDateFormat; import org.opentripplanner.datastore.OtpDataStore; -import org.opentripplanner.framework.text.FileSizeToTextConverter; +import org.opentripplanner.utils.text.FileSizeToTextConverter; /** * A data source is generalized type to represent an file, database blob or unit that OTP read or diff --git a/application/src/main/java/org/opentripplanner/datastore/https/HttpsDataSourceMetadata.java b/application/src/main/java/org/opentripplanner/datastore/https/HttpsDataSourceMetadata.java index 9011f99d5ce..8a84b0210b1 100644 --- a/application/src/main/java/org/opentripplanner/datastore/https/HttpsDataSourceMetadata.java +++ b/application/src/main/java/org/opentripplanner/datastore/https/HttpsDataSourceMetadata.java @@ -9,7 +9,7 @@ import org.apache.hc.core5.http.Header; import org.apache.hc.core5.http.HttpHeaders; import org.opentripplanner.datastore.api.DataSource; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * HTTPS data source metadata returned by the HTTP server (HTTP headers). diff --git a/application/src/main/java/org/opentripplanner/framework/application/LogMDCSupport.java b/application/src/main/java/org/opentripplanner/framework/application/LogMDCSupport.java index 6dccdcd8152..909363badd3 100644 --- a/application/src/main/java/org/opentripplanner/framework/application/LogMDCSupport.java +++ b/application/src/main/java/org/opentripplanner/framework/application/LogMDCSupport.java @@ -2,7 +2,7 @@ import java.util.Map; import javax.annotation.Nullable; -import org.opentripplanner.framework.lang.StringUtils; +import org.opentripplanner.utils.lang.StringUtils; import org.slf4j.MDC; /** diff --git a/application/src/main/java/org/opentripplanner/framework/geometry/CompactElevationProfile.java b/application/src/main/java/org/opentripplanner/framework/geometry/CompactElevationProfile.java index bdab5f492e3..105c79973cd 100644 --- a/application/src/main/java/org/opentripplanner/framework/geometry/CompactElevationProfile.java +++ b/application/src/main/java/org/opentripplanner/framework/geometry/CompactElevationProfile.java @@ -4,7 +4,7 @@ import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.CoordinateSequence; import org.locationtech.jts.geom.impl.PackedCoordinateSequence; -import org.opentripplanner.framework.lang.IntUtils; +import org.opentripplanner.utils.lang.IntUtils; /** * Compact elevation profile. To optimize storage, we use the following tricks: diff --git a/application/src/main/java/org/opentripplanner/framework/geometry/CompactLineStringUtils.java b/application/src/main/java/org/opentripplanner/framework/geometry/CompactLineStringUtils.java index d464d96fcee..19bf9824726 100644 --- a/application/src/main/java/org/opentripplanner/framework/geometry/CompactLineStringUtils.java +++ b/application/src/main/java/org/opentripplanner/framework/geometry/CompactLineStringUtils.java @@ -2,7 +2,7 @@ import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.LineString; -import org.opentripplanner.framework.lang.IntUtils; +import org.opentripplanner.utils.lang.IntUtils; /** * Compact line string. To optimize storage, we use the following tricks: diff --git a/application/src/main/java/org/opentripplanner/framework/geometry/HashGridSpatialIndex.java b/application/src/main/java/org/opentripplanner/framework/geometry/HashGridSpatialIndex.java index d4082f9e22d..edda3fe4086 100644 --- a/application/src/main/java/org/opentripplanner/framework/geometry/HashGridSpatialIndex.java +++ b/application/src/main/java/org/opentripplanner/framework/geometry/HashGridSpatialIndex.java @@ -14,7 +14,7 @@ import org.locationtech.jts.geom.LineString; import org.locationtech.jts.index.ItemVisitor; import org.locationtech.jts.index.SpatialIndex; -import org.opentripplanner.framework.lang.IntBox; +import org.opentripplanner.utils.lang.IntBox; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/framework/geometry/WgsCoordinate.java b/application/src/main/java/org/opentripplanner/framework/geometry/WgsCoordinate.java index 6c3dbf0f9d3..e6b88ad0223 100644 --- a/application/src/main/java/org/opentripplanner/framework/geometry/WgsCoordinate.java +++ b/application/src/main/java/org/opentripplanner/framework/geometry/WgsCoordinate.java @@ -5,8 +5,8 @@ import java.util.Objects; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.Point; -import org.opentripplanner.framework.lang.DoubleUtils; -import org.opentripplanner.framework.tostring.ValueObjectToStringBuilder; +import org.opentripplanner.utils.lang.DoubleUtils; +import org.opentripplanner.utils.tostring.ValueObjectToStringBuilder; /** * This class represent a OTP coordinate. diff --git a/application/src/main/java/org/opentripplanner/framework/graphql/scalar/CostScalarFactory.java b/application/src/main/java/org/opentripplanner/framework/graphql/scalar/CostScalarFactory.java index 415118013f3..fc109444786 100644 --- a/application/src/main/java/org/opentripplanner/framework/graphql/scalar/CostScalarFactory.java +++ b/application/src/main/java/org/opentripplanner/framework/graphql/scalar/CostScalarFactory.java @@ -11,7 +11,7 @@ import java.util.Locale; import java.util.NoSuchElementException; import org.opentripplanner.framework.model.Cost; -import org.opentripplanner.framework.time.DurationUtils; +import org.opentripplanner.utils.time.DurationUtils; public class CostScalarFactory { diff --git a/application/src/main/java/org/opentripplanner/framework/graphql/scalar/DurationScalarFactory.java b/application/src/main/java/org/opentripplanner/framework/graphql/scalar/DurationScalarFactory.java index b685ecc597e..5a61816ea06 100644 --- a/application/src/main/java/org/opentripplanner/framework/graphql/scalar/DurationScalarFactory.java +++ b/application/src/main/java/org/opentripplanner/framework/graphql/scalar/DurationScalarFactory.java @@ -8,7 +8,7 @@ import graphql.schema.GraphQLScalarType; import java.time.Duration; import java.time.format.DateTimeParseException; -import org.opentripplanner.framework.time.DurationUtils; +import org.opentripplanner.utils.time.DurationUtils; public class DurationScalarFactory { diff --git a/application/src/main/java/org/opentripplanner/framework/model/Cost.java b/application/src/main/java/org/opentripplanner/framework/model/Cost.java index dbd96b81180..47ab4875f5b 100644 --- a/application/src/main/java/org/opentripplanner/framework/model/Cost.java +++ b/application/src/main/java/org/opentripplanner/framework/model/Cost.java @@ -2,8 +2,8 @@ import java.io.Serializable; import java.time.Duration; -import org.opentripplanner.framework.lang.IntUtils; -import org.opentripplanner.framework.lang.OtpNumberFormat; +import org.opentripplanner.utils.lang.IntUtils; +import org.opentripplanner.utils.lang.OtpNumberFormat; /** * A type safe representation of a cost, like generalized-cost. A cost unit is equivalent of riding diff --git a/application/src/main/java/org/opentripplanner/framework/model/TimeAndCost.java b/application/src/main/java/org/opentripplanner/framework/model/TimeAndCost.java index e9376dad622..77c568d0b55 100644 --- a/application/src/main/java/org/opentripplanner/framework/model/TimeAndCost.java +++ b/application/src/main/java/org/opentripplanner/framework/model/TimeAndCost.java @@ -1,7 +1,7 @@ package org.opentripplanner.framework.model; import java.time.Duration; -import org.opentripplanner.framework.time.DurationUtils; +import org.opentripplanner.utils.time.DurationUtils; /** * Tuple of time(duration) and cost. diff --git a/application/src/main/java/org/opentripplanner/framework/model/Units.java b/application/src/main/java/org/opentripplanner/framework/model/Units.java index 736846c869f..ab3d77e5703 100644 --- a/application/src/main/java/org/opentripplanner/framework/model/Units.java +++ b/application/src/main/java/org/opentripplanner/framework/model/Units.java @@ -3,8 +3,8 @@ import static java.lang.Math.abs; import java.util.Locale; -import org.opentripplanner.framework.lang.DoubleUtils; -import org.opentripplanner.framework.lang.IntUtils; +import org.opentripplanner.utils.lang.DoubleUtils; +import org.opentripplanner.utils.lang.IntUtils; /** * This utility can be used to perform sanity checks on common number types. It will also normalize diff --git a/application/src/main/java/org/opentripplanner/framework/time/ZoneIdFallback.java b/application/src/main/java/org/opentripplanner/framework/time/ZoneIdFallback.java index 2d43216e4b2..b645dbe88f4 100644 --- a/application/src/main/java/org/opentripplanner/framework/time/ZoneIdFallback.java +++ b/application/src/main/java/org/opentripplanner/framework/time/ZoneIdFallback.java @@ -2,7 +2,7 @@ import java.time.ZoneId; import javax.annotation.Nullable; -import org.opentripplanner.framework.logging.Throttle; +import org.opentripplanner.utils.logging.Throttle; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/framework/token/Serializer.java b/application/src/main/java/org/opentripplanner/framework/token/Serializer.java index 2d01a0ebf5e..3b48792c06d 100644 --- a/application/src/main/java/org/opentripplanner/framework/token/Serializer.java +++ b/application/src/main/java/org/opentripplanner/framework/token/Serializer.java @@ -1,7 +1,7 @@ package org.opentripplanner.framework.token; import java.util.Base64; -import org.opentripplanner.framework.text.CharacterEscapeFormatter; +import org.opentripplanner.utils.text.CharacterEscapeFormatter; class Serializer { diff --git a/application/src/main/java/org/opentripplanner/framework/token/TokenBuilder.java b/application/src/main/java/org/opentripplanner/framework/token/TokenBuilder.java index 4061d073a2d..4a6af98319d 100644 --- a/application/src/main/java/org/opentripplanner/framework/token/TokenBuilder.java +++ b/application/src/main/java/org/opentripplanner/framework/token/TokenBuilder.java @@ -2,7 +2,7 @@ import java.time.Duration; import java.time.Instant; -import org.opentripplanner.framework.lang.ObjectUtils; +import org.opentripplanner.utils.lang.ObjectUtils; /** * This class is used to create a {@link Token} before encoding it. diff --git a/application/src/main/java/org/opentripplanner/framework/token/TokenDefinition.java b/application/src/main/java/org/opentripplanner/framework/token/TokenDefinition.java index d4ac7a61aec..e8e44f0f293 100644 --- a/application/src/main/java/org/opentripplanner/framework/token/TokenDefinition.java +++ b/application/src/main/java/org/opentripplanner/framework/token/TokenDefinition.java @@ -4,7 +4,7 @@ import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * A token definition is an ordered list of fields. A field has a name and a type. The diff --git a/application/src/main/java/org/opentripplanner/framework/token/TokenDefinitionBuilder.java b/application/src/main/java/org/opentripplanner/framework/token/TokenDefinitionBuilder.java index 06a935c7b47..6fb9f500e88 100644 --- a/application/src/main/java/org/opentripplanner/framework/token/TokenDefinitionBuilder.java +++ b/application/src/main/java/org/opentripplanner/framework/token/TokenDefinitionBuilder.java @@ -2,8 +2,8 @@ import java.util.ArrayList; import java.util.List; -import org.opentripplanner.framework.collection.ListUtils; -import org.opentripplanner.framework.lang.IntUtils; +import org.opentripplanner.utils.collection.ListUtils; +import org.opentripplanner.utils.lang.IntUtils; public class TokenDefinitionBuilder { diff --git a/application/src/main/java/org/opentripplanner/framework/token/TokenFormatterConfiguration.java b/application/src/main/java/org/opentripplanner/framework/token/TokenFormatterConfiguration.java index 3945014dad5..16f71d7475c 100644 --- a/application/src/main/java/org/opentripplanner/framework/token/TokenFormatterConfiguration.java +++ b/application/src/main/java/org/opentripplanner/framework/token/TokenFormatterConfiguration.java @@ -1,6 +1,6 @@ package org.opentripplanner.framework.token; -import org.opentripplanner.framework.text.CharacterEscapeFormatter; +import org.opentripplanner.utils.text.CharacterEscapeFormatter; class TokenFormatterConfiguration { diff --git a/application/src/main/java/org/opentripplanner/framework/token/TokenSchema.java b/application/src/main/java/org/opentripplanner/framework/token/TokenSchema.java index 7ac3aa63c9f..35bb836251b 100644 --- a/application/src/main/java/org/opentripplanner/framework/token/TokenSchema.java +++ b/application/src/main/java/org/opentripplanner/framework/token/TokenSchema.java @@ -3,7 +3,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * A token schema contains a set of token definitions, one for each version. This is diff --git a/application/src/main/java/org/opentripplanner/framework/token/TokenType.java b/application/src/main/java/org/opentripplanner/framework/token/TokenType.java index aea39949b0e..b60d80f3406 100644 --- a/application/src/main/java/org/opentripplanner/framework/token/TokenType.java +++ b/application/src/main/java/org/opentripplanner/framework/token/TokenType.java @@ -3,7 +3,7 @@ import java.time.Duration; import java.time.Instant; import javax.annotation.Nullable; -import org.opentripplanner.framework.time.DurationUtils; +import org.opentripplanner.utils.time.DurationUtils; /** * List of types we can store in a token. diff --git a/application/src/main/java/org/opentripplanner/graph_builder/GraphBuilder.java b/application/src/main/java/org/opentripplanner/graph_builder/GraphBuilder.java index f88cc6ea937..bc83ad2a8af 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/GraphBuilder.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/GraphBuilder.java @@ -13,8 +13,6 @@ import org.opentripplanner.ext.stopconsolidation.StopConsolidationRepository; import org.opentripplanner.framework.application.OTPFeature; import org.opentripplanner.framework.application.OtpAppException; -import org.opentripplanner.framework.lang.OtpNumberFormat; -import org.opentripplanner.framework.time.DurationUtils; import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.graph_builder.issue.api.DataImportIssueSummary; import org.opentripplanner.graph_builder.model.GraphBuilderModule; @@ -24,6 +22,8 @@ import org.opentripplanner.standalone.config.BuildConfig; import org.opentripplanner.street.model.StreetLimitationParameters; import org.opentripplanner.transit.service.TimetableRepository; +import org.opentripplanner.utils.lang.OtpNumberFormat; +import org.opentripplanner.utils.time.DurationUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/graph_builder/issue/api/Issue.java b/application/src/main/java/org/opentripplanner/graph_builder/issue/api/Issue.java index 24beb48e845..cb50320345c 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/issue/api/Issue.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/issue/api/Issue.java @@ -1,6 +1,6 @@ package org.opentripplanner.graph_builder.issue.api; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * Generic issue type, which can be used to create issues. diff --git a/application/src/main/java/org/opentripplanner/graph_builder/issue/report/DataImportIssueReporter.java b/application/src/main/java/org/opentripplanner/graph_builder/issue/report/DataImportIssueReporter.java index 5d209f26ac9..28daceccbba 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/issue/report/DataImportIssueReporter.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/issue/report/DataImportIssueReporter.java @@ -8,10 +8,10 @@ import java.util.Map; import java.util.stream.Collectors; import org.opentripplanner.datastore.api.CompositeDataSource; -import org.opentripplanner.framework.logging.ProgressTracker; import org.opentripplanner.graph_builder.issue.api.DataImportIssue; import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.graph_builder.model.GraphBuilderModule; +import org.opentripplanner.utils.logging.ProgressTracker; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/graph_builder/issues/HopZeroDistance.java b/application/src/main/java/org/opentripplanner/graph_builder/issues/HopZeroDistance.java index 3ea11b25901..cf11f011d00 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/issues/HopZeroDistance.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/issues/HopZeroDistance.java @@ -1,10 +1,10 @@ package org.opentripplanner.graph_builder.issues; import org.locationtech.jts.geom.Geometry; -import org.opentripplanner.framework.time.DurationUtils; import org.opentripplanner.graph_builder.issue.api.DataImportIssue; import org.opentripplanner.transit.model.site.StopLocation; import org.opentripplanner.transit.model.timetable.Trip; +import org.opentripplanner.utils.time.DurationUtils; public record HopZeroDistance( int sec, diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/DirectTransferGenerator.java b/application/src/main/java/org/opentripplanner/graph_builder/module/DirectTransferGenerator.java index a1a0796c66a..c0deb932418 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/DirectTransferGenerator.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/DirectTransferGenerator.java @@ -8,7 +8,6 @@ import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; import org.opentripplanner.framework.application.OTPFeature; -import org.opentripplanner.framework.logging.ProgressTracker; import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.graph_builder.issues.StopNotLinkedForTransfers; import org.opentripplanner.graph_builder.model.GraphBuilderModule; @@ -26,6 +25,7 @@ import org.opentripplanner.transit.model.site.StopLocation; import org.opentripplanner.transit.service.DefaultTransitService; import org.opentripplanner.transit.service.TimetableRepository; +import org.opentripplanner.utils.logging.ProgressTracker; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java b/application/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java index 32495617db9..a52f705147e 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/StreetLinkerModule.java @@ -6,7 +6,6 @@ import java.util.function.BiFunction; import java.util.stream.Collectors; import org.opentripplanner.framework.application.OTPFeature; -import org.opentripplanner.framework.logging.ProgressTracker; import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.graph_builder.issues.ParkAndRideEntranceRemoved; import org.opentripplanner.graph_builder.model.GraphBuilderModule; @@ -32,6 +31,7 @@ import org.opentripplanner.transit.model.site.RegularStop; import org.opentripplanner.transit.model.site.StopLocation; import org.opentripplanner.transit.service.TimetableRepository; +import org.opentripplanner.utils.logging.ProgressTracker; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/ValidateAndInterpolateStopTimesForEachTrip.java b/application/src/main/java/org/opentripplanner/graph_builder/module/ValidateAndInterpolateStopTimesForEachTrip.java index b0fc10fbe37..62b8e5c8173 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/ValidateAndInterpolateStopTimesForEachTrip.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/ValidateAndInterpolateStopTimesForEachTrip.java @@ -8,7 +8,6 @@ import org.opentripplanner.ext.flex.trip.FlexTrip; import org.opentripplanner.framework.application.OTPFeature; import org.opentripplanner.framework.geometry.SphericalDistanceLibrary; -import org.opentripplanner.framework.logging.ProgressTracker; import org.opentripplanner.graph_builder.issue.api.DataImportIssue; import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.graph_builder.issues.HopSpeedFast; @@ -23,6 +22,7 @@ import org.opentripplanner.transit.model.basic.TransitMode; import org.opentripplanner.transit.model.site.RegularStop; import org.opentripplanner.transit.model.timetable.Trip; +import org.opentripplanner.utils.logging.ProgressTracker; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/geometry/CalculateWorldEnvelopeModule.java b/application/src/main/java/org/opentripplanner/graph_builder/module/geometry/CalculateWorldEnvelopeModule.java index e114eb612e3..87bb931cd3a 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/geometry/CalculateWorldEnvelopeModule.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/geometry/CalculateWorldEnvelopeModule.java @@ -2,7 +2,6 @@ import jakarta.inject.Inject; import java.util.Collection; -import org.opentripplanner.framework.logging.ProgressTracker; import org.opentripplanner.graph_builder.model.GraphBuilderModule; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.service.worldenvelope.WorldEnvelopeRepository; @@ -10,6 +9,7 @@ import org.opentripplanner.street.model.vertex.Vertex; import org.opentripplanner.transit.model.site.StopLocation; import org.opentripplanner.transit.service.TimetableRepository; +import org.opentripplanner.utils.logging.ProgressTracker; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/ned/ElevationModule.java b/application/src/main/java/org/opentripplanner/graph_builder/module/ned/ElevationModule.java index 6bcab049bd4..af8fb943072 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/ned/ElevationModule.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/ned/ElevationModule.java @@ -29,9 +29,6 @@ import org.locationtech.jts.geom.impl.PackedCoordinateSequence; import org.opentripplanner.framework.geometry.EncodedPolyline; import org.opentripplanner.framework.geometry.SphericalDistanceLibrary; -import org.opentripplanner.framework.lang.IntUtils; -import org.opentripplanner.framework.logging.ProgressTracker; -import org.opentripplanner.framework.time.DurationUtils; import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.graph_builder.issues.ElevationFlattened; import org.opentripplanner.graph_builder.issues.ElevationProfileFailure; @@ -43,6 +40,9 @@ import org.opentripplanner.street.model.edge.StreetEdge; import org.opentripplanner.street.model.edge.StreetElevationExtensionBuilder; import org.opentripplanner.street.model.vertex.Vertex; +import org.opentripplanner.utils.lang.IntUtils; +import org.opentripplanner.utils.logging.ProgressTracker; +import org.opentripplanner.utils.time.DurationUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/ned/MissingElevationHandler.java b/application/src/main/java/org/opentripplanner/graph_builder/module/ned/MissingElevationHandler.java index 4ae6c698d03..e0f5672a6ca 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/ned/MissingElevationHandler.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/ned/MissingElevationHandler.java @@ -5,7 +5,6 @@ import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.impl.PackedCoordinateSequence; import org.opentripplanner.astar.model.BinHeap; -import org.opentripplanner.framework.lang.DoubleUtils; import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.graph_builder.issues.ElevationFlattened; import org.opentripplanner.graph_builder.issues.ElevationProfileFailure; @@ -13,6 +12,7 @@ import org.opentripplanner.street.model.edge.StreetEdge; import org.opentripplanner.street.model.edge.StreetElevationExtensionBuilder; import org.opentripplanner.street.model.vertex.Vertex; +import org.opentripplanner.utils.lang.DoubleUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmDatabase.java b/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmDatabase.java index 0fa3c4cbd3b..382b206a053 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmDatabase.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmDatabase.java @@ -27,7 +27,6 @@ import org.opentripplanner.framework.collection.ToveUtils; import org.opentripplanner.framework.geometry.GeometryUtils; import org.opentripplanner.framework.geometry.HashGridSpatialIndex; -import org.opentripplanner.framework.lang.StringUtils; import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.graph_builder.issue.api.Issue; import org.opentripplanner.graph_builder.issues.DisconnectedOsmNode; @@ -50,6 +49,7 @@ import org.opentripplanner.street.model.TurnRestrictionType; import org.opentripplanner.street.search.TraverseMode; import org.opentripplanner.street.search.TraverseModeSet; +import org.opentripplanner.utils.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModule.java b/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModule.java index 98ed4953b91..08d23087a45 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModule.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmModule.java @@ -14,7 +14,6 @@ import org.opentripplanner.framework.geometry.GeometryUtils; import org.opentripplanner.framework.geometry.SphericalDistanceLibrary; import org.opentripplanner.framework.i18n.I18NString; -import org.opentripplanner.framework.logging.ProgressTracker; import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.graph_builder.model.GraphBuilderModule; import org.opentripplanner.graph_builder.module.osm.parameters.OsmProcessingParameters; @@ -34,6 +33,7 @@ import org.opentripplanner.street.model.vertex.BarrierVertex; import org.opentripplanner.street.model.vertex.IntersectionVertex; import org.opentripplanner.street.model.vertex.Vertex; +import org.opentripplanner.utils.logging.ProgressTracker; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/osm/naming/SidewalkNamer.java b/application/src/main/java/org/opentripplanner/graph_builder/module/osm/naming/SidewalkNamer.java index f2bb2951239..582684d3bea 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/osm/naming/SidewalkNamer.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/osm/naming/SidewalkNamer.java @@ -27,12 +27,12 @@ import org.opentripplanner.framework.geometry.HashGridSpatialIndex; import org.opentripplanner.framework.geometry.SphericalDistanceLibrary; import org.opentripplanner.framework.i18n.I18NString; -import org.opentripplanner.framework.lang.DoubleUtils; -import org.opentripplanner.framework.logging.ProgressTracker; import org.opentripplanner.graph_builder.module.osm.StreetEdgePair; import org.opentripplanner.graph_builder.services.osm.EdgeNamer; import org.opentripplanner.osm.model.OsmWithTags; import org.opentripplanner.street.model.edge.StreetEdge; +import org.opentripplanner.utils.lang.DoubleUtils; +import org.opentripplanner.utils.logging.ProgressTracker; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/gtfs/GenerateTripPatternsOperation.java b/application/src/main/java/org/opentripplanner/gtfs/GenerateTripPatternsOperation.java index 08ad300fa9a..e647bc4cb9e 100644 --- a/application/src/main/java/org/opentripplanner/gtfs/GenerateTripPatternsOperation.java +++ b/application/src/main/java/org/opentripplanner/gtfs/GenerateTripPatternsOperation.java @@ -10,7 +10,6 @@ import java.util.Map; import java.util.Set; import org.opentripplanner.ext.flex.trip.FlexTrip; -import org.opentripplanner.framework.logging.ProgressTracker; import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.graph_builder.issues.TripDegenerate; import org.opentripplanner.graph_builder.issues.TripUndefinedService; @@ -30,6 +29,7 @@ import org.opentripplanner.transit.model.timetable.Trip; import org.opentripplanner.transit.model.timetable.TripTimes; import org.opentripplanner.transit.model.timetable.TripTimesFactory; +import org.opentripplanner.utils.logging.ProgressTracker; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/gtfs/interlining/InterlineProcessor.java b/application/src/main/java/org/opentripplanner/gtfs/interlining/InterlineProcessor.java index 4247af4117e..dbfe3af1c9b 100644 --- a/application/src/main/java/org/opentripplanner/gtfs/interlining/InterlineProcessor.java +++ b/application/src/main/java/org/opentripplanner/gtfs/interlining/InterlineProcessor.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.Map; import org.opentripplanner.framework.geometry.SphericalDistanceLibrary; -import org.opentripplanner.framework.lang.StringUtils; import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.graph_builder.issues.InterliningTeleport; import org.opentripplanner.gtfs.mapping.StaySeatedNotAllowed; @@ -27,6 +26,7 @@ import org.opentripplanner.transit.model.network.TripPattern; import org.opentripplanner.transit.model.timetable.Trip; import org.opentripplanner.transit.model.timetable.TripTimes; +import org.opentripplanner.utils.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/gtfs/mapping/AgencyMapper.java b/application/src/main/java/org/opentripplanner/gtfs/mapping/AgencyMapper.java index f57a9db8684..3e826c998a5 100644 --- a/application/src/main/java/org/opentripplanner/gtfs/mapping/AgencyMapper.java +++ b/application/src/main/java/org/opentripplanner/gtfs/mapping/AgencyMapper.java @@ -3,9 +3,9 @@ import java.util.Collection; import java.util.HashMap; import java.util.Map; -import org.opentripplanner.framework.collection.MapUtils; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.transit.model.organization.Agency; +import org.opentripplanner.utils.collection.MapUtils; /** Responsible for mapping GTFS Agency into the OTP model. */ class AgencyMapper { diff --git a/application/src/main/java/org/opentripplanner/gtfs/mapping/BoardingAreaMapper.java b/application/src/main/java/org/opentripplanner/gtfs/mapping/BoardingAreaMapper.java index 9c818e97bdb..d757a08d6df 100644 --- a/application/src/main/java/org/opentripplanner/gtfs/mapping/BoardingAreaMapper.java +++ b/application/src/main/java/org/opentripplanner/gtfs/mapping/BoardingAreaMapper.java @@ -7,10 +7,10 @@ import java.util.Map; import java.util.Optional; import java.util.function.Function; -import org.opentripplanner.framework.collection.MapUtils; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.transit.model.site.BoardingArea; import org.opentripplanner.transit.model.site.RegularStop; +import org.opentripplanner.utils.collection.MapUtils; /** * Responsible for mapping GTFS Boarding areas into the OTP model. diff --git a/application/src/main/java/org/opentripplanner/gtfs/mapping/EntranceMapper.java b/application/src/main/java/org/opentripplanner/gtfs/mapping/EntranceMapper.java index 786baeb1ba8..eb005ebd641 100644 --- a/application/src/main/java/org/opentripplanner/gtfs/mapping/EntranceMapper.java +++ b/application/src/main/java/org/opentripplanner/gtfs/mapping/EntranceMapper.java @@ -4,10 +4,10 @@ import java.util.HashMap; import java.util.Map; import java.util.function.Function; -import org.opentripplanner.framework.collection.MapUtils; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.transit.model.site.Entrance; import org.opentripplanner.transit.model.site.Station; +import org.opentripplanner.utils.collection.MapUtils; /** * Responsible for mapping GTFS Entrance into the OTP model. diff --git a/application/src/main/java/org/opentripplanner/gtfs/mapping/FareAttributeMapper.java b/application/src/main/java/org/opentripplanner/gtfs/mapping/FareAttributeMapper.java index 6b1a195b399..87b06edb82b 100644 --- a/application/src/main/java/org/opentripplanner/gtfs/mapping/FareAttributeMapper.java +++ b/application/src/main/java/org/opentripplanner/gtfs/mapping/FareAttributeMapper.java @@ -8,9 +8,9 @@ import java.util.Map; import org.opentripplanner.ext.fares.model.FareAttribute; import org.opentripplanner.ext.fares.model.FareAttributeBuilder; -import org.opentripplanner.framework.collection.MapUtils; import org.opentripplanner.transit.model.basic.Money; import org.opentripplanner.transit.model.framework.FeedScopedId; +import org.opentripplanner.utils.collection.MapUtils; /** Responsible for mapping GTFS FareAttribute into the OTP model. */ class FareAttributeMapper { diff --git a/application/src/main/java/org/opentripplanner/gtfs/mapping/FareRuleMapper.java b/application/src/main/java/org/opentripplanner/gtfs/mapping/FareRuleMapper.java index 35cefa510f9..022de12404b 100644 --- a/application/src/main/java/org/opentripplanner/gtfs/mapping/FareRuleMapper.java +++ b/application/src/main/java/org/opentripplanner/gtfs/mapping/FareRuleMapper.java @@ -4,7 +4,7 @@ import java.util.HashMap; import java.util.Map; import org.opentripplanner.ext.fares.model.FareRule; -import org.opentripplanner.framework.collection.MapUtils; +import org.opentripplanner.utils.collection.MapUtils; /** Responsible for mapping GTFS FareRule into the OTP model. */ class FareRuleMapper { diff --git a/application/src/main/java/org/opentripplanner/gtfs/mapping/FeedInfoMapper.java b/application/src/main/java/org/opentripplanner/gtfs/mapping/FeedInfoMapper.java index a8ec889372e..1ee10dcfc78 100644 --- a/application/src/main/java/org/opentripplanner/gtfs/mapping/FeedInfoMapper.java +++ b/application/src/main/java/org/opentripplanner/gtfs/mapping/FeedInfoMapper.java @@ -5,8 +5,8 @@ import java.util.Collection; import java.util.HashMap; import java.util.Map; -import org.opentripplanner.framework.collection.MapUtils; import org.opentripplanner.model.FeedInfo; +import org.opentripplanner.utils.collection.MapUtils; /** Responsible for mapping GTFS FeedInfo into the OTP model. */ class FeedInfoMapper { diff --git a/application/src/main/java/org/opentripplanner/gtfs/mapping/FrequencyMapper.java b/application/src/main/java/org/opentripplanner/gtfs/mapping/FrequencyMapper.java index 1144e926499..18927d67000 100644 --- a/application/src/main/java/org/opentripplanner/gtfs/mapping/FrequencyMapper.java +++ b/application/src/main/java/org/opentripplanner/gtfs/mapping/FrequencyMapper.java @@ -3,8 +3,8 @@ import java.util.Collection; import java.util.HashMap; import java.util.Map; -import org.opentripplanner.framework.collection.MapUtils; import org.opentripplanner.model.Frequency; +import org.opentripplanner.utils.collection.MapUtils; /** Responsible for mapping GTFS Frequency into the OTP model. */ class FrequencyMapper { diff --git a/application/src/main/java/org/opentripplanner/gtfs/mapping/LocationGroupMapper.java b/application/src/main/java/org/opentripplanner/gtfs/mapping/LocationGroupMapper.java index b4ba6d3cc27..cf1022d671a 100644 --- a/application/src/main/java/org/opentripplanner/gtfs/mapping/LocationGroupMapper.java +++ b/application/src/main/java/org/opentripplanner/gtfs/mapping/LocationGroupMapper.java @@ -9,11 +9,11 @@ import org.onebusaway.gtfs.model.Location; import org.onebusaway.gtfs.model.LocationGroup; import org.onebusaway.gtfs.model.Stop; -import org.opentripplanner.framework.collection.MapUtils; import org.opentripplanner.framework.i18n.NonLocalizedString; import org.opentripplanner.transit.model.site.GroupStop; import org.opentripplanner.transit.model.site.GroupStopBuilder; import org.opentripplanner.transit.service.SiteRepositoryBuilder; +import org.opentripplanner.utils.collection.MapUtils; public class LocationGroupMapper { diff --git a/application/src/main/java/org/opentripplanner/gtfs/mapping/LocationMapper.java b/application/src/main/java/org/opentripplanner/gtfs/mapping/LocationMapper.java index 5a845b8bfe8..4e75eaac312 100644 --- a/application/src/main/java/org/opentripplanner/gtfs/mapping/LocationMapper.java +++ b/application/src/main/java/org/opentripplanner/gtfs/mapping/LocationMapper.java @@ -8,7 +8,6 @@ import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.operation.valid.IsValidOp; import org.onebusaway.gtfs.model.Location; -import org.opentripplanner.framework.collection.MapUtils; import org.opentripplanner.framework.geometry.GeometryUtils; import org.opentripplanner.framework.geometry.UnsupportedGeometryException; import org.opentripplanner.framework.i18n.NonLocalizedString; @@ -16,6 +15,7 @@ import org.opentripplanner.graph_builder.issue.api.Issue; import org.opentripplanner.transit.model.site.AreaStop; import org.opentripplanner.transit.service.SiteRepositoryBuilder; +import org.opentripplanner.utils.collection.MapUtils; /** Responsible for mapping GTFS Location into the OTP model. */ public class LocationMapper { diff --git a/application/src/main/java/org/opentripplanner/gtfs/mapping/PathwayMapper.java b/application/src/main/java/org/opentripplanner/gtfs/mapping/PathwayMapper.java index d92087d4d41..3f5633a3da4 100644 --- a/application/src/main/java/org/opentripplanner/gtfs/mapping/PathwayMapper.java +++ b/application/src/main/java/org/opentripplanner/gtfs/mapping/PathwayMapper.java @@ -4,10 +4,10 @@ import java.util.HashMap; import java.util.Map; import org.onebusaway.gtfs.model.Stop; -import org.opentripplanner.framework.collection.MapUtils; import org.opentripplanner.transit.model.site.Pathway; import org.opentripplanner.transit.model.site.PathwayBuilder; import org.opentripplanner.transit.model.site.StationElement; +import org.opentripplanner.utils.collection.MapUtils; /** Responsible for mapping GTFS Pathway into the OTP model. */ class PathwayMapper { diff --git a/application/src/main/java/org/opentripplanner/gtfs/mapping/PathwayNodeMapper.java b/application/src/main/java/org/opentripplanner/gtfs/mapping/PathwayNodeMapper.java index 06c1dfb3f18..ab74d4c8e58 100644 --- a/application/src/main/java/org/opentripplanner/gtfs/mapping/PathwayNodeMapper.java +++ b/application/src/main/java/org/opentripplanner/gtfs/mapping/PathwayNodeMapper.java @@ -5,10 +5,10 @@ import java.util.Map; import java.util.Optional; import java.util.function.Function; -import org.opentripplanner.framework.collection.MapUtils; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.transit.model.site.PathwayNode; import org.opentripplanner.transit.model.site.Station; +import org.opentripplanner.utils.collection.MapUtils; /** Responsible for mapping GTFS Node into the OTP model. */ class PathwayNodeMapper { diff --git a/application/src/main/java/org/opentripplanner/gtfs/mapping/RouteMapper.java b/application/src/main/java/org/opentripplanner/gtfs/mapping/RouteMapper.java index 0c668f64b92..96c10c20c01 100644 --- a/application/src/main/java/org/opentripplanner/gtfs/mapping/RouteMapper.java +++ b/application/src/main/java/org/opentripplanner/gtfs/mapping/RouteMapper.java @@ -3,13 +3,13 @@ import java.util.Collection; import java.util.HashMap; import java.util.Map; -import org.opentripplanner.framework.collection.MapUtils; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.transit.model.basic.TransitMode; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.transit.model.network.GroupOfRoutes; import org.opentripplanner.transit.model.network.Route; +import org.opentripplanner.utils.collection.MapUtils; /** Responsible for mapping GTFS Route into the OTP model. */ class RouteMapper { diff --git a/application/src/main/java/org/opentripplanner/gtfs/mapping/ServiceCalendarDateMapper.java b/application/src/main/java/org/opentripplanner/gtfs/mapping/ServiceCalendarDateMapper.java index a722a8ad9e3..53e35380198 100644 --- a/application/src/main/java/org/opentripplanner/gtfs/mapping/ServiceCalendarDateMapper.java +++ b/application/src/main/java/org/opentripplanner/gtfs/mapping/ServiceCalendarDateMapper.java @@ -3,8 +3,8 @@ import java.util.Collection; import java.util.HashMap; import java.util.Map; -import org.opentripplanner.framework.collection.MapUtils; import org.opentripplanner.model.calendar.ServiceCalendarDate; +import org.opentripplanner.utils.collection.MapUtils; /** Responsible for mapping GTFS ServiceCalendarDate into the OTP model. */ class ServiceCalendarDateMapper { diff --git a/application/src/main/java/org/opentripplanner/gtfs/mapping/ServiceCalendarMapper.java b/application/src/main/java/org/opentripplanner/gtfs/mapping/ServiceCalendarMapper.java index 1d229c57b19..0bb1f220a30 100644 --- a/application/src/main/java/org/opentripplanner/gtfs/mapping/ServiceCalendarMapper.java +++ b/application/src/main/java/org/opentripplanner/gtfs/mapping/ServiceCalendarMapper.java @@ -5,8 +5,8 @@ import java.util.Collection; import java.util.HashMap; import java.util.Map; -import org.opentripplanner.framework.collection.MapUtils; import org.opentripplanner.model.calendar.ServiceCalendar; +import org.opentripplanner.utils.collection.MapUtils; /** Responsible for mapping GTFS ServiceCalendar into the OTP model. */ class ServiceCalendarMapper { diff --git a/application/src/main/java/org/opentripplanner/gtfs/mapping/ShapePointMapper.java b/application/src/main/java/org/opentripplanner/gtfs/mapping/ShapePointMapper.java index 78318559e88..8b24bc8f4ea 100644 --- a/application/src/main/java/org/opentripplanner/gtfs/mapping/ShapePointMapper.java +++ b/application/src/main/java/org/opentripplanner/gtfs/mapping/ShapePointMapper.java @@ -3,8 +3,8 @@ import java.util.Collection; import java.util.HashMap; import java.util.Map; -import org.opentripplanner.framework.collection.MapUtils; import org.opentripplanner.model.ShapePoint; +import org.opentripplanner.utils.collection.MapUtils; /** Responsible for mapping GTFS ShapePoint into the OTP model. */ class ShapePointMapper { diff --git a/application/src/main/java/org/opentripplanner/gtfs/mapping/StopMapper.java b/application/src/main/java/org/opentripplanner/gtfs/mapping/StopMapper.java index 4cbe252d68f..e5d68e71fee 100644 --- a/application/src/main/java/org/opentripplanner/gtfs/mapping/StopMapper.java +++ b/application/src/main/java/org/opentripplanner/gtfs/mapping/StopMapper.java @@ -6,13 +6,13 @@ import java.util.Map; import java.util.function.Function; import org.onebusaway.gtfs.model.Stop; -import org.opentripplanner.framework.collection.MapUtils; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.transit.model.site.FareZone; import org.opentripplanner.transit.model.site.RegularStop; import org.opentripplanner.transit.model.site.RegularStopBuilder; import org.opentripplanner.transit.model.site.Station; import org.opentripplanner.transit.service.SiteRepositoryBuilder; +import org.opentripplanner.utils.collection.MapUtils; /** Responsible for mapping GTFS Stop into the OTP model. */ class StopMapper { diff --git a/application/src/main/java/org/opentripplanner/gtfs/mapping/StopTimeMapper.java b/application/src/main/java/org/opentripplanner/gtfs/mapping/StopTimeMapper.java index 5f20b6e0224..2b1d30c09bd 100644 --- a/application/src/main/java/org/opentripplanner/gtfs/mapping/StopTimeMapper.java +++ b/application/src/main/java/org/opentripplanner/gtfs/mapping/StopTimeMapper.java @@ -7,9 +7,9 @@ import org.onebusaway.gtfs.model.Location; import org.onebusaway.gtfs.model.LocationGroup; import org.onebusaway.gtfs.model.Stop; -import org.opentripplanner.framework.collection.MapUtils; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.model.StopTime; +import org.opentripplanner.utils.collection.MapUtils; /** * Responsible for mapping GTFS StopTime into the OTP Transit model. diff --git a/application/src/main/java/org/opentripplanner/gtfs/mapping/TripMapper.java b/application/src/main/java/org/opentripplanner/gtfs/mapping/TripMapper.java index fdef2bb4e0c..70f2fe3094e 100644 --- a/application/src/main/java/org/opentripplanner/gtfs/mapping/TripMapper.java +++ b/application/src/main/java/org/opentripplanner/gtfs/mapping/TripMapper.java @@ -5,10 +5,10 @@ import java.util.HashMap; import java.util.Map; import java.util.Optional; -import org.opentripplanner.framework.collection.MapUtils; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.routing.api.request.framework.TimePenalty; import org.opentripplanner.transit.model.timetable.Trip; +import org.opentripplanner.utils.collection.MapUtils; /** Responsible for mapping GTFS TripMapper into the OTP model. */ class TripMapper { diff --git a/application/src/main/java/org/opentripplanner/inspector/vector/edge/EdgePropertyMapper.java b/application/src/main/java/org/opentripplanner/inspector/vector/edge/EdgePropertyMapper.java index d43a91d384d..5dc68fc335f 100644 --- a/application/src/main/java/org/opentripplanner/inspector/vector/edge/EdgePropertyMapper.java +++ b/application/src/main/java/org/opentripplanner/inspector/vector/edge/EdgePropertyMapper.java @@ -1,17 +1,17 @@ package org.opentripplanner.inspector.vector.edge; -import static org.opentripplanner.framework.lang.DoubleUtils.roundTo2Decimals; import static org.opentripplanner.inspector.vector.KeyValue.kv; +import static org.opentripplanner.utils.lang.DoubleUtils.roundTo2Decimals; import com.google.common.collect.Lists; import java.util.Collection; import java.util.List; import org.opentripplanner.apis.support.mapping.PropertyMapper; -import org.opentripplanner.framework.collection.ListUtils; import org.opentripplanner.inspector.vector.KeyValue; import org.opentripplanner.street.model.edge.Edge; import org.opentripplanner.street.model.edge.EscalatorEdge; import org.opentripplanner.street.model.edge.StreetEdge; +import org.opentripplanner.utils.collection.ListUtils; public class EdgePropertyMapper extends PropertyMapper { diff --git a/application/src/main/java/org/opentripplanner/inspector/vector/vertex/VertexPropertyMapper.java b/application/src/main/java/org/opentripplanner/inspector/vector/vertex/VertexPropertyMapper.java index 01f5263b11a..de700486c77 100644 --- a/application/src/main/java/org/opentripplanner/inspector/vector/vertex/VertexPropertyMapper.java +++ b/application/src/main/java/org/opentripplanner/inspector/vector/vertex/VertexPropertyMapper.java @@ -8,7 +8,6 @@ import java.util.List; import java.util.Set; import org.opentripplanner.apis.support.mapping.PropertyMapper; -import org.opentripplanner.framework.collection.ListUtils; import org.opentripplanner.inspector.vector.KeyValue; import org.opentripplanner.routing.vehicle_parking.VehicleParking; import org.opentripplanner.routing.vehicle_parking.VehicleParkingEntrance; @@ -17,6 +16,7 @@ import org.opentripplanner.street.model.vertex.VehicleParkingEntranceVertex; import org.opentripplanner.street.model.vertex.Vertex; import org.opentripplanner.street.search.TraverseMode; +import org.opentripplanner.utils.collection.ListUtils; public class VertexPropertyMapper extends PropertyMapper { diff --git a/application/src/main/java/org/opentripplanner/model/Frequency.java b/application/src/main/java/org/opentripplanner/model/Frequency.java index c4bd653d41b..fd50219d865 100644 --- a/application/src/main/java/org/opentripplanner/model/Frequency.java +++ b/application/src/main/java/org/opentripplanner/model/Frequency.java @@ -3,9 +3,9 @@ import java.io.Serializable; import java.util.Objects; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.transit.model.framework.AbstractTransitEntity; import org.opentripplanner.transit.model.timetable.Trip; +import org.opentripplanner.utils.tostring.ToStringBuilder; public final class Frequency implements Serializable { diff --git a/application/src/main/java/org/opentripplanner/model/GenericLocation.java b/application/src/main/java/org/opentripplanner/model/GenericLocation.java index fd270741e92..bd053cd7147 100644 --- a/application/src/main/java/org/opentripplanner/model/GenericLocation.java +++ b/application/src/main/java/org/opentripplanner/model/GenericLocation.java @@ -2,9 +2,9 @@ import javax.annotation.Nullable; import org.locationtech.jts.geom.Coordinate; -import org.opentripplanner.framework.lang.StringUtils; -import org.opentripplanner.framework.tostring.ValueObjectToStringBuilder; import org.opentripplanner.transit.model.framework.FeedScopedId; +import org.opentripplanner.utils.lang.StringUtils; +import org.opentripplanner.utils.tostring.ValueObjectToStringBuilder; /** * Represents a location that is to be used in a routing request. It can be either a from, to, or diff --git a/application/src/main/java/org/opentripplanner/model/PathTransfer.java b/application/src/main/java/org/opentripplanner/model/PathTransfer.java index 161df9fd3b8..5b42a8149e3 100644 --- a/application/src/main/java/org/opentripplanner/model/PathTransfer.java +++ b/application/src/main/java/org/opentripplanner/model/PathTransfer.java @@ -2,10 +2,10 @@ import java.io.Serializable; import java.util.List; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.model.transfer.ConstrainedTransfer; import org.opentripplanner.street.model.edge.Edge; import org.opentripplanner.transit.model.site.StopLocation; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * Represents a transfer between stops with the street network path attatched to it. diff --git a/application/src/main/java/org/opentripplanner/model/StopTime.java b/application/src/main/java/org/opentripplanner/model/StopTime.java index edd5fbdb52d..e31350192e1 100644 --- a/application/src/main/java/org/opentripplanner/model/StopTime.java +++ b/application/src/main/java/org/opentripplanner/model/StopTime.java @@ -3,11 +3,11 @@ import java.util.List; import org.opentripplanner.framework.i18n.I18NString; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.transit.model.site.StopLocation; import org.opentripplanner.transit.model.timetable.StopTimeKey; import org.opentripplanner.transit.model.timetable.Trip; import org.opentripplanner.transit.model.timetable.booking.BookingInfo; +import org.opentripplanner.utils.time.TimeUtils; /** * This class is TEMPORALLY used during mapping of GTFS and Netex into the internal Model, it is not diff --git a/application/src/main/java/org/opentripplanner/model/SystemNotice.java b/application/src/main/java/org/opentripplanner/model/SystemNotice.java index f9af41d3fd0..6e6b910665a 100644 --- a/application/src/main/java/org/opentripplanner/model/SystemNotice.java +++ b/application/src/main/java/org/opentripplanner/model/SystemNotice.java @@ -1,8 +1,8 @@ package org.opentripplanner.model; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.routing.alertpatch.TransitAlert; import org.opentripplanner.transit.model.basic.Notice; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * A system notice is used to tag elements with system information. diff --git a/application/src/main/java/org/opentripplanner/model/Timetable.java b/application/src/main/java/org/opentripplanner/model/Timetable.java index 6740e2cc99d..c437a60b0d5 100644 --- a/application/src/main/java/org/opentripplanner/model/Timetable.java +++ b/application/src/main/java/org/opentripplanner/model/Timetable.java @@ -22,7 +22,6 @@ import java.util.Map; import java.util.Optional; import javax.annotation.Nullable; -import org.opentripplanner.framework.time.ServiceDateUtils; import org.opentripplanner.transit.model.framework.DataValidationException; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.transit.model.framework.Result; @@ -36,6 +35,7 @@ import org.opentripplanner.updater.spi.DataValidationExceptionMapper; import org.opentripplanner.updater.spi.UpdateError; import org.opentripplanner.updater.trip.BackwardsDelayPropagationType; +import org.opentripplanner.utils.time.ServiceDateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/model/TimetableSnapshot.java b/application/src/main/java/org/opentripplanner/model/TimetableSnapshot.java index fa8bb2e55e0..0a54fc964d8 100644 --- a/application/src/main/java/org/opentripplanner/model/TimetableSnapshot.java +++ b/application/src/main/java/org/opentripplanner/model/TimetableSnapshot.java @@ -1,6 +1,6 @@ package org.opentripplanner.model; -import static org.opentripplanner.framework.collection.CollectionUtils.getByNullableKey; +import static org.opentripplanner.utils.collection.CollectionUtils.getByNullableKey; import com.google.common.collect.HashMultimap; import com.google.common.collect.ImmutableSetMultimap; diff --git a/application/src/main/java/org/opentripplanner/model/calendar/CalendarServiceData.java b/application/src/main/java/org/opentripplanner/model/calendar/CalendarServiceData.java index b007fa08ea1..81011f03bd0 100644 --- a/application/src/main/java/org/opentripplanner/model/calendar/CalendarServiceData.java +++ b/application/src/main/java/org/opentripplanner/model/calendar/CalendarServiceData.java @@ -11,8 +11,8 @@ import java.util.Map; import java.util.Optional; import java.util.Set; -import org.opentripplanner.framework.time.ServiceDateUtils; import org.opentripplanner.transit.model.framework.FeedScopedId; +import org.opentripplanner.utils.time.ServiceDateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/model/calendar/ServiceCalendarDate.java b/application/src/main/java/org/opentripplanner/model/calendar/ServiceCalendarDate.java index 87fb173a112..9d6ddb748cf 100644 --- a/application/src/main/java/org/opentripplanner/model/calendar/ServiceCalendarDate.java +++ b/application/src/main/java/org/opentripplanner/model/calendar/ServiceCalendarDate.java @@ -4,8 +4,8 @@ import java.io.Serializable; import java.time.LocalDate; import java.util.Objects; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.transit.model.framework.FeedScopedId; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * This class explicitly activate or disable a service by date. It can be used in two ways. diff --git a/application/src/main/java/org/opentripplanner/model/calendar/ServiceDateInterval.java b/application/src/main/java/org/opentripplanner/model/calendar/ServiceDateInterval.java index a879f6c790e..db0aef21bd0 100644 --- a/application/src/main/java/org/opentripplanner/model/calendar/ServiceDateInterval.java +++ b/application/src/main/java/org/opentripplanner/model/calendar/ServiceDateInterval.java @@ -6,7 +6,7 @@ import java.time.LocalDate; import java.time.temporal.ChronoUnit; import java.util.Objects; -import org.opentripplanner.framework.time.ServiceDateUtils; +import org.opentripplanner.utils.time.ServiceDateUtils; /** * Value object which represent a service date interval from a starting date until an end date. diff --git a/application/src/main/java/org/opentripplanner/model/calendar/openinghours/OHCalendar.java b/application/src/main/java/org/opentripplanner/model/calendar/openinghours/OHCalendar.java index 7c084d28186..1881ed72dcc 100644 --- a/application/src/main/java/org/opentripplanner/model/calendar/openinghours/OHCalendar.java +++ b/application/src/main/java/org/opentripplanner/model/calendar/openinghours/OHCalendar.java @@ -8,7 +8,7 @@ import java.time.temporal.ChronoUnit; import java.util.List; import java.util.Objects; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; public class OHCalendar implements Serializable { diff --git a/application/src/main/java/org/opentripplanner/model/calendar/openinghours/OpeningHours.java b/application/src/main/java/org/opentripplanner/model/calendar/openinghours/OpeningHours.java index 2918b43bd42..258caedacdc 100644 --- a/application/src/main/java/org/opentripplanner/model/calendar/openinghours/OpeningHours.java +++ b/application/src/main/java/org/opentripplanner/model/calendar/openinghours/OpeningHours.java @@ -4,7 +4,7 @@ import java.time.LocalTime; import java.util.BitSet; import java.util.Objects; -import org.opentripplanner.framework.time.TimeUtils; +import org.opentripplanner.utils.time.TimeUtils; /** */ diff --git a/application/src/main/java/org/opentripplanner/model/calendar/openinghours/OsmOpeningHoursSupport.java b/application/src/main/java/org/opentripplanner/model/calendar/openinghours/OsmOpeningHoursSupport.java index acb500fee62..e87a63fc678 100644 --- a/application/src/main/java/org/opentripplanner/model/calendar/openinghours/OsmOpeningHoursSupport.java +++ b/application/src/main/java/org/opentripplanner/model/calendar/openinghours/OsmOpeningHoursSupport.java @@ -3,7 +3,7 @@ import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.stream.Collectors; -import org.opentripplanner.framework.time.TimeUtils; +import org.opentripplanner.utils.time.TimeUtils; public class OsmOpeningHoursSupport { diff --git a/application/src/main/java/org/opentripplanner/model/fare/FareMedium.java b/application/src/main/java/org/opentripplanner/model/fare/FareMedium.java index 08a0a738666..caa286b1c31 100644 --- a/application/src/main/java/org/opentripplanner/model/fare/FareMedium.java +++ b/application/src/main/java/org/opentripplanner/model/fare/FareMedium.java @@ -1,8 +1,8 @@ package org.opentripplanner.model.fare; import java.util.Objects; -import org.opentripplanner.framework.lang.Sandbox; import org.opentripplanner.transit.model.framework.FeedScopedId; +import org.opentripplanner.utils.lang.Sandbox; /** * diff --git a/application/src/main/java/org/opentripplanner/model/fare/FareProduct.java b/application/src/main/java/org/opentripplanner/model/fare/FareProduct.java index 189b73807e7..8aa86e5af89 100644 --- a/application/src/main/java/org/opentripplanner/model/fare/FareProduct.java +++ b/application/src/main/java/org/opentripplanner/model/fare/FareProduct.java @@ -6,10 +6,10 @@ import java.util.Objects; import java.util.UUID; import javax.annotation.Nullable; -import org.opentripplanner.framework.lang.Sandbox; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.transit.model.basic.Money; import org.opentripplanner.transit.model.framework.FeedScopedId; +import org.opentripplanner.utils.lang.Sandbox; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * A ticket that a user can purchase to travel. diff --git a/application/src/main/java/org/opentripplanner/model/fare/FareProductUse.java b/application/src/main/java/org/opentripplanner/model/fare/FareProductUse.java index 33c67f56314..99f34503270 100644 --- a/application/src/main/java/org/opentripplanner/model/fare/FareProductUse.java +++ b/application/src/main/java/org/opentripplanner/model/fare/FareProductUse.java @@ -1,6 +1,6 @@ package org.opentripplanner.model.fare; -import org.opentripplanner.framework.lang.Sandbox; +import org.opentripplanner.utils.lang.Sandbox; /** * diff --git a/application/src/main/java/org/opentripplanner/model/fare/ItineraryFares.java b/application/src/main/java/org/opentripplanner/model/fare/ItineraryFares.java index 1a64f21c41b..d39180ac3a9 100644 --- a/application/src/main/java/org/opentripplanner/model/fare/ItineraryFares.java +++ b/application/src/main/java/org/opentripplanner/model/fare/ItineraryFares.java @@ -8,9 +8,9 @@ import java.util.List; import java.util.Objects; import java.util.Set; -import org.opentripplanner.framework.lang.Sandbox; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.model.plan.Leg; +import org.opentripplanner.utils.lang.Sandbox; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * diff --git a/application/src/main/java/org/opentripplanner/model/fare/RiderCategory.java b/application/src/main/java/org/opentripplanner/model/fare/RiderCategory.java index df68d3a8ce6..ee293d2142c 100644 --- a/application/src/main/java/org/opentripplanner/model/fare/RiderCategory.java +++ b/application/src/main/java/org/opentripplanner/model/fare/RiderCategory.java @@ -2,8 +2,8 @@ import java.util.Objects; import javax.annotation.Nullable; -import org.opentripplanner.framework.lang.Sandbox; import org.opentripplanner.transit.model.framework.FeedScopedId; +import org.opentripplanner.utils.lang.Sandbox; @Sandbox public record RiderCategory(FeedScopedId id, String name, @Nullable String url) { diff --git a/application/src/main/java/org/opentripplanner/model/modes/AllowMainAndSubModeFilter.java b/application/src/main/java/org/opentripplanner/model/modes/AllowMainAndSubModeFilter.java index 1b34acd5327..a6f75ac0ed9 100644 --- a/application/src/main/java/org/opentripplanner/model/modes/AllowMainAndSubModeFilter.java +++ b/application/src/main/java/org/opentripplanner/model/modes/AllowMainAndSubModeFilter.java @@ -2,10 +2,10 @@ import java.util.Objects; import javax.annotation.Nullable; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.transit.model.basic.MainAndSubMode; import org.opentripplanner.transit.model.basic.SubMode; import org.opentripplanner.transit.model.basic.TransitMode; +import org.opentripplanner.utils.tostring.ToStringBuilder; class AllowMainAndSubModeFilter implements AllowTransitModeFilter { diff --git a/application/src/main/java/org/opentripplanner/model/modes/AllowMainAndSubModesFilter.java b/application/src/main/java/org/opentripplanner/model/modes/AllowMainAndSubModesFilter.java index 50a20f72c55..5d40b365204 100644 --- a/application/src/main/java/org/opentripplanner/model/modes/AllowMainAndSubModesFilter.java +++ b/application/src/main/java/org/opentripplanner/model/modes/AllowMainAndSubModesFilter.java @@ -5,9 +5,9 @@ import java.util.Comparator; import java.util.List; import java.util.Objects; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.transit.model.basic.SubMode; import org.opentripplanner.transit.model.basic.TransitMode; +import org.opentripplanner.utils.tostring.ToStringBuilder; class AllowMainAndSubModesFilter implements AllowTransitModeFilter { diff --git a/application/src/main/java/org/opentripplanner/model/modes/AllowMainModeFilter.java b/application/src/main/java/org/opentripplanner/model/modes/AllowMainModeFilter.java index eaa6719d143..9efcceee86e 100644 --- a/application/src/main/java/org/opentripplanner/model/modes/AllowMainModeFilter.java +++ b/application/src/main/java/org/opentripplanner/model/modes/AllowMainModeFilter.java @@ -1,8 +1,8 @@ package org.opentripplanner.model.modes; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.transit.model.basic.SubMode; import org.opentripplanner.transit.model.basic.TransitMode; +import org.opentripplanner.utils.tostring.ToStringBuilder; class AllowMainModeFilter implements AllowTransitModeFilter { diff --git a/application/src/main/java/org/opentripplanner/model/modes/AllowMainModesFilter.java b/application/src/main/java/org/opentripplanner/model/modes/AllowMainModesFilter.java index f6c8aa3b4a2..0926f6d5621 100644 --- a/application/src/main/java/org/opentripplanner/model/modes/AllowMainModesFilter.java +++ b/application/src/main/java/org/opentripplanner/model/modes/AllowMainModesFilter.java @@ -3,9 +3,9 @@ import java.util.Collection; import java.util.EnumSet; import java.util.Set; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.transit.model.basic.SubMode; import org.opentripplanner.transit.model.basic.TransitMode; +import org.opentripplanner.utils.tostring.ToStringBuilder; class AllowMainModesFilter implements AllowTransitModeFilter { diff --git a/application/src/main/java/org/opentripplanner/model/modes/ExcludeAllTransitFilter.java b/application/src/main/java/org/opentripplanner/model/modes/ExcludeAllTransitFilter.java index 163d82170b0..08fdf4a528b 100644 --- a/application/src/main/java/org/opentripplanner/model/modes/ExcludeAllTransitFilter.java +++ b/application/src/main/java/org/opentripplanner/model/modes/ExcludeAllTransitFilter.java @@ -1,10 +1,10 @@ package org.opentripplanner.model.modes; import java.io.Serializable; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.routing.api.request.request.filter.TransitFilter; import org.opentripplanner.transit.model.network.TripPattern; import org.opentripplanner.transit.model.timetable.TripTimes; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * This filter will exclude everything. diff --git a/application/src/main/java/org/opentripplanner/model/plan/ElevationProfile.java b/application/src/main/java/org/opentripplanner/model/plan/ElevationProfile.java index a293039c3c3..91f3a748a37 100644 --- a/application/src/main/java/org/opentripplanner/model/plan/ElevationProfile.java +++ b/application/src/main/java/org/opentripplanner/model/plan/ElevationProfile.java @@ -4,8 +4,8 @@ import java.util.List; import java.util.Objects; import java.util.function.Predicate; -import org.opentripplanner.framework.lang.DoubleUtils; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.lang.DoubleUtils; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * Represents an elevation profile as a list of {@code x,y} coordinates. The {@code x} is the diff --git a/application/src/main/java/org/opentripplanner/model/plan/Emissions.java b/application/src/main/java/org/opentripplanner/model/plan/Emissions.java index e19ce3a914a..3339cc8b93f 100644 --- a/application/src/main/java/org/opentripplanner/model/plan/Emissions.java +++ b/application/src/main/java/org/opentripplanner/model/plan/Emissions.java @@ -1,7 +1,7 @@ package org.opentripplanner.model.plan; -import org.opentripplanner.framework.lang.Sandbox; import org.opentripplanner.framework.model.Grams; +import org.opentripplanner.utils.lang.Sandbox; /** * Represents the emissions of a journey. Each type of emissions has its own field and unit. diff --git a/application/src/main/java/org/opentripplanner/model/plan/FrequencyTransitLeg.java b/application/src/main/java/org/opentripplanner/model/plan/FrequencyTransitLeg.java index 48c4b1b7b87..dc00dd49f22 100644 --- a/application/src/main/java/org/opentripplanner/model/plan/FrequencyTransitLeg.java +++ b/application/src/main/java/org/opentripplanner/model/plan/FrequencyTransitLeg.java @@ -2,8 +2,8 @@ import java.util.ArrayList; import java.util.List; -import org.opentripplanner.framework.time.ServiceDateUtils; import org.opentripplanner.transit.model.site.StopLocation; +import org.opentripplanner.utils.time.ServiceDateUtils; /** * One leg of a trip -- that is, a temporally continuous piece of the journey that takes place on a diff --git a/application/src/main/java/org/opentripplanner/model/plan/Itinerary.java b/application/src/main/java/org/opentripplanner/model/plan/Itinerary.java index 18055690b6e..f707b97c131 100644 --- a/application/src/main/java/org/opentripplanner/model/plan/Itinerary.java +++ b/application/src/main/java/org/opentripplanner/model/plan/Itinerary.java @@ -13,9 +13,7 @@ import java.util.stream.Stream; import javax.annotation.Nullable; import org.opentripplanner.ext.flex.FlexibleTransitLeg; -import org.opentripplanner.framework.lang.DoubleUtils; import org.opentripplanner.framework.model.TimeAndCost; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.model.SystemNotice; import org.opentripplanner.model.fare.ItineraryFares; import org.opentripplanner.raptor.api.model.RaptorConstants; @@ -23,6 +21,8 @@ import org.opentripplanner.routing.algorithm.raptoradapter.transit.cost.RaptorCostConverter; import org.opentripplanner.routing.api.request.RouteRequest; import org.opentripplanner.routing.api.request.preference.ItineraryFilterPreferences; +import org.opentripplanner.utils.lang.DoubleUtils; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * An Itinerary is one complete way of getting from the start location to the end location. diff --git a/application/src/main/java/org/opentripplanner/model/plan/ItinerarySortKey.java b/application/src/main/java/org/opentripplanner/model/plan/ItinerarySortKey.java index 18939c95f8c..6df5d828633 100644 --- a/application/src/main/java/org/opentripplanner/model/plan/ItinerarySortKey.java +++ b/application/src/main/java/org/opentripplanner/model/plan/ItinerarySortKey.java @@ -1,7 +1,7 @@ package org.opentripplanner.model.plan; import java.time.Instant; -import org.opentripplanner.framework.tostring.ValueObjectToStringBuilder; +import org.opentripplanner.utils.tostring.ValueObjectToStringBuilder; /** * This interface is used to sort itineraries and other instances that we might want to sort among diff --git a/application/src/main/java/org/opentripplanner/model/plan/Leg.java b/application/src/main/java/org/opentripplanner/model/plan/Leg.java index 174fdf70452..b3c9b526f03 100644 --- a/application/src/main/java/org/opentripplanner/model/plan/Leg.java +++ b/application/src/main/java/org/opentripplanner/model/plan/Leg.java @@ -10,7 +10,6 @@ import javax.annotation.Nullable; import org.locationtech.jts.geom.LineString; import org.opentripplanner.framework.i18n.I18NString; -import org.opentripplanner.framework.lang.Sandbox; import org.opentripplanner.model.PickDrop; import org.opentripplanner.model.fare.FareProductUse; import org.opentripplanner.model.plan.legreference.LegReference; @@ -26,6 +25,7 @@ import org.opentripplanner.transit.model.timetable.Trip; import org.opentripplanner.transit.model.timetable.TripOnServiceDate; import org.opentripplanner.transit.model.timetable.booking.BookingInfo; +import org.opentripplanner.utils.lang.Sandbox; /** * One leg of a trip -- that is, a temporally continuous piece of the journey that takes place on a diff --git a/application/src/main/java/org/opentripplanner/model/plan/Place.java b/application/src/main/java/org/opentripplanner/model/plan/Place.java index fe3a9dee420..4e2e2a425f1 100644 --- a/application/src/main/java/org/opentripplanner/model/plan/Place.java +++ b/application/src/main/java/org/opentripplanner/model/plan/Place.java @@ -3,7 +3,6 @@ import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.framework.i18n.LocalizedString; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.service.vehiclerental.model.VehicleRentalPlace; import org.opentripplanner.service.vehiclerental.street.VehicleRentalPlaceVertex; import org.opentripplanner.street.model.vertex.StreetVertex; @@ -14,6 +13,7 @@ import org.opentripplanner.street.search.state.State; import org.opentripplanner.transit.model.site.AreaStop; import org.opentripplanner.transit.model.site.StopLocation; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * A Place is where a journey starts or ends, or a transit stop along the way. diff --git a/application/src/main/java/org/opentripplanner/model/plan/ScheduledTransitLeg.java b/application/src/main/java/org/opentripplanner/model/plan/ScheduledTransitLeg.java index 9949d83cdfe..f3fba29515e 100644 --- a/application/src/main/java/org/opentripplanner/model/plan/ScheduledTransitLeg.java +++ b/application/src/main/java/org/opentripplanner/model/plan/ScheduledTransitLeg.java @@ -16,9 +16,6 @@ import org.opentripplanner.framework.geometry.GeometryUtils; import org.opentripplanner.framework.geometry.SphericalDistanceLibrary; import org.opentripplanner.framework.i18n.I18NString; -import org.opentripplanner.framework.lang.DoubleUtils; -import org.opentripplanner.framework.time.ServiceDateUtils; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.model.PickDrop; import org.opentripplanner.model.fare.FareProductUse; import org.opentripplanner.model.plan.legreference.LegReference; @@ -38,6 +35,9 @@ import org.opentripplanner.transit.model.timetable.TripOnServiceDate; import org.opentripplanner.transit.model.timetable.TripTimes; import org.opentripplanner.transit.model.timetable.booking.BookingInfo; +import org.opentripplanner.utils.lang.DoubleUtils; +import org.opentripplanner.utils.time.ServiceDateUtils; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * One leg of a trip -- that is, a temporally continuous piece of the journey that takes place on a diff --git a/application/src/main/java/org/opentripplanner/model/plan/StopArrival.java b/application/src/main/java/org/opentripplanner/model/plan/StopArrival.java index 489b122da09..d43df69ff21 100644 --- a/application/src/main/java/org/opentripplanner/model/plan/StopArrival.java +++ b/application/src/main/java/org/opentripplanner/model/plan/StopArrival.java @@ -1,6 +1,6 @@ package org.opentripplanner.model.plan; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * This class is used to represent a stop arrival event mostly for intermediate visits to a stops diff --git a/application/src/main/java/org/opentripplanner/model/plan/StopArrivalMapper.java b/application/src/main/java/org/opentripplanner/model/plan/StopArrivalMapper.java index 25bab2a7c3f..c6a719addd5 100644 --- a/application/src/main/java/org/opentripplanner/model/plan/StopArrivalMapper.java +++ b/application/src/main/java/org/opentripplanner/model/plan/StopArrivalMapper.java @@ -3,9 +3,9 @@ import java.time.LocalDate; import java.time.ZoneId; import java.util.Objects; -import org.opentripplanner.framework.time.ServiceDateUtils; import org.opentripplanner.transit.model.site.StopLocation; import org.opentripplanner.transit.model.timetable.TripTimes; +import org.opentripplanner.utils.time.ServiceDateUtils; /** * Maps leg-related information to an instance of {@link StopArrival}. diff --git a/application/src/main/java/org/opentripplanner/model/plan/StreetLeg.java b/application/src/main/java/org/opentripplanner/model/plan/StreetLeg.java index 6384159a4ec..a61c68dccc5 100644 --- a/application/src/main/java/org/opentripplanner/model/plan/StreetLeg.java +++ b/application/src/main/java/org/opentripplanner/model/plan/StreetLeg.java @@ -7,11 +7,11 @@ import java.util.Set; import javax.annotation.Nullable; import org.locationtech.jts.geom.LineString; -import org.opentripplanner.framework.lang.DoubleUtils; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.model.fare.FareProductUse; import org.opentripplanner.street.model.note.StreetNote; import org.opentripplanner.street.search.TraverseMode; +import org.opentripplanner.utils.lang.DoubleUtils; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * One leg of a trip -- that is, a temporally continuous piece of the journey that takes place using diff --git a/application/src/main/java/org/opentripplanner/model/plan/TripPlan.java b/application/src/main/java/org/opentripplanner/model/plan/TripPlan.java index 2640d655bde..ccd2af8b333 100644 --- a/application/src/main/java/org/opentripplanner/model/plan/TripPlan.java +++ b/application/src/main/java/org/opentripplanner/model/plan/TripPlan.java @@ -3,7 +3,7 @@ import java.time.Instant; import java.util.Collection; import java.util.List; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * A TripPlan is a set of ways to get from point A to point B at time T. diff --git a/application/src/main/java/org/opentripplanner/model/plan/UnknownTransitPathLeg.java b/application/src/main/java/org/opentripplanner/model/plan/UnknownTransitPathLeg.java index 76179a8ee7c..45a9c6561d3 100644 --- a/application/src/main/java/org/opentripplanner/model/plan/UnknownTransitPathLeg.java +++ b/application/src/main/java/org/opentripplanner/model/plan/UnknownTransitPathLeg.java @@ -6,10 +6,10 @@ import java.util.List; import javax.annotation.Nullable; import org.locationtech.jts.geom.LineString; -import org.opentripplanner.framework.time.DurationUtils; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.model.fare.FareProductUse; import org.opentripplanner.raptor.spi.RaptorCostCalculator; +import org.opentripplanner.utils.time.DurationUtils; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * A transit search may return an unknown transit path. A path consisting of a mix of diff --git a/application/src/main/java/org/opentripplanner/model/plan/WalkStep.java b/application/src/main/java/org/opentripplanner/model/plan/WalkStep.java index 13249d5da52..45f2b5da701 100644 --- a/application/src/main/java/org/opentripplanner/model/plan/WalkStep.java +++ b/application/src/main/java/org/opentripplanner/model/plan/WalkStep.java @@ -6,10 +6,10 @@ import java.util.Set; import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.framework.i18n.I18NString; -import org.opentripplanner.framework.lang.DoubleUtils; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.street.model.edge.Edge; import org.opentripplanner.street.model.note.StreetNote; +import org.opentripplanner.utils.lang.DoubleUtils; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * Represents one instruction in walking directions. Three examples from New York City: diff --git a/application/src/main/java/org/opentripplanner/model/plan/WalkStepBuilder.java b/application/src/main/java/org/opentripplanner/model/plan/WalkStepBuilder.java index 25c6ee25b6b..8d4df6634fd 100644 --- a/application/src/main/java/org/opentripplanner/model/plan/WalkStepBuilder.java +++ b/application/src/main/java/org/opentripplanner/model/plan/WalkStepBuilder.java @@ -7,10 +7,10 @@ import javax.annotation.Nullable; import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.framework.i18n.I18NString; -import org.opentripplanner.framework.lang.DoubleUtils; -import org.opentripplanner.framework.lang.IntUtils; import org.opentripplanner.street.model.edge.Edge; import org.opentripplanner.street.model.note.StreetNote; +import org.opentripplanner.utils.lang.DoubleUtils; +import org.opentripplanner.utils.lang.IntUtils; public class WalkStepBuilder { diff --git a/application/src/main/java/org/opentripplanner/model/plan/legreference/ScheduledTransitLegReference.java b/application/src/main/java/org/opentripplanner/model/plan/legreference/ScheduledTransitLegReference.java index b008dea5737..422a62ce763 100644 --- a/application/src/main/java/org/opentripplanner/model/plan/legreference/ScheduledTransitLegReference.java +++ b/application/src/main/java/org/opentripplanner/model/plan/legreference/ScheduledTransitLegReference.java @@ -3,7 +3,6 @@ import java.time.LocalDate; import java.time.ZoneId; import javax.annotation.Nullable; -import org.opentripplanner.framework.time.ServiceDateUtils; import org.opentripplanner.model.Timetable; import org.opentripplanner.model.plan.ScheduledTransitLeg; import org.opentripplanner.model.plan.ScheduledTransitLegBuilder; @@ -15,6 +14,7 @@ import org.opentripplanner.transit.model.timetable.TripOnServiceDate; import org.opentripplanner.transit.model.timetable.TripTimes; import org.opentripplanner.transit.service.TransitService; +import org.opentripplanner.utils.time.ServiceDateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/model/plan/paging/cursor/PageCursor.java b/application/src/main/java/org/opentripplanner/model/plan/paging/cursor/PageCursor.java index a52dc0429c1..ead71fbeb38 100644 --- a/application/src/main/java/org/opentripplanner/model/plan/paging/cursor/PageCursor.java +++ b/application/src/main/java/org/opentripplanner/model/plan/paging/cursor/PageCursor.java @@ -3,10 +3,10 @@ import java.time.Duration; import java.time.Instant; import javax.annotation.Nullable; -import org.opentripplanner.framework.collection.ListSection; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.model.plan.ItinerarySortKey; import org.opentripplanner.model.plan.SortOrder; +import org.opentripplanner.utils.collection.ListSection; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * This class holds all the information needed to page to the next/previous page. It is serialized diff --git a/application/src/main/java/org/opentripplanner/model/plan/paging/cursor/PageCursorFactory.java b/application/src/main/java/org/opentripplanner/model/plan/paging/cursor/PageCursorFactory.java index 92f59319cc1..4e2fad2a398 100644 --- a/application/src/main/java/org/opentripplanner/model/plan/paging/cursor/PageCursorFactory.java +++ b/application/src/main/java/org/opentripplanner/model/plan/paging/cursor/PageCursorFactory.java @@ -6,9 +6,9 @@ import java.time.Duration; import java.time.Instant; import javax.annotation.Nullable; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.model.plan.ItinerarySortKey; import org.opentripplanner.model.plan.SortOrder; +import org.opentripplanner.utils.tostring.ToStringBuilder; public class PageCursorFactory { diff --git a/application/src/main/java/org/opentripplanner/model/plan/paging/cursor/PageCursorSerializer.java b/application/src/main/java/org/opentripplanner/model/plan/paging/cursor/PageCursorSerializer.java index 396c7499d2f..ac2a8e1df0b 100644 --- a/application/src/main/java/org/opentripplanner/model/plan/paging/cursor/PageCursorSerializer.java +++ b/application/src/main/java/org/opentripplanner/model/plan/paging/cursor/PageCursorSerializer.java @@ -1,10 +1,10 @@ package org.opentripplanner.model.plan.paging.cursor; import javax.annotation.Nullable; -import org.opentripplanner.framework.lang.StringUtils; import org.opentripplanner.framework.token.TokenSchema; import org.opentripplanner.model.plan.ItinerarySortKey; import org.opentripplanner.model.plan.SortOrder; +import org.opentripplanner.utils.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/model/projectinfo/VersionControlInfo.java b/application/src/main/java/org/opentripplanner/model/projectinfo/VersionControlInfo.java index d2bbca43e66..6cd6a47f5ef 100644 --- a/application/src/main/java/org/opentripplanner/model/projectinfo/VersionControlInfo.java +++ b/application/src/main/java/org/opentripplanner/model/projectinfo/VersionControlInfo.java @@ -3,7 +3,7 @@ import static org.opentripplanner.model.projectinfo.OtpProjectInfo.UNKNOWN; import java.io.Serializable; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; public class VersionControlInfo implements Serializable { diff --git a/application/src/main/java/org/opentripplanner/model/transfer/ConstrainedTransfer.java b/application/src/main/java/org/opentripplanner/model/transfer/ConstrainedTransfer.java index d289727fd57..a5e6c624d9c 100644 --- a/application/src/main/java/org/opentripplanner/model/transfer/ConstrainedTransfer.java +++ b/application/src/main/java/org/opentripplanner/model/transfer/ConstrainedTransfer.java @@ -3,9 +3,9 @@ import java.io.Serializable; import java.util.Objects; import javax.annotation.Nullable; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.raptor.api.model.RaptorConstrainedTransfer; import org.opentripplanner.transit.model.framework.FeedScopedId; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * A constrained transfer is a transfer which is restricted in one ore more ways by the transit data diff --git a/application/src/main/java/org/opentripplanner/model/transfer/RouteStopTransferPoint.java b/application/src/main/java/org/opentripplanner/model/transfer/RouteStopTransferPoint.java index 7b81f44c6a6..627d82f7ccd 100644 --- a/application/src/main/java/org/opentripplanner/model/transfer/RouteStopTransferPoint.java +++ b/application/src/main/java/org/opentripplanner/model/transfer/RouteStopTransferPoint.java @@ -1,9 +1,9 @@ package org.opentripplanner.model.transfer; import java.io.Serializable; -import org.opentripplanner.framework.tostring.ValueObjectToStringBuilder; import org.opentripplanner.transit.model.network.Route; import org.opentripplanner.transit.model.site.StopLocation; +import org.opentripplanner.utils.tostring.ValueObjectToStringBuilder; public final class RouteStopTransferPoint implements TransferPoint, Serializable { diff --git a/application/src/main/java/org/opentripplanner/model/transfer/StationTransferPoint.java b/application/src/main/java/org/opentripplanner/model/transfer/StationTransferPoint.java index 53219e7fbcc..4af961ff0f4 100644 --- a/application/src/main/java/org/opentripplanner/model/transfer/StationTransferPoint.java +++ b/application/src/main/java/org/opentripplanner/model/transfer/StationTransferPoint.java @@ -1,8 +1,8 @@ package org.opentripplanner.model.transfer; import java.io.Serializable; -import org.opentripplanner.framework.tostring.ValueObjectToStringBuilder; import org.opentripplanner.transit.model.site.Station; +import org.opentripplanner.utils.tostring.ValueObjectToStringBuilder; public final class StationTransferPoint implements TransferPoint, Serializable { diff --git a/application/src/main/java/org/opentripplanner/model/transfer/TransferConstraint.java b/application/src/main/java/org/opentripplanner/model/transfer/TransferConstraint.java index bc8dc4cd28f..e6509c7d8ca 100644 --- a/application/src/main/java/org/opentripplanner/model/transfer/TransferConstraint.java +++ b/application/src/main/java/org/opentripplanner/model/transfer/TransferConstraint.java @@ -10,9 +10,9 @@ import java.util.function.IntSupplier; import javax.annotation.Nullable; import org.opentripplanner.framework.application.OTPFeature; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.raptor.api.model.RaptorTransferConstraint; import org.opentripplanner.raptor.api.model.SearchDirection; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * This class holds transfer constraint information. diff --git a/application/src/main/java/org/opentripplanner/model/transfer/TripTransferPoint.java b/application/src/main/java/org/opentripplanner/model/transfer/TripTransferPoint.java index ca3359f27dd..5dd23269779 100644 --- a/application/src/main/java/org/opentripplanner/model/transfer/TripTransferPoint.java +++ b/application/src/main/java/org/opentripplanner/model/transfer/TripTransferPoint.java @@ -1,8 +1,8 @@ package org.opentripplanner.model.transfer; import java.io.Serializable; -import org.opentripplanner.framework.tostring.ValueObjectToStringBuilder; import org.opentripplanner.transit.model.timetable.Trip; +import org.opentripplanner.utils.tostring.ValueObjectToStringBuilder; public final class TripTransferPoint implements TransferPoint, Serializable { diff --git a/application/src/main/java/org/opentripplanner/netex/config/NetexFeedParameters.java b/application/src/main/java/org/opentripplanner/netex/config/NetexFeedParameters.java index 723c707ecf1..604a28b1ab5 100644 --- a/application/src/main/java/org/opentripplanner/netex/config/NetexFeedParameters.java +++ b/application/src/main/java/org/opentripplanner/netex/config/NetexFeedParameters.java @@ -11,8 +11,8 @@ import java.util.Objects; import java.util.Set; import java.util.regex.Pattern; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.graph_builder.model.DataSourceConfig; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * Parameters to configure the NETEX import. Se the generated build-config documentation or diff --git a/application/src/main/java/org/opentripplanner/netex/mapping/AuthorityToAgencyMapper.java b/application/src/main/java/org/opentripplanner/netex/mapping/AuthorityToAgencyMapper.java index ec466cc2e27..f954c3a4c24 100644 --- a/application/src/main/java/org/opentripplanner/netex/mapping/AuthorityToAgencyMapper.java +++ b/application/src/main/java/org/opentripplanner/netex/mapping/AuthorityToAgencyMapper.java @@ -2,10 +2,10 @@ import static org.opentripplanner.netex.mapping.support.NetexObjectDecorator.withOptional; -import org.opentripplanner.framework.lang.StringUtils; import org.opentripplanner.netex.mapping.support.FeedScopedIdFactory; import org.opentripplanner.transit.model.organization.Agency; import org.opentripplanner.transit.model.organization.AgencyBuilder; +import org.opentripplanner.utils.lang.StringUtils; import org.rutebanken.netex.model.Authority; /** diff --git a/application/src/main/java/org/opentripplanner/netex/mapping/MultilingualStringMapper.java b/application/src/main/java/org/opentripplanner/netex/mapping/MultilingualStringMapper.java index 0f0e2336bc7..668c9feea46 100644 --- a/application/src/main/java/org/opentripplanner/netex/mapping/MultilingualStringMapper.java +++ b/application/src/main/java/org/opentripplanner/netex/mapping/MultilingualStringMapper.java @@ -1,7 +1,7 @@ package org.opentripplanner.netex.mapping; import javax.annotation.Nullable; -import org.opentripplanner.framework.lang.StringUtils; +import org.opentripplanner.utils.lang.StringUtils; import org.rutebanken.netex.model.MultilingualString; public class MultilingualStringMapper { diff --git a/application/src/main/java/org/opentripplanner/netex/mapping/OperatorToAgencyMapper.java b/application/src/main/java/org/opentripplanner/netex/mapping/OperatorToAgencyMapper.java index f7bd2643769..b4cf9f3e4de 100644 --- a/application/src/main/java/org/opentripplanner/netex/mapping/OperatorToAgencyMapper.java +++ b/application/src/main/java/org/opentripplanner/netex/mapping/OperatorToAgencyMapper.java @@ -1,10 +1,10 @@ package org.opentripplanner.netex.mapping; -import org.opentripplanner.framework.lang.StringUtils; import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.netex.mapping.support.FeedScopedIdFactory; import org.opentripplanner.transit.model.organization.Operator; import org.opentripplanner.transit.model.organization.OperatorBuilder; +import org.opentripplanner.utils.lang.StringUtils; import org.rutebanken.netex.model.ContactStructure; /** diff --git a/application/src/main/java/org/opentripplanner/osm/OsmProvider.java b/application/src/main/java/org/opentripplanner/osm/OsmProvider.java index 2569f666281..597fd516b0e 100644 --- a/application/src/main/java/org/opentripplanner/osm/OsmProvider.java +++ b/application/src/main/java/org/opentripplanner/osm/OsmProvider.java @@ -10,13 +10,13 @@ import org.opentripplanner.datastore.api.FileType; import org.opentripplanner.datastore.file.FileDataSource; import org.opentripplanner.framework.application.OtpFileNames; -import org.opentripplanner.framework.logging.ProgressTracker; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.graph_builder.module.osm.OsmDatabase; import org.opentripplanner.osm.tagmapping.OsmTagMapper; import org.opentripplanner.osm.tagmapping.OsmTagMapperSource; import org.opentripplanner.osm.wayproperty.WayPropertySet; +import org.opentripplanner.utils.logging.ProgressTracker; +import org.opentripplanner.utils.tostring.ToStringBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; 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 1cd08d9fcd5..00d275ec36a 100644 --- a/application/src/main/java/org/opentripplanner/osm/model/OsmWithTags.java +++ b/application/src/main/java/org/opentripplanner/osm/model/OsmWithTags.java @@ -15,11 +15,11 @@ import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.framework.i18n.NonLocalizedString; import org.opentripplanner.framework.i18n.TranslatedString; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.graph_builder.module.osm.OsmModule; import org.opentripplanner.osm.OsmProvider; import org.opentripplanner.street.model.StreetTraversalPermission; import org.opentripplanner.transit.model.basic.Accessibility; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * A base class for OSM entities containing common methods. diff --git a/application/src/main/java/org/opentripplanner/osm/wayproperty/specifier/BestMatchSpecifier.java b/application/src/main/java/org/opentripplanner/osm/wayproperty/specifier/BestMatchSpecifier.java index 1d03d74956e..94dbab99b26 100644 --- a/application/src/main/java/org/opentripplanner/osm/wayproperty/specifier/BestMatchSpecifier.java +++ b/application/src/main/java/org/opentripplanner/osm/wayproperty/specifier/BestMatchSpecifier.java @@ -2,8 +2,8 @@ import java.util.Arrays; import java.util.stream.Collectors; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.osm.model.OsmWithTags; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * Specifies a class of OSM tagged entities (e.g. ways) by a list of tags and their values (which diff --git a/application/src/main/java/org/opentripplanner/raptor/api/debug/DebugEvent.java b/application/src/main/java/org/opentripplanner/raptor/api/debug/DebugEvent.java index 7162a4a6641..a69e977efe3 100644 --- a/application/src/main/java/org/opentripplanner/raptor/api/debug/DebugEvent.java +++ b/application/src/main/java/org/opentripplanner/raptor/api/debug/DebugEvent.java @@ -1,6 +1,6 @@ package org.opentripplanner.raptor.api.debug; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * Debug events hold information about an internal event in the Raptor Algorithm. The element may be diff --git a/application/src/main/java/org/opentripplanner/raptor/api/model/GeneralizedCostRelaxFunction.java b/application/src/main/java/org/opentripplanner/raptor/api/model/GeneralizedCostRelaxFunction.java index 0335e962d98..0038a8e2681 100644 --- a/application/src/main/java/org/opentripplanner/raptor/api/model/GeneralizedCostRelaxFunction.java +++ b/application/src/main/java/org/opentripplanner/raptor/api/model/GeneralizedCostRelaxFunction.java @@ -3,8 +3,8 @@ import java.time.Duration; import java.util.Locale; import java.util.Objects; -import org.opentripplanner.framework.lang.IntUtils; -import org.opentripplanner.framework.lang.OtpNumberFormat; +import org.opentripplanner.utils.lang.IntUtils; +import org.opentripplanner.utils.lang.OtpNumberFormat; /** * This relax-function is used to relax increasing values by: diff --git a/application/src/main/java/org/opentripplanner/raptor/api/model/RaptorAccessEgress.java b/application/src/main/java/org/opentripplanner/raptor/api/model/RaptorAccessEgress.java index 3a7f48cf743..f970254dcc8 100644 --- a/application/src/main/java/org/opentripplanner/raptor/api/model/RaptorAccessEgress.java +++ b/application/src/main/java/org/opentripplanner/raptor/api/model/RaptorAccessEgress.java @@ -4,8 +4,8 @@ import java.time.temporal.ChronoUnit; import javax.annotation.Nullable; -import org.opentripplanner.framework.time.DurationUtils; -import org.opentripplanner.framework.time.TimeUtils; +import org.opentripplanner.utils.time.DurationUtils; +import org.opentripplanner.utils.time.TimeUtils; /** * Encapsulate information about an access or egress path. We do not distinguish between diff --git a/application/src/main/java/org/opentripplanner/raptor/api/model/RaptorTransfer.java b/application/src/main/java/org/opentripplanner/raptor/api/model/RaptorTransfer.java index 856d6828b30..477c785eaa4 100644 --- a/application/src/main/java/org/opentripplanner/raptor/api/model/RaptorTransfer.java +++ b/application/src/main/java/org/opentripplanner/raptor/api/model/RaptorTransfer.java @@ -1,6 +1,6 @@ package org.opentripplanner.raptor.api.model; -import org.opentripplanner.framework.time.DurationUtils; +import org.opentripplanner.utils.time.DurationUtils; /** * Encapsulate information about a transfer path. diff --git a/application/src/main/java/org/opentripplanner/raptor/api/path/PathLeg.java b/application/src/main/java/org/opentripplanner/raptor/api/path/PathLeg.java index 35a351a4d77..20ffdbae34a 100644 --- a/application/src/main/java/org/opentripplanner/raptor/api/path/PathLeg.java +++ b/application/src/main/java/org/opentripplanner/raptor/api/path/PathLeg.java @@ -4,9 +4,9 @@ import java.util.stream.Stream; import java.util.stream.StreamSupport; import javax.annotation.Nullable; -import org.opentripplanner.framework.time.DurationUtils; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; +import org.opentripplanner.utils.time.DurationUtils; +import org.opentripplanner.utils.time.TimeUtils; /** * A leg in a Raptor path. The legs are linked together from the first leg {@link AccessPathLeg}, to diff --git a/application/src/main/java/org/opentripplanner/raptor/api/path/PathStringBuilder.java b/application/src/main/java/org/opentripplanner/raptor/api/path/PathStringBuilder.java index da56474ae02..cefba73f41f 100644 --- a/application/src/main/java/org/opentripplanner/raptor/api/path/PathStringBuilder.java +++ b/application/src/main/java/org/opentripplanner/raptor/api/path/PathStringBuilder.java @@ -3,13 +3,13 @@ import java.time.ZonedDateTime; import java.util.function.Consumer; import javax.annotation.Nullable; -import org.opentripplanner.framework.time.DurationUtils; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.raptor.api.model.RaptorAccessEgress; import org.opentripplanner.raptor.api.model.RaptorConstants; import org.opentripplanner.raptor.api.model.RaptorStopNameResolver; import org.opentripplanner.raptor.api.model.RaptorValueFormatter; import org.opentripplanner.raptor.spi.RaptorCostCalculator; +import org.opentripplanner.utils.time.DurationUtils; +import org.opentripplanner.utils.time.TimeUtils; /** * Create a path like: {@code Walk 5m - 101 - Transit 10:07 10:35 - 2111 - Walk 4m } diff --git a/application/src/main/java/org/opentripplanner/raptor/api/request/DebugRequest.java b/application/src/main/java/org/opentripplanner/raptor/api/request/DebugRequest.java index 876175bae6e..91144d86917 100644 --- a/application/src/main/java/org/opentripplanner/raptor/api/request/DebugRequest.java +++ b/application/src/main/java/org/opentripplanner/raptor/api/request/DebugRequest.java @@ -3,12 +3,12 @@ import java.util.List; import java.util.Objects; import java.util.function.Consumer; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.raptor.api.debug.DebugEvent; import org.opentripplanner.raptor.api.debug.DebugLogger; import org.opentripplanner.raptor.api.path.RaptorPath; import org.opentripplanner.raptor.api.view.ArrivalView; import org.opentripplanner.raptor.api.view.PatternRideView; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * This class configure the amount of debugging you want for your request. Debugging is supported by diff --git a/application/src/main/java/org/opentripplanner/raptor/api/request/MultiCriteriaRequest.java b/application/src/main/java/org/opentripplanner/raptor/api/request/MultiCriteriaRequest.java index 683c9807af5..7f0da11b558 100644 --- a/application/src/main/java/org/opentripplanner/raptor/api/request/MultiCriteriaRequest.java +++ b/application/src/main/java/org/opentripplanner/raptor/api/request/MultiCriteriaRequest.java @@ -4,9 +4,9 @@ import java.util.Objects; import java.util.Optional; import javax.annotation.Nullable; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; import org.opentripplanner.raptor.api.model.RelaxFunction; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * Parameters to configure the multi-criteria search. diff --git a/application/src/main/java/org/opentripplanner/raptor/api/request/PassThroughPoint.java b/application/src/main/java/org/opentripplanner/raptor/api/request/PassThroughPoint.java index 187436907fe..7c529343b32 100644 --- a/application/src/main/java/org/opentripplanner/raptor/api/request/PassThroughPoint.java +++ b/application/src/main/java/org/opentripplanner/raptor/api/request/PassThroughPoint.java @@ -6,7 +6,7 @@ import java.util.function.IntFunction; import java.util.stream.IntStream; import javax.annotation.Nullable; -import org.opentripplanner.framework.lang.StringUtils; +import org.opentripplanner.utils.lang.StringUtils; /** * A collection of stop indexes used to define a pass through-point. diff --git a/application/src/main/java/org/opentripplanner/raptor/api/request/RaptorRequest.java b/application/src/main/java/org/opentripplanner/raptor/api/request/RaptorRequest.java index 010bff4bc08..3c27f5478c8 100644 --- a/application/src/main/java/org/opentripplanner/raptor/api/request/RaptorRequest.java +++ b/application/src/main/java/org/opentripplanner/raptor/api/request/RaptorRequest.java @@ -4,10 +4,10 @@ import java.util.Collections; import java.util.Objects; import java.util.Set; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.raptor.api.debug.RaptorTimers; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; import org.opentripplanner.raptor.api.model.SearchDirection; +import org.opentripplanner.utils.tostring.ToStringBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/raptor/api/request/RaptorViaConnection.java b/application/src/main/java/org/opentripplanner/raptor/api/request/RaptorViaConnection.java index 45dc5394188..a8359e6c5fa 100644 --- a/application/src/main/java/org/opentripplanner/raptor/api/request/RaptorViaConnection.java +++ b/application/src/main/java/org/opentripplanner/raptor/api/request/RaptorViaConnection.java @@ -2,10 +2,10 @@ import java.util.Objects; import javax.annotation.Nullable; -import org.opentripplanner.framework.time.DurationUtils; import org.opentripplanner.raptor.api.model.RaptorConstants; import org.opentripplanner.raptor.api.model.RaptorStopNameResolver; import org.opentripplanner.raptor.api.model.RaptorTransfer; +import org.opentripplanner.utils.time.DurationUtils; /** * A via-connection is used to define one of the physical locations in a via location Raptor must diff --git a/application/src/main/java/org/opentripplanner/raptor/api/request/RaptorViaLocation.java b/application/src/main/java/org/opentripplanner/raptor/api/request/RaptorViaLocation.java index ae7ea19d20d..fbaae6dabdc 100644 --- a/application/src/main/java/org/opentripplanner/raptor/api/request/RaptorViaLocation.java +++ b/application/src/main/java/org/opentripplanner/raptor/api/request/RaptorViaLocation.java @@ -5,11 +5,11 @@ import java.util.List; import java.util.Objects; import javax.annotation.Nullable; -import org.opentripplanner.framework.lang.IntUtils; -import org.opentripplanner.framework.time.DurationUtils; import org.opentripplanner.raptor.api.model.RaptorConstants; import org.opentripplanner.raptor.api.model.RaptorStopNameResolver; import org.opentripplanner.raptor.api.model.RaptorTransfer; +import org.opentripplanner.utils.lang.IntUtils; +import org.opentripplanner.utils.time.DurationUtils; /** * Defines a via location which Raptor will force the path through. The concrete location is diff --git a/application/src/main/java/org/opentripplanner/raptor/api/request/SearchParams.java b/application/src/main/java/org/opentripplanner/raptor/api/request/SearchParams.java index 6ba51319a29..d43d0f11ab6 100644 --- a/application/src/main/java/org/opentripplanner/raptor/api/request/SearchParams.java +++ b/application/src/main/java/org/opentripplanner/raptor/api/request/SearchParams.java @@ -5,10 +5,10 @@ import java.util.Collection; import java.util.List; import java.util.Objects; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.raptor.api.model.RaptorAccessEgress; import org.opentripplanner.raptor.api.model.RaptorConstants; import org.opentripplanner.raptor.api.model.RaptorTransfer; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * The responsibility of this class is to encapsulate a Range Raptor travel request search diff --git a/application/src/main/java/org/opentripplanner/raptor/api/request/SearchParamsBuilder.java b/application/src/main/java/org/opentripplanner/raptor/api/request/SearchParamsBuilder.java index 7db4ce5d0f7..cdb7146e814 100644 --- a/application/src/main/java/org/opentripplanner/raptor/api/request/SearchParamsBuilder.java +++ b/application/src/main/java/org/opentripplanner/raptor/api/request/SearchParamsBuilder.java @@ -5,10 +5,10 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.raptor.api.model.RaptorAccessEgress; import org.opentripplanner.raptor.api.model.RaptorConstants; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * Mutable version of {@link SearchParams}. diff --git a/application/src/main/java/org/opentripplanner/raptor/api/response/RaptorResponse.java b/application/src/main/java/org/opentripplanner/raptor/api/response/RaptorResponse.java index 82c0c06d0cd..5b0f1885a85 100644 --- a/application/src/main/java/org/opentripplanner/raptor/api/response/RaptorResponse.java +++ b/application/src/main/java/org/opentripplanner/raptor/api/response/RaptorResponse.java @@ -1,11 +1,11 @@ package org.opentripplanner.raptor.api.response; import java.util.Collection; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.raptor.RaptorService; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; import org.opentripplanner.raptor.api.path.RaptorPath; import org.opentripplanner.raptor.api.request.RaptorRequest; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * This is the result of a raptor search including the result paths, the original request diff --git a/application/src/main/java/org/opentripplanner/raptor/api/view/ArrivalView.java b/application/src/main/java/org/opentripplanner/raptor/api/view/ArrivalView.java index 2dffbbe5733..83e46f2d78f 100644 --- a/application/src/main/java/org/opentripplanner/raptor/api/view/ArrivalView.java +++ b/application/src/main/java/org/opentripplanner/raptor/api/view/ArrivalView.java @@ -2,7 +2,6 @@ import java.util.function.IntFunction; import javax.annotation.Nullable; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.raptor.api.model.PathLegType; import org.opentripplanner.raptor.api.model.RaptorConstants; import org.opentripplanner.raptor.api.model.RaptorTransfer; @@ -10,6 +9,7 @@ import org.opentripplanner.raptor.api.model.RaptorValueFormatter; import org.opentripplanner.raptor.api.model.TransitArrival; import org.opentripplanner.raptor.spi.RaptorCostCalculator; +import org.opentripplanner.utils.time.TimeUtils; /** * The purpose of the stop-arrival-view is to provide a common interface for stop-arrivals for diff --git a/application/src/main/java/org/opentripplanner/raptor/path/PathBuilderLeg.java b/application/src/main/java/org/opentripplanner/raptor/path/PathBuilderLeg.java index 335d38203b1..eb80b36316b 100644 --- a/application/src/main/java/org/opentripplanner/raptor/path/PathBuilderLeg.java +++ b/application/src/main/java/org/opentripplanner/raptor/path/PathBuilderLeg.java @@ -2,7 +2,6 @@ import java.util.function.Predicate; import javax.annotation.Nullable; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.raptor.api.model.RaptorAccessEgress; import org.opentripplanner.raptor.api.model.RaptorConstants; import org.opentripplanner.raptor.api.model.RaptorConstrainedTransfer; @@ -22,6 +21,7 @@ import org.opentripplanner.raptor.spi.BoardAndAlightTime; import org.opentripplanner.raptor.spi.RaptorCostCalculator; import org.opentripplanner.raptor.spi.RaptorSlackProvider; +import org.opentripplanner.utils.time.TimeUtils; /** * This is the leg implementation for the {@link PathBuilder}. It helps to cache and calculate diff --git a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/SystemErrDebugLogger.java b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/SystemErrDebugLogger.java index 951721f81a7..c80d226afc7 100644 --- a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/SystemErrDebugLogger.java +++ b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/SystemErrDebugLogger.java @@ -1,22 +1,17 @@ package org.opentripplanner.raptor.rangeraptor; -import static org.opentripplanner.framework.text.Table.Align.Center; -import static org.opentripplanner.framework.text.Table.Align.Left; -import static org.opentripplanner.framework.text.Table.Align.Right; -import static org.opentripplanner.framework.time.TimeUtils.timeToStrCompact; -import static org.opentripplanner.framework.time.TimeUtils.timeToStrLong; import static org.opentripplanner.raptor.api.model.PathLegType.ACCESS; import static org.opentripplanner.raptor.api.model.PathLegType.TRANSIT; +import static org.opentripplanner.utils.text.Table.Align.Center; +import static org.opentripplanner.utils.text.Table.Align.Left; +import static org.opentripplanner.utils.text.Table.Align.Right; +import static org.opentripplanner.utils.time.TimeUtils.timeToStrCompact; +import static org.opentripplanner.utils.time.TimeUtils.timeToStrLong; import java.text.NumberFormat; import java.util.Locale; import java.util.function.Consumer; import javax.annotation.Nullable; -import org.opentripplanner.framework.lang.IntUtils; -import org.opentripplanner.framework.lang.OtpNumberFormat; -import org.opentripplanner.framework.lang.StringUtils; -import org.opentripplanner.framework.text.Table; -import org.opentripplanner.framework.time.DurationUtils; import org.opentripplanner.raptor.api.debug.DebugEvent; import org.opentripplanner.raptor.api.debug.DebugLogger; import org.opentripplanner.raptor.api.debug.DebugTopic; @@ -26,6 +21,11 @@ import org.opentripplanner.raptor.api.view.ArrivalView; import org.opentripplanner.raptor.api.view.PatternRideView; import org.opentripplanner.raptor.rangeraptor.transit.TripTimesSearch; +import org.opentripplanner.utils.lang.IntUtils; +import org.opentripplanner.utils.lang.OtpNumberFormat; +import org.opentripplanner.utils.lang.StringUtils; +import org.opentripplanner.utils.text.Table; +import org.opentripplanner.utils.time.DurationUtils; /** * A debug logger which can be plugged into Raptor to do debug logging to standard error. This is diff --git a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/internalapi/HeuristicAtStop.java b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/internalapi/HeuristicAtStop.java index b58d773969c..da07c643fb6 100644 --- a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/internalapi/HeuristicAtStop.java +++ b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/internalapi/HeuristicAtStop.java @@ -1,8 +1,8 @@ package org.opentripplanner.raptor.rangeraptor.internalapi; -import org.opentripplanner.framework.lang.OtpNumberFormat; -import org.opentripplanner.framework.time.DurationUtils; import org.opentripplanner.raptor.api.model.RaptorConstants; +import org.opentripplanner.utils.lang.OtpNumberFormat; +import org.opentripplanner.utils.time.DurationUtils; /** * Heuristic data for a given stop. diff --git a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/multicriteria/ride/c1/PatternRideC1.java b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/multicriteria/ride/c1/PatternRideC1.java index cbb3fbfadf3..fd669e40ffc 100644 --- a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/multicriteria/ride/c1/PatternRideC1.java +++ b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/multicriteria/ride/c1/PatternRideC1.java @@ -1,12 +1,12 @@ package org.opentripplanner.raptor.rangeraptor.multicriteria.ride.c1; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; import org.opentripplanner.raptor.rangeraptor.multicriteria.arrivals.McStopArrival; import org.opentripplanner.raptor.rangeraptor.multicriteria.ride.PatternRide; import org.opentripplanner.raptor.rangeraptor.multicriteria.ride.PatternRideFactory; import org.opentripplanner.raptor.spi.RaptorCostCalculator; import org.opentripplanner.raptor.util.paretoset.ParetoComparator; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * A {@link PatternRide} with support for c1 {@code generalized-cost}. diff --git a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/multicriteria/ride/c2/PassThroughRideFactory.java b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/multicriteria/ride/c2/PassThroughRideFactory.java index 6120ae9d698..734766666c5 100644 --- a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/multicriteria/ride/c2/PassThroughRideFactory.java +++ b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/multicriteria/ride/c2/PassThroughRideFactory.java @@ -1,10 +1,10 @@ package org.opentripplanner.raptor.rangeraptor.multicriteria.ride.c2; -import org.opentripplanner.framework.lang.IntBox; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; import org.opentripplanner.raptor.rangeraptor.internalapi.PassThroughPointsService; import org.opentripplanner.raptor.rangeraptor.multicriteria.arrivals.McStopArrival; import org.opentripplanner.raptor.rangeraptor.multicriteria.ride.PatternRideFactory; +import org.opentripplanner.utils.lang.IntBox; public class PassThroughRideFactory implements PatternRideFactory> { diff --git a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/multicriteria/ride/c2/PatternRideC2.java b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/multicriteria/ride/c2/PatternRideC2.java index d02bef207c2..a23999f1813 100644 --- a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/multicriteria/ride/c2/PatternRideC2.java +++ b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/multicriteria/ride/c2/PatternRideC2.java @@ -1,11 +1,11 @@ package org.opentripplanner.raptor.rangeraptor.multicriteria.ride.c2; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.raptor.api.model.DominanceFunction; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; import org.opentripplanner.raptor.rangeraptor.multicriteria.arrivals.McStopArrival; import org.opentripplanner.raptor.rangeraptor.multicriteria.ride.PatternRide; import org.opentripplanner.raptor.util.paretoset.ParetoComparator; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * A {@link PatternRide} with support for c1 {@code generalized-cost} and c2 (custom-use-case-cost). diff --git a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/path/DestinationArrivalPaths.java b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/path/DestinationArrivalPaths.java index 78dc7da4967..2f257e52645 100644 --- a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/path/DestinationArrivalPaths.java +++ b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/path/DestinationArrivalPaths.java @@ -5,8 +5,6 @@ import java.util.Optional; import java.util.function.IntPredicate; import javax.annotation.Nullable; -import org.opentripplanner.framework.lang.OtpNumberFormat; -import org.opentripplanner.framework.logging.Throttle; import org.opentripplanner.raptor.api.model.RaptorAccessEgress; import org.opentripplanner.raptor.api.model.RaptorConstants; import org.opentripplanner.raptor.api.model.RaptorStopNameResolver; @@ -22,6 +20,8 @@ import org.opentripplanner.raptor.spi.RaptorCostCalculator; import org.opentripplanner.raptor.util.paretoset.ParetoComparator; import org.opentripplanner.raptor.util.paretoset.ParetoSet; +import org.opentripplanner.utils.lang.OtpNumberFormat; +import org.opentripplanner.utils.logging.Throttle; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/standard/MinTravelDurationRoutingStrategy.java b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/standard/MinTravelDurationRoutingStrategy.java index 0e18729b97e..f68299a0a13 100644 --- a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/standard/MinTravelDurationRoutingStrategy.java +++ b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/standard/MinTravelDurationRoutingStrategy.java @@ -2,7 +2,6 @@ import static org.opentripplanner.raptor.spi.RaptorTripScheduleSearch.UNBOUNDED_TRIP_INDEX; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.raptor.api.model.RaptorAccessEgress; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; import org.opentripplanner.raptor.rangeraptor.internalapi.RoutingStrategy; @@ -12,6 +11,7 @@ import org.opentripplanner.raptor.spi.RaptorBoardOrAlightEvent; import org.opentripplanner.raptor.spi.RaptorConstrainedBoardingSearch; import org.opentripplanner.raptor.spi.RaptorRoute; +import org.opentripplanner.utils.time.TimeUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/standard/besttimes/BestTimes.java b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/standard/besttimes/BestTimes.java index 3807b26b6c6..296325e9022 100644 --- a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/standard/besttimes/BestTimes.java +++ b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/standard/besttimes/BestTimes.java @@ -1,14 +1,14 @@ package org.opentripplanner.raptor.rangeraptor.standard.besttimes; -import static org.opentripplanner.framework.lang.IntUtils.intArray; +import static org.opentripplanner.utils.lang.IntUtils.intArray; import java.util.BitSet; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.raptor.rangeraptor.internalapi.SingleCriteriaStopArrivals; import org.opentripplanner.raptor.rangeraptor.internalapi.WorkerLifeCycle; import org.opentripplanner.raptor.rangeraptor.support.IntArraySingleCriteriaArrivals; import org.opentripplanner.raptor.rangeraptor.transit.TransitCalculator; import org.opentripplanner.raptor.util.BitSetIterator; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * This class is responsible for keeping track of the overall best times and the best "on-board" diff --git a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/standard/besttimes/SimpleBestNumberOfTransfers.java b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/standard/besttimes/SimpleBestNumberOfTransfers.java index 22b0f44a579..f529ce31e20 100644 --- a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/standard/besttimes/SimpleBestNumberOfTransfers.java +++ b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/standard/besttimes/SimpleBestNumberOfTransfers.java @@ -1,10 +1,10 @@ package org.opentripplanner.raptor.rangeraptor.standard.besttimes; -import org.opentripplanner.framework.lang.IntUtils; import org.opentripplanner.raptor.rangeraptor.internalapi.SingleCriteriaStopArrivals; import org.opentripplanner.raptor.rangeraptor.internalapi.WorkerLifeCycle; import org.opentripplanner.raptor.rangeraptor.standard.internalapi.BestNumberOfTransfers; import org.opentripplanner.raptor.rangeraptor.support.IntArraySingleCriteriaArrivals; +import org.opentripplanner.utils.lang.IntUtils; /** * The responsibility for this class is to keep track of the best (minimun) number of transfers for diff --git a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/standard/heuristics/HeuristicsAdapter.java b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/standard/heuristics/HeuristicsAdapter.java index 3dbff516347..00cce39622d 100644 --- a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/standard/heuristics/HeuristicsAdapter.java +++ b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/standard/heuristics/HeuristicsAdapter.java @@ -4,9 +4,6 @@ import java.util.Arrays; import java.util.List; import java.util.function.IntUnaryOperator; -import org.opentripplanner.framework.lang.IntUtils; -import org.opentripplanner.framework.time.TimeUtils; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.raptor.api.model.RaptorAccessEgress; import org.opentripplanner.raptor.rangeraptor.internalapi.HeuristicAtStop; import org.opentripplanner.raptor.rangeraptor.internalapi.Heuristics; @@ -15,6 +12,9 @@ import org.opentripplanner.raptor.rangeraptor.transit.RaptorTransitCalculator; import org.opentripplanner.raptor.rangeraptor.transit.TransitCalculator; import org.opentripplanner.raptor.spi.RaptorCostCalculator; +import org.opentripplanner.utils.lang.IntUtils; +import org.opentripplanner.utils.time.TimeUtils; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * The responsibility of this class is to play the {@link Heuristics} role. It wrap the internal diff --git a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/standard/stoparrivals/AccessStopArrivalState.java b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/standard/stoparrivals/AccessStopArrivalState.java index 867707be215..62f708d1899 100644 --- a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/standard/stoparrivals/AccessStopArrivalState.java +++ b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/standard/stoparrivals/AccessStopArrivalState.java @@ -1,9 +1,9 @@ package org.opentripplanner.raptor.rangeraptor.standard.stoparrivals; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.raptor.api.model.RaptorAccessEgress; import org.opentripplanner.raptor.api.model.RaptorTransfer; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * This class is responsible for adding access functionality, which the {@link diff --git a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/standard/stoparrivals/DefaultStopArrivalState.java b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/standard/stoparrivals/DefaultStopArrivalState.java index 6df63b37d16..b76b0560791 100644 --- a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/standard/stoparrivals/DefaultStopArrivalState.java +++ b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/standard/stoparrivals/DefaultStopArrivalState.java @@ -1,9 +1,9 @@ package org.opentripplanner.raptor.rangeraptor.standard.stoparrivals; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.raptor.api.model.RaptorAccessEgress; import org.opentripplanner.raptor.api.model.RaptorTransfer; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * The main purpose of this class is to hold data for a given arrival at a stop and raptor round. It diff --git a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/standard/stoparrivals/EgressStopArrivalState.java b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/standard/stoparrivals/EgressStopArrivalState.java index f546e358ad8..c002f57dcba 100644 --- a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/standard/stoparrivals/EgressStopArrivalState.java +++ b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/standard/stoparrivals/EgressStopArrivalState.java @@ -2,11 +2,11 @@ import java.util.Collection; import java.util.List; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.raptor.api.model.RaptorAccessEgress; import org.opentripplanner.raptor.api.model.RaptorTransfer; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; import org.opentripplanner.raptor.rangeraptor.standard.internalapi.DestinationArrivalListener; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * The egress stop arrival state is responsible for sending arrival notifications. This is used to diff --git a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/standard/stoparrivals/path/EgressArrivalToPathAdapter.java b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/standard/stoparrivals/path/EgressArrivalToPathAdapter.java index b52e0d854da..a5d39d2eca9 100644 --- a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/standard/stoparrivals/path/EgressArrivalToPathAdapter.java +++ b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/standard/stoparrivals/path/EgressArrivalToPathAdapter.java @@ -4,8 +4,6 @@ import java.util.ArrayList; import java.util.List; -import org.opentripplanner.framework.time.TimeUtils; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.raptor.api.model.RaptorAccessEgress; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; import org.opentripplanner.raptor.api.view.ArrivalView; @@ -16,6 +14,8 @@ import org.opentripplanner.raptor.rangeraptor.standard.internalapi.DestinationArrivalListener; import org.opentripplanner.raptor.rangeraptor.standard.stoparrivals.view.StopsCursor; import org.opentripplanner.raptor.rangeraptor.transit.TransitCalculator; +import org.opentripplanner.utils.time.TimeUtils; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * The responsibility of this class is to listen for egress stop arrivals and forward these as diff --git a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/transit/ForwardRaptorTransitCalculator.java b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/transit/ForwardRaptorTransitCalculator.java index 5c50aa030f5..20dda7a3b37 100644 --- a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/transit/ForwardRaptorTransitCalculator.java +++ b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/transit/ForwardRaptorTransitCalculator.java @@ -1,7 +1,6 @@ package org.opentripplanner.raptor.rangeraptor.transit; import java.util.Iterator; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.raptor.api.model.RaptorConstants; import org.opentripplanner.raptor.api.model.RaptorTransfer; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; @@ -14,6 +13,7 @@ import org.opentripplanner.raptor.spi.RaptorTransitDataProvider; import org.opentripplanner.raptor.spi.RaptorTripScheduleSearch; import org.opentripplanner.raptor.util.IntIterators; +import org.opentripplanner.utils.time.TimeUtils; public final class ForwardRaptorTransitCalculator extends ForwardTransitCalculator diff --git a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/transit/RaptorTransitCalculator.java b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/transit/RaptorTransitCalculator.java index af9cff110d0..141c71ee86c 100644 --- a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/transit/RaptorTransitCalculator.java +++ b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/transit/RaptorTransitCalculator.java @@ -1,7 +1,7 @@ package org.opentripplanner.raptor.rangeraptor.transit; -import static org.opentripplanner.framework.time.TimeUtils.hm2time; import static org.opentripplanner.raptor.api.model.RaptorConstants.TIME_NOT_SET; +import static org.opentripplanner.utils.time.TimeUtils.hm2time; import java.util.Iterator; import org.opentripplanner.raptor.api.model.RaptorAccessEgress; diff --git a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/transit/ReverseRaptorTransitCalculator.java b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/transit/ReverseRaptorTransitCalculator.java index 09ded9fb4b7..1229c8d85ff 100644 --- a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/transit/ReverseRaptorTransitCalculator.java +++ b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/transit/ReverseRaptorTransitCalculator.java @@ -1,7 +1,6 @@ package org.opentripplanner.raptor.rangeraptor.transit; import java.util.Iterator; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.raptor.api.model.RaptorConstants; import org.opentripplanner.raptor.api.model.RaptorTransfer; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; @@ -14,6 +13,7 @@ import org.opentripplanner.raptor.spi.RaptorTransitDataProvider; import org.opentripplanner.raptor.spi.RaptorTripScheduleSearch; import org.opentripplanner.raptor.util.IntIterators; +import org.opentripplanner.utils.time.TimeUtils; public final class ReverseRaptorTransitCalculator extends ReverseTransitCalculator diff --git a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/transit/TripScheduleExactMatchSearch.java b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/transit/TripScheduleExactMatchSearch.java index 666cf95f31e..1db6b2de055 100644 --- a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/transit/TripScheduleExactMatchSearch.java +++ b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/transit/TripScheduleExactMatchSearch.java @@ -1,9 +1,9 @@ package org.opentripplanner.raptor.rangeraptor.transit; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; import org.opentripplanner.raptor.spi.RaptorBoardOrAlightEvent; import org.opentripplanner.raptor.spi.RaptorTripScheduleSearch; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * This trip search will only match trips that is within the given slack of the timeLimit. diff --git a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/transit/TripTimesSearch.java b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/transit/TripTimesSearch.java index 83bfbe16481..94dfa83ad80 100644 --- a/application/src/main/java/org/opentripplanner/raptor/rangeraptor/transit/TripTimesSearch.java +++ b/application/src/main/java/org/opentripplanner/raptor/rangeraptor/transit/TripTimesSearch.java @@ -1,10 +1,10 @@ package org.opentripplanner.raptor.rangeraptor.transit; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.raptor.api.model.RaptorTripPattern; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; import org.opentripplanner.raptor.api.view.ArrivalView; import org.opentripplanner.raptor.spi.BoardAndAlightTime; +import org.opentripplanner.utils.time.TimeUtils; /** * This class is used to find the board and alight time for a known trip, where you now the diff --git a/application/src/main/java/org/opentripplanner/raptor/service/DebugHeuristics.java b/application/src/main/java/org/opentripplanner/raptor/service/DebugHeuristics.java index bb4241bb2ae..f4c2c141f04 100644 --- a/application/src/main/java/org/opentripplanner/raptor/service/DebugHeuristics.java +++ b/application/src/main/java/org/opentripplanner/raptor/service/DebugHeuristics.java @@ -5,13 +5,13 @@ import static org.opentripplanner.raptor.api.model.RaptorConstants.N_TRANSFERS_UNREACHED; import static org.opentripplanner.raptor.api.model.RaptorConstants.UNREACHED_HIGH; -import org.opentripplanner.framework.lang.IntUtils; import org.opentripplanner.raptor.api.debug.DebugLogger; import org.opentripplanner.raptor.api.model.SearchDirection; import org.opentripplanner.raptor.api.request.DebugRequest; import org.opentripplanner.raptor.api.request.RaptorRequest; import org.opentripplanner.raptor.rangeraptor.internalapi.Heuristics; import org.opentripplanner.raptor.util.CompareIntArrays; +import org.opentripplanner.utils.lang.IntUtils; /** * Utility class to log computed heuristic data. diff --git a/application/src/main/java/org/opentripplanner/raptor/service/HeuristicSearchTask.java b/application/src/main/java/org/opentripplanner/raptor/service/HeuristicSearchTask.java index 7c0158d2192..e31f8852ad6 100644 --- a/application/src/main/java/org/opentripplanner/raptor/service/HeuristicSearchTask.java +++ b/application/src/main/java/org/opentripplanner/raptor/service/HeuristicSearchTask.java @@ -3,7 +3,6 @@ import static org.opentripplanner.raptor.api.request.RaptorProfile.MIN_TRAVEL_DURATION; import javax.annotation.Nullable; -import org.opentripplanner.framework.time.DurationUtils; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; import org.opentripplanner.raptor.api.model.SearchDirection; import org.opentripplanner.raptor.api.request.RaptorRequest; @@ -12,6 +11,7 @@ import org.opentripplanner.raptor.rangeraptor.internalapi.Heuristics; import org.opentripplanner.raptor.rangeraptor.internalapi.RaptorRouterResult; import org.opentripplanner.raptor.spi.RaptorTransitDataProvider; +import org.opentripplanner.utils.time.DurationUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/raptor/spi/BoardAndAlightTime.java b/application/src/main/java/org/opentripplanner/raptor/spi/BoardAndAlightTime.java index 9c0f8264511..c90e67934a8 100644 --- a/application/src/main/java/org/opentripplanner/raptor/spi/BoardAndAlightTime.java +++ b/application/src/main/java/org/opentripplanner/raptor/spi/BoardAndAlightTime.java @@ -1,9 +1,9 @@ package org.opentripplanner.raptor.spi; import java.util.Objects; -import org.opentripplanner.framework.time.DurationUtils; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; +import org.opentripplanner.utils.time.DurationUtils; +import org.opentripplanner.utils.time.TimeUtils; /** * Board and alight time tuple value object. diff --git a/application/src/main/java/org/opentripplanner/raptor/util/CompareIntArrays.java b/application/src/main/java/org/opentripplanner/raptor/util/CompareIntArrays.java index 9bff831a670..1f446fe036c 100644 --- a/application/src/main/java/org/opentripplanner/raptor/util/CompareIntArrays.java +++ b/application/src/main/java/org/opentripplanner/raptor/util/CompareIntArrays.java @@ -2,7 +2,7 @@ import java.util.Comparator; import java.util.function.IntFunction; -import org.opentripplanner.framework.time.TimeUtils; +import org.opentripplanner.utils.time.TimeUtils; /** * The responsibility of this class is to compare two int arrays and list all elements that differ. diff --git a/application/src/main/java/org/opentripplanner/routing/TripTimeOnDateHelper.java b/application/src/main/java/org/opentripplanner/routing/TripTimeOnDateHelper.java index 72665edf657..f2806d0a1f2 100644 --- a/application/src/main/java/org/opentripplanner/routing/TripTimeOnDateHelper.java +++ b/application/src/main/java/org/opentripplanner/routing/TripTimeOnDateHelper.java @@ -4,13 +4,13 @@ import java.time.LocalDate; import java.util.ArrayList; import java.util.List; -import org.opentripplanner.framework.time.ServiceDateUtils; import org.opentripplanner.model.Timetable; import org.opentripplanner.model.TripTimeOnDate; import org.opentripplanner.transit.model.network.TripPattern; import org.opentripplanner.transit.model.timetable.Trip; import org.opentripplanner.transit.model.timetable.TripTimes; import org.opentripplanner.transit.service.TransitService; +import org.opentripplanner.utils.time.ServiceDateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/RoutingWorker.java b/application/src/main/java/org/opentripplanner/routing/algorithm/RoutingWorker.java index 1e2dd3f2d4e..e0b06eab561 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/RoutingWorker.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/RoutingWorker.java @@ -14,7 +14,6 @@ import javax.annotation.Nullable; import org.opentripplanner.framework.application.OTPFeature; import org.opentripplanner.framework.application.OTPRequestTimeoutException; -import org.opentripplanner.framework.time.ServiceDateUtils; import org.opentripplanner.model.plan.Itinerary; import org.opentripplanner.model.plan.grouppriority.TransitGroupPriorityItineraryDecorator; import org.opentripplanner.model.plan.paging.cursor.PageCursorInput; @@ -38,6 +37,7 @@ import org.opentripplanner.service.paging.PagingService; import org.opentripplanner.standalone.api.OtpServerRequestContext; import org.opentripplanner.transit.model.network.grouppriority.TransitGroupPriorityService; +import org.opentripplanner.utils.time.ServiceDateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/ItineraryListFilterChainBuilder.java b/application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/ItineraryListFilterChainBuilder.java index 3ff85db467a..65776948cbb 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/ItineraryListFilterChainBuilder.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/ItineraryListFilterChainBuilder.java @@ -13,8 +13,6 @@ import javax.annotation.Nullable; import org.opentripplanner.ext.accessibilityscore.DecorateWithAccessibilityScore; import org.opentripplanner.framework.application.OTPFeature; -import org.opentripplanner.framework.collection.ListSection; -import org.opentripplanner.framework.lang.Sandbox; import org.opentripplanner.model.plan.Itinerary; import org.opentripplanner.model.plan.ItinerarySortKey; import org.opentripplanner.model.plan.SortOrder; @@ -58,6 +56,8 @@ import org.opentripplanner.street.search.TraverseMode; import org.opentripplanner.transit.model.site.MultiModalStation; import org.opentripplanner.transit.model.site.Station; +import org.opentripplanner.utils.collection.ListSection; +import org.opentripplanner.utils.lang.Sandbox; /** * Create a filter chain based on the given config. diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/api/GroupBySimilarity.java b/application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/api/GroupBySimilarity.java index 0f671524a06..5cec3046710 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/api/GroupBySimilarity.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/api/GroupBySimilarity.java @@ -1,7 +1,7 @@ package org.opentripplanner.routing.algorithm.filterchain.api; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.routing.algorithm.filterchain.ItineraryListFilterChainBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * Group itineraries by similarity and reduce the number of itineraries down to an given maximum diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/api/TransitGeneralizedCostFilterParams.java b/application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/api/TransitGeneralizedCostFilterParams.java index a173f6b454b..da33b6f92a0 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/api/TransitGeneralizedCostFilterParams.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/api/TransitGeneralizedCostFilterParams.java @@ -1,7 +1,7 @@ package org.opentripplanner.routing.algorithm.filterchain.api; -import org.opentripplanner.framework.lang.DoubleUtils; import org.opentripplanner.routing.api.request.framework.CostLinearFunction; +import org.opentripplanner.utils.lang.DoubleUtils; /** * Input parameters for diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/filters/system/NumItinerariesFilter.java b/application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/filters/system/NumItinerariesFilter.java index aed5eeb4f95..77c297fcfa5 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/filters/system/NumItinerariesFilter.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/filters/system/NumItinerariesFilter.java @@ -2,10 +2,10 @@ import java.util.List; import java.util.function.Consumer; -import org.opentripplanner.framework.collection.ListSection; import org.opentripplanner.model.plan.Itinerary; import org.opentripplanner.model.plan.paging.cursor.PageCursorInput; import org.opentripplanner.routing.algorithm.filterchain.framework.spi.RemoveItineraryFlagger; +import org.opentripplanner.utils.collection.ListSection; /** * Flag all itineraries after the provided limit. This flags the itineraries at the end of the list diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/filters/system/NumItinerariesFilterResults.java b/application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/filters/system/NumItinerariesFilterResults.java index 8b11be099f7..401dc95026d 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/filters/system/NumItinerariesFilterResults.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/filters/system/NumItinerariesFilterResults.java @@ -2,12 +2,12 @@ import java.time.Instant; import java.util.List; -import org.opentripplanner.framework.collection.ListSection; -import org.opentripplanner.framework.collection.ListUtils; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.model.plan.Itinerary; import org.opentripplanner.model.plan.ItinerarySortKey; import org.opentripplanner.model.plan.paging.cursor.PageCursorInput; +import org.opentripplanner.utils.collection.ListSection; +import org.opentripplanner.utils.collection.ListUtils; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * The NumItinerariesFilter removes itineraries from a list of itineraries based on the number to diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/filters/system/PagingFilter.java b/application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/filters/system/PagingFilter.java index 1ef109525f6..417ffca9d83 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/filters/system/PagingFilter.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/filters/system/PagingFilter.java @@ -3,12 +3,12 @@ import java.util.Comparator; import java.util.List; import java.util.stream.Collectors; -import org.opentripplanner.framework.collection.ListSection; import org.opentripplanner.model.plan.Itinerary; import org.opentripplanner.model.plan.ItinerarySortKey; import org.opentripplanner.model.plan.SortOrder; import org.opentripplanner.routing.algorithm.filterchain.framework.sort.SortOrderComparator; import org.opentripplanner.routing.algorithm.filterchain.framework.spi.RemoveItineraryFlagger; +import org.opentripplanner.utils.collection.ListSection; /** * This class is used to enforce the cut/limit between two pages. It removes potential duplicates diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/filters/transit/TransitGeneralizedCostFilter.java b/application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/filters/transit/TransitGeneralizedCostFilter.java index 430f00372d0..4af0acd00cb 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/filters/transit/TransitGeneralizedCostFilter.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/filters/transit/TransitGeneralizedCostFilter.java @@ -4,11 +4,11 @@ import java.util.Comparator; import java.util.List; import java.util.stream.Collectors; -import org.opentripplanner.framework.lang.IntUtils; import org.opentripplanner.framework.model.Cost; import org.opentripplanner.model.plan.Itinerary; import org.opentripplanner.routing.algorithm.filterchain.framework.spi.RemoveItineraryFlagger; import org.opentripplanner.routing.api.request.framework.CostLinearFunction; +import org.opentripplanner.utils.lang.IntUtils; /** * This filter removes all transit results which have a generalized-cost higher than the max-limit diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/framework/groupids/GroupByDistance.java b/application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/framework/groupids/GroupByDistance.java index ee67e4f76d0..eb25cf9275c 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/framework/groupids/GroupByDistance.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/framework/groupids/GroupByDistance.java @@ -2,12 +2,12 @@ import java.util.Comparator; import java.util.List; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.model.plan.Itinerary; import org.opentripplanner.model.plan.Leg; import org.opentripplanner.model.plan.StreetLeg; import org.opentripplanner.model.plan.TransitLeg; import org.opentripplanner.routing.algorithm.filterchain.framework.spi.GroupId; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * This class creates a group identifier for an itinerary based on the longest legs which together diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/framework/sort/SortOrderComparator.java b/application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/framework/sort/SortOrderComparator.java index f11caf5ceaa..a904a6990ca 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/framework/sort/SortOrderComparator.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/filterchain/framework/sort/SortOrderComparator.java @@ -4,9 +4,9 @@ import static java.util.Comparator.comparingInt; import java.util.Comparator; -import org.opentripplanner.framework.collection.CompositeComparator; import org.opentripplanner.model.plan.ItinerarySortKey; import org.opentripplanner.model.plan.SortOrder; +import org.opentripplanner.utils.collection.CompositeComparator; /** * This comparator implements the itinerary sort order defined by the {@link SortOrder}. diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/path/PathDiff.java b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/path/PathDiff.java index 18f1fa4f64a..d595c8abcff 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/path/PathDiff.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/path/PathDiff.java @@ -1,8 +1,8 @@ package org.opentripplanner.routing.algorithm.raptoradapter.path; -import static org.opentripplanner.framework.text.Table.Align.Center; -import static org.opentripplanner.framework.text.Table.Align.Left; -import static org.opentripplanner.framework.text.Table.Align.Right; +import static org.opentripplanner.utils.text.Table.Align.Center; +import static org.opentripplanner.utils.text.Table.Align.Left; +import static org.opentripplanner.utils.text.Table.Align.Right; import java.util.ArrayList; import java.util.Collection; @@ -10,16 +10,16 @@ import java.util.List; import java.util.function.Consumer; import java.util.stream.Collectors; -import org.opentripplanner.framework.collection.CompositeComparator; -import org.opentripplanner.framework.text.Table; -import org.opentripplanner.framework.text.TableBuilder; -import org.opentripplanner.framework.time.DurationUtils; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; import org.opentripplanner.raptor.api.path.PathLeg; import org.opentripplanner.raptor.api.path.RaptorPath; import org.opentripplanner.routing.util.DiffEntry; import org.opentripplanner.routing.util.DiffTool; +import org.opentripplanner.utils.collection.CompositeComparator; +import org.opentripplanner.utils.text.Table; +import org.opentripplanner.utils.text.TableBuilder; +import org.opentripplanner.utils.time.DurationUtils; +import org.opentripplanner.utils.time.TimeUtils; /** * This class is used to diff two set of paths. You may ask for the diff result or pass in a logger diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/street/AccessEgressRouter.java b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/street/AccessEgressRouter.java index 9b592fad3aa..0ae2df4e105 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/street/AccessEgressRouter.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/street/AccessEgressRouter.java @@ -7,12 +7,12 @@ import javax.annotation.Nullable; import org.opentripplanner.ext.dataoverlay.routing.DataOverlayContext; import org.opentripplanner.framework.application.OTPRequestTimeoutException; -import org.opentripplanner.framework.collection.ListUtils; import org.opentripplanner.graph_builder.module.nearbystops.StreetNearbyStopFinder; import org.opentripplanner.routing.api.request.RouteRequest; import org.opentripplanner.routing.api.request.request.StreetRequest; import org.opentripplanner.routing.graphfinder.NearbyStop; import org.opentripplanner.street.search.TemporaryVerticesContainer; +import org.opentripplanner.utils.collection.ListUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/Transfer.java b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/Transfer.java index c6086100f5d..175c782ab22 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/Transfer.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/Transfer.java @@ -5,8 +5,6 @@ import java.util.List; import java.util.Optional; import org.locationtech.jts.geom.Coordinate; -import org.opentripplanner.framework.logging.Throttle; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.raptor.api.model.RaptorTransfer; import org.opentripplanner.routing.algorithm.raptoradapter.transit.cost.RaptorCostConverter; import org.opentripplanner.routing.api.request.preference.WalkPreferences; @@ -14,6 +12,8 @@ import org.opentripplanner.street.search.request.StreetSearchRequest; import org.opentripplanner.street.search.state.EdgeTraverser; import org.opentripplanner.street.search.state.StateEditor; +import org.opentripplanner.utils.logging.Throttle; +import org.opentripplanner.utils.tostring.ToStringBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/TransitTuningParameters.java b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/TransitTuningParameters.java index b62459db679..c2e518a9ec1 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/TransitTuningParameters.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/TransitTuningParameters.java @@ -2,9 +2,9 @@ import java.time.Duration; import java.util.List; -import org.opentripplanner.framework.time.DurationUtils; import org.opentripplanner.routing.api.request.RouteRequest; import org.opentripplanner.transit.model.site.StopTransferPriority; +import org.opentripplanner.utils.time.DurationUtils; public interface TransitTuningParameters { List PAGING_SEARCH_WINDOW_ADJUSTMENTS = DurationUtils.durations("4h 2h 1h 30m 20m 10m"); diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/TripPatternForDate.java b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/TripPatternForDate.java index 1411424dfc6..eeaf1312677 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/TripPatternForDate.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/TripPatternForDate.java @@ -8,10 +8,10 @@ import java.util.function.Predicate; import java.util.stream.Collectors; import javax.annotation.Nullable; -import org.opentripplanner.framework.time.ServiceDateUtils; import org.opentripplanner.transit.model.network.RoutingTripPattern; import org.opentripplanner.transit.model.timetable.FrequencyEntry; import org.opentripplanner.transit.model.timetable.TripTimes; +import org.opentripplanner.utils.time.ServiceDateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/constrainedtransfer/ConstrainedTransfersForPatterns.java b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/constrainedtransfer/ConstrainedTransfersForPatterns.java index f3b8eac0dd2..670c223e87d 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/constrainedtransfer/ConstrainedTransfersForPatterns.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/constrainedtransfer/ConstrainedTransfersForPatterns.java @@ -2,7 +2,7 @@ import java.util.List; import java.util.Objects; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * This is a container for returning transfers from and to stop-positions indexed by diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/cost/GeneralizedCostParameters.java b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/cost/GeneralizedCostParameters.java index e1271aca199..eee0fbf36c0 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/cost/GeneralizedCostParameters.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/cost/GeneralizedCostParameters.java @@ -3,9 +3,9 @@ import java.util.BitSet; import java.util.Objects; import javax.annotation.Nullable; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.routing.api.request.RouteRequest; import org.opentripplanner.routing.api.request.preference.AccessibilityPreferences; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * This class define how to calculate the cost when cost is part of the multi-criteria pareto diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RaptorRequestTransferCache.java b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RaptorRequestTransferCache.java index 5e274c4120f..d778f491142 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RaptorRequestTransferCache.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RaptorRequestTransferCache.java @@ -6,7 +6,6 @@ import java.util.List; import java.util.Objects; import java.util.concurrent.ExecutionException; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.routing.algorithm.raptoradapter.transit.RaptorTransferIndex; import org.opentripplanner.routing.algorithm.raptoradapter.transit.Transfer; import org.opentripplanner.routing.api.request.RouteRequest; @@ -17,6 +16,7 @@ import org.opentripplanner.routing.api.request.preference.WheelchairPreferences; import org.opentripplanner.street.search.request.StreetSearchRequest; import org.opentripplanner.street.search.request.StreetSearchRequestMapper; +import org.opentripplanner.utils.tostring.ToStringBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RaptorRoutingRequestTransitData.java b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RaptorRoutingRequestTransitData.java index 0182598ca35..784f24af1bc 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RaptorRoutingRequestTransitData.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RaptorRoutingRequestTransitData.java @@ -6,7 +6,6 @@ import java.util.List; import javax.annotation.Nullable; import org.opentripplanner.framework.application.OTPFeature; -import org.opentripplanner.framework.time.ServiceDateUtils; import org.opentripplanner.model.transfer.TransferService; import org.opentripplanner.raptor.api.model.RaptorConstrainedTransfer; import org.opentripplanner.raptor.api.model.RaptorStopNameResolver; @@ -30,6 +29,7 @@ import org.opentripplanner.routing.api.request.RouteRequest; import org.opentripplanner.transit.model.network.RoutingTripPattern; import org.opentripplanner.transit.model.network.grouppriority.TransitGroupPriorityService; +import org.opentripplanner.utils.time.ServiceDateUtils; /** * This is the data provider for the Range Raptor search engine. It uses data from the TransitLayer, diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RaptorRoutingRequestTransitDataCreator.java b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RaptorRoutingRequestTransitDataCreator.java index 815bf839e31..bde424f8269 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RaptorRoutingRequestTransitDataCreator.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RaptorRoutingRequestTransitDataCreator.java @@ -1,6 +1,6 @@ package org.opentripplanner.routing.algorithm.raptoradapter.transit.request; -import static org.opentripplanner.framework.time.ServiceDateUtils.secondsSinceStartOfTime; +import static org.opentripplanner.utils.time.ServiceDateUtils.secondsSinceStartOfTime; import gnu.trove.list.array.TIntArrayList; import gnu.trove.map.TObjectIntMap; @@ -14,13 +14,13 @@ import java.util.List; import java.util.Map; import java.util.function.Predicate; -import org.opentripplanner.framework.time.DurationUtils; -import org.opentripplanner.framework.time.ServiceDateUtils; import org.opentripplanner.routing.algorithm.raptoradapter.transit.TransitLayer; import org.opentripplanner.routing.algorithm.raptoradapter.transit.TripPatternForDate; import org.opentripplanner.transit.model.network.RoutingTripPattern; import org.opentripplanner.transit.model.network.grouppriority.TransitGroupPriorityService; import org.opentripplanner.transit.model.timetable.TripTimes; +import org.opentripplanner.utils.time.DurationUtils; +import org.opentripplanner.utils.time.ServiceDateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/TripPatternForDates.java b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/TripPatternForDates.java index 0fb39b227ea..a94aa0850ba 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/TripPatternForDates.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/TripPatternForDates.java @@ -2,7 +2,6 @@ import java.util.BitSet; import java.util.function.IntUnaryOperator; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.raptor.api.model.RaptorTripPattern; import org.opentripplanner.raptor.api.model.SearchDirection; import org.opentripplanner.raptor.spi.IntIterator; @@ -18,6 +17,7 @@ import org.opentripplanner.transit.model.basic.Accessibility; import org.opentripplanner.transit.model.network.Route; import org.opentripplanner.transit.model.network.RoutingTripPattern; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * A collection of all the TripSchedules active on a range of consecutive days. The outer list of diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/TripScheduleAlightSearch.java b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/TripScheduleAlightSearch.java index 5ece76aedb5..628a16511ce 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/TripScheduleAlightSearch.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/TripScheduleAlightSearch.java @@ -2,13 +2,13 @@ import java.util.function.IntUnaryOperator; import javax.annotation.Nullable; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.raptor.api.model.RaptorConstants; import org.opentripplanner.raptor.api.model.RaptorTransferConstraint; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; import org.opentripplanner.raptor.api.model.SearchDirection; import org.opentripplanner.raptor.spi.RaptorBoardOrAlightEvent; import org.opentripplanner.raptor.spi.RaptorTripScheduleSearch; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * The purpose of this class is to optimize the search for a trip schedule for a given pattern and diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/TripScheduleBoardSearch.java b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/TripScheduleBoardSearch.java index 4ec306f84b3..7bd5062d8dc 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/TripScheduleBoardSearch.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/TripScheduleBoardSearch.java @@ -1,13 +1,13 @@ package org.opentripplanner.routing.algorithm.raptoradapter.transit.request; import java.util.function.IntUnaryOperator; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.raptor.api.model.RaptorConstants; import org.opentripplanner.raptor.api.model.RaptorTransferConstraint; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; import org.opentripplanner.raptor.api.model.SearchDirection; import org.opentripplanner.raptor.spi.RaptorBoardOrAlightEvent; import org.opentripplanner.raptor.spi.RaptorTripScheduleSearch; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * The purpose of this class is to optimize the search for a trip schedule for a given pattern and diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/TripScheduleWithOffset.java b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/TripScheduleWithOffset.java index aca998b24ca..d692f0079f6 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/TripScheduleWithOffset.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/TripScheduleWithOffset.java @@ -2,7 +2,6 @@ import java.time.LocalDate; import java.util.function.IntUnaryOperator; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.raptor.api.model.RaptorTripPattern; import org.opentripplanner.raptor.spi.IntIterator; import org.opentripplanner.routing.algorithm.raptoradapter.transit.TripPatternForDate; @@ -10,6 +9,7 @@ import org.opentripplanner.transit.model.basic.Accessibility; import org.opentripplanner.transit.model.network.TripPattern; import org.opentripplanner.transit.model.timetable.TripTimes; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * This represents a single trip within a TripPattern, but with a time offset in seconds. This is diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/OptimizeTransferService.java b/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/OptimizeTransferService.java index 8a4f25d8910..4d8a79b3f4f 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/OptimizeTransferService.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/OptimizeTransferService.java @@ -3,7 +3,6 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; -import org.opentripplanner.framework.logging.Throttle; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; import org.opentripplanner.raptor.api.path.RaptorPath; import org.opentripplanner.routing.algorithm.raptoradapter.path.PathDiff; @@ -11,6 +10,7 @@ import org.opentripplanner.routing.algorithm.transferoptimization.model.MinSafeTransferTimeCalculator; import org.opentripplanner.routing.algorithm.transferoptimization.model.TransferWaitTimeCostCalculator; import org.opentripplanner.routing.algorithm.transferoptimization.services.OptimizePathDomainService; +import org.opentripplanner.utils.logging.Throttle; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/model/BasicStopTime.java b/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/model/BasicStopTime.java index 9d073b2ae64..5fd9e73e398 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/model/BasicStopTime.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/model/BasicStopTime.java @@ -1,7 +1,7 @@ package org.opentripplanner.routing.algorithm.transferoptimization.model; import java.util.Objects; -import org.opentripplanner.framework.tostring.ValueObjectToStringBuilder; +import org.opentripplanner.utils.tostring.ValueObjectToStringBuilder; /** Basic stop and time value object. */ final class BasicStopTime implements StopTime { diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/model/MinSafeTransferTimeCalculator.java b/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/model/MinSafeTransferTimeCalculator.java index 49b3c29559e..fde6b3d4a64 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/model/MinSafeTransferTimeCalculator.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/model/MinSafeTransferTimeCalculator.java @@ -1,14 +1,14 @@ package org.opentripplanner.routing.algorithm.transferoptimization.model; -import static org.opentripplanner.framework.time.DurationUtils.durationInSeconds; +import static org.opentripplanner.utils.time.DurationUtils.durationInSeconds; import java.util.Collection; import java.util.function.ToIntFunction; -import org.opentripplanner.framework.lang.IntUtils; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; import org.opentripplanner.raptor.api.path.RaptorPath; import org.opentripplanner.raptor.api.path.TransitPathLeg; import org.opentripplanner.raptor.spi.RaptorSlackProvider; +import org.opentripplanner.utils.lang.IntUtils; /** * This is a calculator to calculate a min-safe-transfer-time. The min-safe-transfer-time is used to diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/model/OptimizedPathTail.java b/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/model/OptimizedPathTail.java index b36a7d6ebfd..efe53d8e090 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/model/OptimizedPathTail.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/model/OptimizedPathTail.java @@ -1,7 +1,6 @@ package org.opentripplanner.routing.algorithm.transferoptimization.model; import javax.annotation.Nullable; -import org.opentripplanner.framework.tostring.ValueObjectToStringBuilder; import org.opentripplanner.model.transfer.TransferConstraint; import org.opentripplanner.raptor.api.model.RaptorConstants; import org.opentripplanner.raptor.api.model.RaptorStopNameResolver; @@ -16,6 +15,7 @@ import org.opentripplanner.raptor.spi.RaptorSlackProvider; import org.opentripplanner.routing.algorithm.transferoptimization.api.OptimizedPath; import org.opentripplanner.routing.algorithm.transferoptimization.api.TransferOptimized; +import org.opentripplanner.utils.tostring.ValueObjectToStringBuilder; /** * This class is used to decorate a {@link TransitPathLeg} with information about transfers diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/model/StopPriorityCostCalculator.java b/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/model/StopPriorityCostCalculator.java index 48a4b733b58..6ea660e654f 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/model/StopPriorityCostCalculator.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/model/StopPriorityCostCalculator.java @@ -1,7 +1,7 @@ package org.opentripplanner.routing.algorithm.transferoptimization.model; -import org.opentripplanner.framework.lang.IntUtils; import org.opentripplanner.routing.algorithm.raptoradapter.transit.TransitLayer; +import org.opentripplanner.utils.lang.IntUtils; /** * This class calculates an extra stop priority cost by using the stop-board-alight-transfer-cost diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/model/TripStopTime.java b/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/model/TripStopTime.java index 75fd589a45b..27299e407f4 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/model/TripStopTime.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/model/TripStopTime.java @@ -1,8 +1,8 @@ package org.opentripplanner.routing.algorithm.transferoptimization.model; import java.util.Objects; -import org.opentripplanner.framework.tostring.ValueObjectToStringBuilder; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; +import org.opentripplanner.utils.tostring.ValueObjectToStringBuilder; /** * @param The TripSchedule type defined by the user of the raptor API. diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/model/TripToTripTransfer.java b/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/model/TripToTripTransfer.java index 0dce8933e3f..2aa13d0cd16 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/model/TripToTripTransfer.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/model/TripToTripTransfer.java @@ -1,10 +1,10 @@ package org.opentripplanner.routing.algorithm.transferoptimization.model; import javax.annotation.Nullable; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.model.transfer.ConstrainedTransfer; import org.opentripplanner.raptor.api.model.RaptorTransfer; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * @param The TripSchedule type defined by the user of the raptor API. diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/model/costfilter/MinCostPathTailFilter.java b/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/model/costfilter/MinCostPathTailFilter.java index 8de4c8fa847..6b8dbef7f4e 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/model/costfilter/MinCostPathTailFilter.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/model/costfilter/MinCostPathTailFilter.java @@ -4,10 +4,10 @@ import java.util.List; import java.util.Set; import java.util.function.ToIntFunction; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; import org.opentripplanner.routing.algorithm.transferoptimization.model.OptimizedPathTail; import org.opentripplanner.routing.algorithm.transferoptimization.model.PathTailFilter; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * This class takes a list of "cost functions" and creates a filter chain for them. The precedence diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/model/passthrough/PassThroughPathTailFilter.java b/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/model/passthrough/PassThroughPathTailFilter.java index 46b1a9020b0..bff656bb940 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/model/passthrough/PassThroughPathTailFilter.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/model/passthrough/PassThroughPathTailFilter.java @@ -7,11 +7,11 @@ import java.util.Map; import java.util.Set; import java.util.stream.Collectors; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; import org.opentripplanner.raptor.api.request.PassThroughPoint; import org.opentripplanner.routing.algorithm.transferoptimization.model.OptimizedPathTail; import org.opentripplanner.routing.algorithm.transferoptimization.model.PathTailFilter; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * Create a filter chain function and find the best combination of transfers for the journey diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/services/TransitPathLegSelector.java b/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/services/TransitPathLegSelector.java index 9e0a4257f57..646939a9ac5 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/services/TransitPathLegSelector.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/transferoptimization/services/TransitPathLegSelector.java @@ -2,10 +2,10 @@ import java.util.HashSet; import java.util.Set; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; import org.opentripplanner.routing.algorithm.transferoptimization.model.OptimizedPathTail; import org.opentripplanner.routing.algorithm.transferoptimization.model.PathTailFilter; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * This class takes a list of transit legs and returns the best leg based on the {@link diff --git a/application/src/main/java/org/opentripplanner/routing/alternativelegs/AlternativeLegs.java b/application/src/main/java/org/opentripplanner/routing/alternativelegs/AlternativeLegs.java index 465ed230884..14dc7ade982 100644 --- a/application/src/main/java/org/opentripplanner/routing/alternativelegs/AlternativeLegs.java +++ b/application/src/main/java/org/opentripplanner/routing/alternativelegs/AlternativeLegs.java @@ -16,7 +16,6 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; import java.util.stream.Stream; -import org.opentripplanner.framework.time.ServiceDateUtils; import org.opentripplanner.model.Timetable; import org.opentripplanner.model.TripTimeOnDate; import org.opentripplanner.model.plan.Leg; @@ -29,6 +28,7 @@ import org.opentripplanner.transit.model.timetable.TripOnServiceDate; import org.opentripplanner.transit.model.timetable.TripTimes; import org.opentripplanner.transit.service.TransitService; +import org.opentripplanner.utils.time.ServiceDateUtils; /** * A helper class to fetch previous/next alternative legs for a scheduled transit leg. diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/DebugRaptor.java b/application/src/main/java/org/opentripplanner/routing/api/request/DebugRaptor.java index 0b9ff4f0c30..a0d7bd6de2e 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/DebugRaptor.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/DebugRaptor.java @@ -9,7 +9,7 @@ import java.util.List; import java.util.Set; import java.util.regex.Pattern; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/RequestModes.java b/application/src/main/java/org/opentripplanner/routing/api/request/RequestModes.java index 8afb3082e1b..f10686216a8 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/RequestModes.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/RequestModes.java @@ -3,7 +3,7 @@ import static org.opentripplanner.routing.api.request.StreetMode.NOT_SET; import java.util.Objects; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; public class RequestModes { diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/RouteRequest.java b/application/src/main/java/org/opentripplanner/routing/api/request/RouteRequest.java index 27ecc777050..8e649b3be49 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/RouteRequest.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/RouteRequest.java @@ -1,6 +1,6 @@ package org.opentripplanner.routing.api.request; -import static org.opentripplanner.framework.time.DurationUtils.durationInSeconds; +import static org.opentripplanner.utils.time.DurationUtils.durationInSeconds; import java.io.Serializable; import java.time.Duration; @@ -14,10 +14,6 @@ import java.util.Objects; import java.util.function.Consumer; import javax.annotation.Nullable; -import org.opentripplanner.framework.collection.ListSection; -import org.opentripplanner.framework.lang.ObjectUtils; -import org.opentripplanner.framework.time.DateUtils; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.model.GenericLocation; import org.opentripplanner.model.plan.SortOrder; import org.opentripplanner.model.plan.paging.cursor.PageCursor; @@ -29,6 +25,10 @@ import org.opentripplanner.routing.api.response.RoutingErrorCode; import org.opentripplanner.routing.error.RoutingValidationException; import org.opentripplanner.standalone.config.routerconfig.TransitRoutingConfig; +import org.opentripplanner.utils.collection.ListSection; +import org.opentripplanner.utils.lang.ObjectUtils; +import org.opentripplanner.utils.time.DateUtils; +import org.opentripplanner.utils.tostring.ToStringBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/framework/DurationForEnum.java b/application/src/main/java/org/opentripplanner/routing/api/request/framework/DurationForEnum.java index e6dacaac19d..c6586aa8b0f 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/framework/DurationForEnum.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/framework/DurationForEnum.java @@ -7,7 +7,7 @@ import java.util.Map; import java.util.Objects; import java.util.function.Consumer; -import org.opentripplanner.framework.tostring.ValueObjectToStringBuilder; +import org.opentripplanner.utils.tostring.ValueObjectToStringBuilder; /** * This class is used to store a {@link Duration} value for each of the enum type values. diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/framework/LinearFunctionSerialization.java b/application/src/main/java/org/opentripplanner/routing/api/request/framework/LinearFunctionSerialization.java index cb9dfb5c4cc..a6c846ccb35 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/framework/LinearFunctionSerialization.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/framework/LinearFunctionSerialization.java @@ -7,10 +7,10 @@ import java.util.function.BiFunction; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.opentripplanner.framework.lang.IntUtils; -import org.opentripplanner.framework.lang.StringUtils; import org.opentripplanner.framework.model.Units; -import org.opentripplanner.framework.time.DurationUtils; +import org.opentripplanner.utils.lang.IntUtils; +import org.opentripplanner.utils.lang.StringUtils; +import org.opentripplanner.utils.time.DurationUtils; /** * This class can serialize and parse a linear function of time/duration/cost on the form diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/framework/TimeAndCostPenaltyForEnum.java b/application/src/main/java/org/opentripplanner/routing/api/request/framework/TimeAndCostPenaltyForEnum.java index 2f439801cb5..ace9b813937 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/framework/TimeAndCostPenaltyForEnum.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/framework/TimeAndCostPenaltyForEnum.java @@ -7,7 +7,7 @@ import java.util.Objects; import java.util.function.Consumer; import org.opentripplanner.framework.model.TimeAndCost; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * A map of {@link TimeAndCost} indexed by enum type {@code T}. diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/framework/TimePenalty.java b/application/src/main/java/org/opentripplanner/routing/api/request/framework/TimePenalty.java index 3ee07034135..99643b69d02 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/framework/TimePenalty.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/framework/TimePenalty.java @@ -1,8 +1,8 @@ package org.opentripplanner.routing.api.request.framework; import java.time.Duration; -import org.opentripplanner.framework.lang.StringUtils; -import org.opentripplanner.framework.time.DurationUtils; +import org.opentripplanner.utils.lang.StringUtils; +import org.opentripplanner.utils.time.DurationUtils; public final class TimePenalty extends AbstractLinearFunction { diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/preference/AccessEgressPreferences.java b/application/src/main/java/org/opentripplanner/routing/api/request/preference/AccessEgressPreferences.java index 9998f0a3b1c..42925339fd1 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/preference/AccessEgressPreferences.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/preference/AccessEgressPreferences.java @@ -7,12 +7,12 @@ import java.util.Map; import java.util.Objects; import java.util.function.Consumer; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.routing.api.request.StreetMode; import org.opentripplanner.routing.api.request.framework.DurationForEnum; import org.opentripplanner.routing.api.request.framework.TimeAndCostPenalty; import org.opentripplanner.routing.api.request.framework.TimeAndCostPenaltyForEnum; import org.opentripplanner.routing.api.request.framework.TimePenalty; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * Preferences for access/egress routing on street network diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/preference/AccessibilityPreferences.java b/application/src/main/java/org/opentripplanner/routing/api/request/preference/AccessibilityPreferences.java index 303bda51858..d4d232ab3f6 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/preference/AccessibilityPreferences.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/preference/AccessibilityPreferences.java @@ -3,7 +3,7 @@ import java.util.Objects; import java.util.function.Consumer; import org.opentripplanner.framework.model.Cost; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * Preferences for how to treat trips or stops with accessibility restrictions, like wheelchair diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/preference/BikePreferences.java b/application/src/main/java/org/opentripplanner/routing/api/request/preference/BikePreferences.java index 5767b74eaa8..038d6c140da 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/preference/BikePreferences.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/preference/BikePreferences.java @@ -1,17 +1,17 @@ package org.opentripplanner.routing.api.request.preference; -import static org.opentripplanner.framework.lang.DoubleUtils.doubleEquals; -import static org.opentripplanner.framework.lang.ObjectUtils.ifNotNull; import static org.opentripplanner.routing.core.VehicleRoutingOptimizeType.SAFE_STREETS; import static org.opentripplanner.routing.core.VehicleRoutingOptimizeType.TRIANGLE; +import static org.opentripplanner.utils.lang.DoubleUtils.doubleEquals; +import static org.opentripplanner.utils.lang.ObjectUtils.ifNotNull; import java.io.Serializable; import java.util.Objects; import java.util.function.Consumer; import org.opentripplanner.framework.model.Cost; import org.opentripplanner.framework.model.Units; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.routing.core.VehicleRoutingOptimizeType; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * The bike preferences contain all speed, reluctance, cost and factor preferences for biking diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/preference/CarPreferences.java b/application/src/main/java/org/opentripplanner/routing/api/request/preference/CarPreferences.java index cc9b7ba62d8..3ea3634c623 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/preference/CarPreferences.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/preference/CarPreferences.java @@ -1,15 +1,15 @@ package org.opentripplanner.routing.api.request.preference; -import static org.opentripplanner.framework.lang.ObjectUtils.ifNotNull; +import static org.opentripplanner.utils.lang.ObjectUtils.ifNotNull; import java.io.Serializable; import java.time.Duration; import java.util.Objects; import java.util.function.Consumer; -import org.opentripplanner.framework.lang.DoubleUtils; import org.opentripplanner.framework.model.Cost; import org.opentripplanner.framework.model.Units; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.lang.DoubleUtils; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * The car preferences contain all speed, reluctance, cost and factor preferences for driving diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/preference/ElevatorPreferences.java b/application/src/main/java/org/opentripplanner/routing/api/request/preference/ElevatorPreferences.java index 7ee6409d7b7..7e5e55d6263 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/preference/ElevatorPreferences.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/preference/ElevatorPreferences.java @@ -5,7 +5,7 @@ import java.util.function.Consumer; import org.opentripplanner.framework.model.Cost; import org.opentripplanner.framework.model.Units; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * TODO: how long does it /really/ take to an elevator? diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/preference/ItineraryFilterPreferences.java b/application/src/main/java/org/opentripplanner/routing/api/request/preference/ItineraryFilterPreferences.java index 31fa7edd139..f18cf5ce9c1 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/preference/ItineraryFilterPreferences.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/preference/ItineraryFilterPreferences.java @@ -4,9 +4,9 @@ import java.util.Objects; import java.util.function.Consumer; import org.opentripplanner.framework.model.Units; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.routing.algorithm.filterchain.api.TransitGeneralizedCostFilterParams; import org.opentripplanner.routing.api.request.framework.CostLinearFunction; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * Group by Similarity filter parameters. See the configuration for documentation of each field. diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/preference/RaptorPreferences.java b/application/src/main/java/org/opentripplanner/routing/api/request/preference/RaptorPreferences.java index 03ed9482ff8..e9318bc8dc3 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/preference/RaptorPreferences.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/preference/RaptorPreferences.java @@ -11,10 +11,10 @@ import java.util.function.Consumer; import javax.annotation.Nullable; import org.opentripplanner.framework.model.Units; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.raptor.api.model.SearchDirection; import org.opentripplanner.raptor.api.request.Optimization; import org.opentripplanner.raptor.api.request.RaptorProfile; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * Set of optimizations to use with Raptor. These are available here for testing purposes. diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/preference/Relax.java b/application/src/main/java/org/opentripplanner/routing/api/request/preference/Relax.java index 8f10ffd1525..a5e61325483 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/preference/Relax.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/preference/Relax.java @@ -1,8 +1,8 @@ package org.opentripplanner.routing.api.request.preference; import java.util.Locale; -import org.opentripplanner.framework.lang.DoubleUtils; -import org.opentripplanner.framework.lang.IntUtils; +import org.opentripplanner.utils.lang.DoubleUtils; +import org.opentripplanner.utils.lang.IntUtils; /** * Relax a value by the given ratio and slack. The relaxed value diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/preference/RoutingPreferences.java b/application/src/main/java/org/opentripplanner/routing/api/request/preference/RoutingPreferences.java index 5e5475d12ac..5eccc970101 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/preference/RoutingPreferences.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/preference/RoutingPreferences.java @@ -1,7 +1,7 @@ package org.opentripplanner.routing.api.request.preference; import static java.util.Objects.requireNonNull; -import static org.opentripplanner.framework.lang.ObjectUtils.ifNotNull; +import static org.opentripplanner.utils.lang.ObjectUtils.ifNotNull; import java.io.Serializable; import java.util.Objects; diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/preference/ScooterPreferences.java b/application/src/main/java/org/opentripplanner/routing/api/request/preference/ScooterPreferences.java index 1d5cf83a54b..6a20cbcd293 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/preference/ScooterPreferences.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/preference/ScooterPreferences.java @@ -1,16 +1,16 @@ package org.opentripplanner.routing.api.request.preference; -import static org.opentripplanner.framework.lang.DoubleUtils.doubleEquals; -import static org.opentripplanner.framework.lang.ObjectUtils.ifNotNull; import static org.opentripplanner.routing.core.VehicleRoutingOptimizeType.SAFE_STREETS; import static org.opentripplanner.routing.core.VehicleRoutingOptimizeType.TRIANGLE; +import static org.opentripplanner.utils.lang.DoubleUtils.doubleEquals; +import static org.opentripplanner.utils.lang.ObjectUtils.ifNotNull; import java.io.Serializable; import java.util.Objects; import java.util.function.Consumer; import org.opentripplanner.framework.model.Units; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.routing.core.VehicleRoutingOptimizeType; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * The scooter preferences contain all speed, reluctance, cost and factor preferences for scooter diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/preference/StreetPreferences.java b/application/src/main/java/org/opentripplanner/routing/api/request/preference/StreetPreferences.java index 166c950a0e7..bb526ceaa31 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/preference/StreetPreferences.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/preference/StreetPreferences.java @@ -1,7 +1,6 @@ package org.opentripplanner.routing.api.request.preference; import static java.time.Duration.ofHours; -import static java.time.Duration.ofMinutes; import static java.util.Objects.requireNonNull; import java.io.Serializable; @@ -9,14 +8,13 @@ import java.util.Map; import java.util.Objects; import java.util.function.Consumer; -import org.opentripplanner.framework.lang.DoubleUtils; import org.opentripplanner.framework.model.Units; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.routing.api.request.StreetMode; import org.opentripplanner.routing.api.request.framework.DurationForEnum; -import org.opentripplanner.routing.api.request.framework.TimeAndCostPenalty; import org.opentripplanner.street.search.intersection_model.DrivingDirection; import org.opentripplanner.street.search.intersection_model.IntersectionTraversalModel; +import org.opentripplanner.utils.lang.DoubleUtils; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * This class holds preferences for street routing in general, not mode specific. diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/preference/SystemPreferences.java b/application/src/main/java/org/opentripplanner/routing/api/request/preference/SystemPreferences.java index 442ab33434a..f35a65c2f03 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/preference/SystemPreferences.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/preference/SystemPreferences.java @@ -9,8 +9,8 @@ import java.util.Set; import java.util.function.Consumer; import org.opentripplanner.ext.dataoverlay.api.DataOverlayParameters; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.routing.api.request.RoutingTag; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * Configure system related features - a system feature is a non-functional feature. It diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/preference/TimeSlopeSafetyTriangle.java b/application/src/main/java/org/opentripplanner/routing/api/request/preference/TimeSlopeSafetyTriangle.java index ae4f1039f32..cca9105f112 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/preference/TimeSlopeSafetyTriangle.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/preference/TimeSlopeSafetyTriangle.java @@ -1,7 +1,7 @@ package org.opentripplanner.routing.api.request.preference; -import static org.opentripplanner.framework.lang.DoubleUtils.doubleEquals; -import static org.opentripplanner.framework.lang.DoubleUtils.roundTo2Decimals; +import static org.opentripplanner.utils.lang.DoubleUtils.doubleEquals; +import static org.opentripplanner.utils.lang.DoubleUtils.roundTo2Decimals; /** * Sets the (bicycle or scooter) triangle routing parameters -- the relative importance of safety, diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/preference/TransferOptimizationPreferences.java b/application/src/main/java/org/opentripplanner/routing/api/request/preference/TransferOptimizationPreferences.java index 41a1954603b..7ba6e609ce9 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/preference/TransferOptimizationPreferences.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/preference/TransferOptimizationPreferences.java @@ -1,13 +1,13 @@ package org.opentripplanner.routing.api.request.preference; -import static org.opentripplanner.framework.lang.DoubleUtils.doubleEquals; +import static org.opentripplanner.utils.lang.DoubleUtils.doubleEquals; import java.io.Serializable; import java.util.Objects; import org.opentripplanner.framework.application.OTPFeature; import org.opentripplanner.framework.model.Units; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.routing.algorithm.transferoptimization.api.TransferOptimizationParameters; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * See {@link TransferOptimizationParameters} for documentation on this class. diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/preference/TransferPreferences.java b/application/src/main/java/org/opentripplanner/routing/api/request/preference/TransferPreferences.java index 464b9872bdd..f996dd5e6f4 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/preference/TransferPreferences.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/preference/TransferPreferences.java @@ -1,7 +1,7 @@ package org.opentripplanner.routing.api.request.preference; import static java.util.Objects.requireNonNull; -import static org.opentripplanner.framework.lang.DoubleUtils.doubleEquals; +import static org.opentripplanner.utils.lang.DoubleUtils.doubleEquals; import java.io.Serializable; import java.time.Duration; @@ -9,9 +9,9 @@ import java.util.function.Consumer; import org.opentripplanner.framework.model.Cost; import org.opentripplanner.framework.model.Units; -import org.opentripplanner.framework.time.DurationUtils; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.routing.algorithm.transferoptimization.api.TransferOptimizationParameters; +import org.opentripplanner.utils.time.DurationUtils; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * Parameters for doing transfers between transit legs. diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/preference/TransitPreferences.java b/application/src/main/java/org/opentripplanner/routing/api/request/preference/TransitPreferences.java index 78f30277e72..f15b47216e5 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/preference/TransitPreferences.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/preference/TransitPreferences.java @@ -7,10 +7,10 @@ import java.util.Objects; import java.util.function.Consumer; import org.opentripplanner.framework.model.Cost; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.routing.api.request.framework.CostLinearFunction; import org.opentripplanner.routing.api.request.framework.DurationForEnum; import org.opentripplanner.transit.model.basic.TransitMode; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * Preferences for transit routing. diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/preference/VehicleParkingPreferences.java b/application/src/main/java/org/opentripplanner/routing/api/request/preference/VehicleParkingPreferences.java index f7183812c3a..732171c7b80 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/preference/VehicleParkingPreferences.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/preference/VehicleParkingPreferences.java @@ -7,9 +7,9 @@ import java.util.Set; import java.util.function.Consumer; import org.opentripplanner.framework.model.Cost; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.routing.api.request.preference.filter.VehicleParkingFilter; import org.opentripplanner.routing.api.request.preference.filter.VehicleParkingSelect; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * The parking preferences contain preferences for car and bicycle parking. These preferences diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/preference/VehicleRentalPreferences.java b/application/src/main/java/org/opentripplanner/routing/api/request/preference/VehicleRentalPreferences.java index 6c9bbfea875..4c00014f30d 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/preference/VehicleRentalPreferences.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/preference/VehicleRentalPreferences.java @@ -7,7 +7,7 @@ import java.util.function.Consumer; import org.opentripplanner.framework.model.Cost; import org.opentripplanner.framework.model.Units; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * Preferences for renting a Bike, Car or other type of vehicle. diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/preference/VehicleWalkingPreferences.java b/application/src/main/java/org/opentripplanner/routing/api/request/preference/VehicleWalkingPreferences.java index b7adc04df1c..50b3735a85d 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/preference/VehicleWalkingPreferences.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/preference/VehicleWalkingPreferences.java @@ -6,7 +6,7 @@ import java.util.function.Consumer; import org.opentripplanner.framework.model.Cost; import org.opentripplanner.framework.model.Units; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * Preferences for walking a vehicle. diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/preference/WalkPreferences.java b/application/src/main/java/org/opentripplanner/routing/api/request/preference/WalkPreferences.java index 8e5061d752b..4a5969049ba 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/preference/WalkPreferences.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/preference/WalkPreferences.java @@ -1,13 +1,13 @@ package org.opentripplanner.routing.api.request.preference; -import static org.opentripplanner.framework.lang.DoubleUtils.doubleEquals; +import static org.opentripplanner.utils.lang.DoubleUtils.doubleEquals; import java.io.Serializable; import java.util.Objects; import java.util.function.Consumer; import org.opentripplanner.framework.model.Cost; import org.opentripplanner.framework.model.Units; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * The walk preferences contain all speed, reluctance, cost and factor preferences for walking diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/preference/WheelchairPreferences.java b/application/src/main/java/org/opentripplanner/routing/api/request/preference/WheelchairPreferences.java index 737c5057943..d8a53d8e098 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/preference/WheelchairPreferences.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/preference/WheelchairPreferences.java @@ -6,7 +6,7 @@ import java.util.Objects; import java.util.function.Consumer; import org.opentripplanner.framework.model.Units; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * See the configuration for documentation of each field. diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/preference/filter/VehicleParkingFilter.java b/application/src/main/java/org/opentripplanner/routing/api/request/preference/filter/VehicleParkingFilter.java index 3fb6d6b0a62..5f34dc4e1a7 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/preference/filter/VehicleParkingFilter.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/preference/filter/VehicleParkingFilter.java @@ -4,8 +4,8 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.routing.vehicle_parking.VehicleParking; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * A filter class that checks if parking faclities match certain conditions for diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/request/filter/SelectRequest.java b/application/src/main/java/org/opentripplanner/routing/api/request/request/filter/SelectRequest.java index a1610ed8947..8ae98b8dfc9 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/request/filter/SelectRequest.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/request/filter/SelectRequest.java @@ -4,12 +4,12 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.model.modes.AllowTransitModeFilter; import org.opentripplanner.transit.model.basic.MainAndSubMode; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.transit.model.network.TripPattern; import org.opentripplanner.transit.model.timetable.TripTimes; +import org.opentripplanner.utils.tostring.ToStringBuilder; public class SelectRequest implements Serializable { diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/request/filter/TransitFilterRequest.java b/application/src/main/java/org/opentripplanner/routing/api/request/request/filter/TransitFilterRequest.java index 38f79b82baa..6380ace7c83 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/request/filter/TransitFilterRequest.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/request/filter/TransitFilterRequest.java @@ -5,9 +5,9 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.transit.model.network.TripPattern; import org.opentripplanner.transit.model.timetable.TripTimes; +import org.opentripplanner.utils.tostring.ToStringBuilder; public class TransitFilterRequest implements Serializable, TransitFilter { diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/request/filter/TransitGroupSelect.java b/application/src/main/java/org/opentripplanner/routing/api/request/request/filter/TransitGroupSelect.java index dfa5daa0e31..caa8c9e0d65 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/request/filter/TransitGroupSelect.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/request/filter/TransitGroupSelect.java @@ -5,9 +5,9 @@ import java.util.Comparator; import java.util.List; import java.util.Objects; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.transit.model.basic.TransitMode; import org.opentripplanner.transit.model.framework.FeedScopedId; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * Select a given set of transit routes base on the list of diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/via/PassThroughViaLocation.java b/application/src/main/java/org/opentripplanner/routing/api/request/via/PassThroughViaLocation.java index aa75a634004..9da6ae5cd23 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/via/PassThroughViaLocation.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/via/PassThroughViaLocation.java @@ -2,8 +2,8 @@ import java.util.Collection; import javax.annotation.Nullable; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.transit.model.framework.FeedScopedId; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * One of the listed stop locations or one of its children must be visited. An on-board diff --git a/application/src/main/java/org/opentripplanner/routing/api/request/via/VisitViaLocation.java b/application/src/main/java/org/opentripplanner/routing/api/request/via/VisitViaLocation.java index 096fbfabc0b..550b1646aeb 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/request/via/VisitViaLocation.java +++ b/application/src/main/java/org/opentripplanner/routing/api/request/via/VisitViaLocation.java @@ -5,9 +5,9 @@ import java.util.Objects; import javax.annotation.Nullable; import org.opentripplanner.framework.geometry.WgsCoordinate; -import org.opentripplanner.framework.time.DurationUtils; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.transit.model.framework.FeedScopedId; +import org.opentripplanner.utils.time.DurationUtils; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * A visit-via-location is a physical visit to one of the stops or coordinates listed. An on-board diff --git a/application/src/main/java/org/opentripplanner/routing/api/response/RoutingError.java b/application/src/main/java/org/opentripplanner/routing/api/response/RoutingError.java index 2c948e1777c..d5c8173f09e 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/response/RoutingError.java +++ b/application/src/main/java/org/opentripplanner/routing/api/response/RoutingError.java @@ -1,7 +1,7 @@ package org.opentripplanner.routing.api.response; import java.util.Objects; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; public class RoutingError { diff --git a/application/src/main/java/org/opentripplanner/routing/api/response/RoutingResponse.java b/application/src/main/java/org/opentripplanner/routing/api/response/RoutingResponse.java index f7bcaca72e2..fe9f6457cf4 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/response/RoutingResponse.java +++ b/application/src/main/java/org/opentripplanner/routing/api/response/RoutingResponse.java @@ -1,10 +1,10 @@ package org.opentripplanner.routing.api.response; import java.util.List; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.model.plan.TripPlan; import org.opentripplanner.model.plan.paging.cursor.PageCursor; import org.opentripplanner.routing.framework.DebugTimingAggregator; +import org.opentripplanner.utils.tostring.ToStringBuilder; public class RoutingResponse { diff --git a/application/src/main/java/org/opentripplanner/routing/api/response/TripSearchMetadata.java b/application/src/main/java/org/opentripplanner/routing/api/response/TripSearchMetadata.java index a5eb5842f23..704a1cb8e18 100644 --- a/application/src/main/java/org/opentripplanner/routing/api/response/TripSearchMetadata.java +++ b/application/src/main/java/org/opentripplanner/routing/api/response/TripSearchMetadata.java @@ -4,7 +4,7 @@ import java.time.Instant; import java.time.temporal.ChronoUnit; import javax.annotation.Nullable; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * Meta-data about the trip search performed. diff --git a/application/src/main/java/org/opentripplanner/routing/graph/SerializedGraphObject.java b/application/src/main/java/org/opentripplanner/routing/graph/SerializedGraphObject.java index e7e0c3248e8..0843124131b 100644 --- a/application/src/main/java/org/opentripplanner/routing/graph/SerializedGraphObject.java +++ b/application/src/main/java/org/opentripplanner/routing/graph/SerializedGraphObject.java @@ -21,8 +21,6 @@ import org.opentripplanner.ext.stopconsolidation.StopConsolidationRepository; import org.opentripplanner.framework.application.OtpAppException; import org.opentripplanner.framework.geometry.CompactElevationProfile; -import org.opentripplanner.framework.lang.OtpNumberFormat; -import org.opentripplanner.framework.logging.ProgressTracker; import org.opentripplanner.graph_builder.issue.api.DataImportIssueSummary; import org.opentripplanner.model.projectinfo.GraphFileHeader; import org.opentripplanner.model.projectinfo.OtpProjectInfo; @@ -36,6 +34,8 @@ import org.opentripplanner.transit.model.basic.SubMode; import org.opentripplanner.transit.model.network.RoutingTripPattern; import org.opentripplanner.transit.service.TimetableRepository; +import org.opentripplanner.utils.lang.OtpNumberFormat; +import org.opentripplanner.utils.logging.ProgressTracker; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/routing/graph/index/StreetIndex.java b/application/src/main/java/org/opentripplanner/routing/graph/index/StreetIndex.java index 90294d554cc..b632cd5c3e9 100644 --- a/application/src/main/java/org/opentripplanner/routing/graph/index/StreetIndex.java +++ b/application/src/main/java/org/opentripplanner/routing/graph/index/StreetIndex.java @@ -19,7 +19,6 @@ import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.framework.i18n.LocalizedString; import org.opentripplanner.framework.i18n.NonLocalizedString; -import org.opentripplanner.framework.logging.ProgressTracker; import org.opentripplanner.model.GenericLocation; import org.opentripplanner.routing.api.request.StreetMode; import org.opentripplanner.routing.graph.Graph; @@ -42,6 +41,7 @@ import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.transit.model.site.RegularStop; import org.opentripplanner.transit.service.SiteRepository; +import org.opentripplanner.utils.logging.ProgressTracker; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/routing/graphfinder/PatternAtStop.java b/application/src/main/java/org/opentripplanner/routing/graphfinder/PatternAtStop.java index a8602a77737..c06e8bbcf91 100644 --- a/application/src/main/java/org/opentripplanner/routing/graphfinder/PatternAtStop.java +++ b/application/src/main/java/org/opentripplanner/routing/graphfinder/PatternAtStop.java @@ -6,13 +6,13 @@ import java.util.Base64; import java.util.List; import java.util.Objects; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.model.TripTimeOnDate; import org.opentripplanner.routing.stoptimes.ArrivalDeparture; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.transit.model.network.TripPattern; import org.opentripplanner.transit.model.site.StopLocation; import org.opentripplanner.transit.service.TransitService; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * A reference to a pattern at a specific stop. diff --git a/application/src/main/java/org/opentripplanner/routing/graphfinder/StopFinderTraverseVisitor.java b/application/src/main/java/org/opentripplanner/routing/graphfinder/StopFinderTraverseVisitor.java index 5c75e8c9322..854e33831ae 100644 --- a/application/src/main/java/org/opentripplanner/routing/graphfinder/StopFinderTraverseVisitor.java +++ b/application/src/main/java/org/opentripplanner/routing/graphfinder/StopFinderTraverseVisitor.java @@ -4,11 +4,11 @@ import java.util.List; import org.opentripplanner.astar.spi.SkipEdgeStrategy; import org.opentripplanner.astar.spi.TraverseVisitor; -import org.opentripplanner.framework.collection.ListUtils; import org.opentripplanner.street.model.edge.Edge; import org.opentripplanner.street.model.vertex.TransitStopVertex; import org.opentripplanner.street.model.vertex.Vertex; import org.opentripplanner.street.search.state.State; +import org.opentripplanner.utils.collection.ListUtils; /** * A TraverseVisitor used in finding stops while walking the street graph. diff --git a/application/src/main/java/org/opentripplanner/routing/service/DefaultRoutingService.java b/application/src/main/java/org/opentripplanner/routing/service/DefaultRoutingService.java index 01736aac80e..5f654d39deb 100644 --- a/application/src/main/java/org/opentripplanner/routing/service/DefaultRoutingService.java +++ b/application/src/main/java/org/opentripplanner/routing/service/DefaultRoutingService.java @@ -3,7 +3,6 @@ import java.time.ZoneId; import org.opentripplanner.framework.application.OTPRequestTimeoutException; import org.opentripplanner.framework.time.ZoneIdFallback; -import org.opentripplanner.framework.tostring.MultiLineToStringBuilder; import org.opentripplanner.model.plan.Itinerary; import org.opentripplanner.routing.algorithm.RoutingWorker; import org.opentripplanner.routing.algorithm.via.ViaRoutingWorker; @@ -13,6 +12,7 @@ import org.opentripplanner.routing.api.response.RoutingResponse; import org.opentripplanner.routing.api.response.ViaRoutingResponse; import org.opentripplanner.standalone.api.OtpServerRequestContext; +import org.opentripplanner.utils.tostring.MultiLineToStringBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/routing/stoptimes/StopTimesHelper.java b/application/src/main/java/org/opentripplanner/routing/stoptimes/StopTimesHelper.java index f11d92465a7..863e2fc6569 100644 --- a/application/src/main/java/org/opentripplanner/routing/stoptimes/StopTimesHelper.java +++ b/application/src/main/java/org/opentripplanner/routing/stoptimes/StopTimesHelper.java @@ -14,7 +14,6 @@ import java.util.Comparator; import java.util.List; import java.util.Queue; -import org.opentripplanner.framework.time.ServiceDateUtils; import org.opentripplanner.model.PickDrop; import org.opentripplanner.model.StopTimesInPattern; import org.opentripplanner.model.Timetable; @@ -24,6 +23,7 @@ import org.opentripplanner.transit.model.timetable.Trip; import org.opentripplanner.transit.model.timetable.TripTimes; import org.opentripplanner.transit.service.TransitService; +import org.opentripplanner.utils.time.ServiceDateUtils; public class StopTimesHelper { diff --git a/application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParking.java b/application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParking.java index 098af909296..4e71ecd1c68 100644 --- a/application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParking.java +++ b/application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParking.java @@ -9,10 +9,10 @@ import javax.annotation.Nullable; import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.framework.i18n.I18NString; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.model.calendar.openinghours.OHCalendar; import org.opentripplanner.street.search.TraverseMode; import org.opentripplanner.transit.model.framework.FeedScopedId; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * Vehicle parking locations, which may allow bicycle and/or car parking. diff --git a/application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingEntrance.java b/application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingEntrance.java index b91776b0265..f6bc584fb18 100644 --- a/application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingEntrance.java +++ b/application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingEntrance.java @@ -5,9 +5,9 @@ import javax.annotation.Nullable; import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.framework.i18n.I18NString; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.street.model.vertex.StreetVertex; import org.opentripplanner.transit.model.framework.FeedScopedId; +import org.opentripplanner.utils.tostring.ToStringBuilder; public class VehicleParkingEntrance implements Serializable { diff --git a/application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingGroup.java b/application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingGroup.java index 535f201a0de..74ffedc0dcb 100644 --- a/application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingGroup.java +++ b/application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingGroup.java @@ -4,8 +4,8 @@ import javax.annotation.Nullable; import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.framework.i18n.I18NString; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.transit.model.framework.FeedScopedId; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * Group of vehicle parking locations. diff --git a/application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingSpaces.java b/application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingSpaces.java index 8b21cc21f2c..eb50440651b 100644 --- a/application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingSpaces.java +++ b/application/src/main/java/org/opentripplanner/routing/vehicle_parking/VehicleParkingSpaces.java @@ -2,7 +2,7 @@ import java.io.Serializable; import java.util.Objects; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * The number of spaces by type. {@code null} if unknown. diff --git a/application/src/main/java/org/opentripplanner/service/paging/PagingService.java b/application/src/main/java/org/opentripplanner/service/paging/PagingService.java index 3aa8033105a..b9a11ab5ffa 100644 --- a/application/src/main/java/org/opentripplanner/service/paging/PagingService.java +++ b/application/src/main/java/org/opentripplanner/service/paging/PagingService.java @@ -5,7 +5,6 @@ import java.util.List; import java.util.Objects; import javax.annotation.Nullable; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.model.plan.Itinerary; import org.opentripplanner.model.plan.SortOrder; import org.opentripplanner.model.plan.paging.PagingSearchWindowAdjuster; @@ -14,6 +13,7 @@ import org.opentripplanner.model.plan.paging.cursor.PageCursorInput; import org.opentripplanner.model.plan.paging.cursor.PageType; import org.opentripplanner.routing.api.response.TripSearchMetadata; +import org.opentripplanner.utils.tostring.ToStringBuilder; public class PagingService { diff --git a/application/src/main/java/org/opentripplanner/service/vehiclerental/model/VehicleRentalStation.java b/application/src/main/java/org/opentripplanner/service/vehiclerental/model/VehicleRentalStation.java index d6e72023a31..ff17ee00593 100644 --- a/application/src/main/java/org/opentripplanner/service/vehiclerental/model/VehicleRentalStation.java +++ b/application/src/main/java/org/opentripplanner/service/vehiclerental/model/VehicleRentalStation.java @@ -9,10 +9,10 @@ import java.util.stream.Collectors; import java.util.stream.Stream; import org.locationtech.jts.geom.Geometry; -import org.opentripplanner.framework.collection.SetUtils; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.street.model.RentalFormFactor; import org.opentripplanner.transit.model.framework.FeedScopedId; +import org.opentripplanner.utils.collection.SetUtils; /** * Implements the {@link VehicleRentalPlace} class which contains Javadoc. diff --git a/application/src/main/java/org/opentripplanner/service/worldenvelope/model/WorldEnvelope.java b/application/src/main/java/org/opentripplanner/service/worldenvelope/model/WorldEnvelope.java index 27a1fb4d30f..55024b63982 100644 --- a/application/src/main/java/org/opentripplanner/service/worldenvelope/model/WorldEnvelope.java +++ b/application/src/main/java/org/opentripplanner/service/worldenvelope/model/WorldEnvelope.java @@ -3,7 +3,7 @@ import java.io.Serializable; import java.util.Optional; import org.opentripplanner.framework.geometry.WgsCoordinate; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * This class calculates borders of envelopes that can be also on 180th meridian. diff --git a/application/src/main/java/org/opentripplanner/standalone/config/BuildConfig.java b/application/src/main/java/org/opentripplanner/standalone/config/BuildConfig.java index ef2931b987e..16c6f1e722c 100644 --- a/application/src/main/java/org/opentripplanner/standalone/config/BuildConfig.java +++ b/application/src/main/java/org/opentripplanner/standalone/config/BuildConfig.java @@ -23,7 +23,6 @@ import org.opentripplanner.ext.emissions.EmissionsConfig; import org.opentripplanner.ext.fares.FaresConfiguration; import org.opentripplanner.framework.geometry.CompactElevationProfile; -import org.opentripplanner.framework.lang.ObjectUtils; import org.opentripplanner.graph_builder.module.ned.parameter.DemExtractParameters; import org.opentripplanner.graph_builder.module.ned.parameter.DemExtractParametersList; import org.opentripplanner.graph_builder.module.osm.parameters.OsmExtractParameters; @@ -46,6 +45,7 @@ import org.opentripplanner.standalone.config.framework.json.NodeAdapter; import org.opentripplanner.standalone.config.sandbox.DataOverlayConfigMapper; import org.opentripplanner.transit.model.framework.FeedScopedId; +import org.opentripplanner.utils.lang.ObjectUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/standalone/config/framework/json/ConfigType.java b/application/src/main/java/org/opentripplanner/standalone/config/framework/json/ConfigType.java index fec5cb05a51..3796fcac645 100644 --- a/application/src/main/java/org/opentripplanner/standalone/config/framework/json/ConfigType.java +++ b/application/src/main/java/org/opentripplanner/standalone/config/framework/json/ConfigType.java @@ -6,9 +6,9 @@ import java.util.EnumSet; import java.util.stream.Collectors; import javax.annotation.Nullable; -import org.opentripplanner.framework.lang.StringUtils; -import org.opentripplanner.framework.text.MarkdownFormatter; -import org.opentripplanner.framework.time.DurationUtils; +import org.opentripplanner.utils.lang.StringUtils; +import org.opentripplanner.utils.text.MarkdownFormatter; +import org.opentripplanner.utils.time.DurationUtils; /** * These are the types we support in the NodeAdaptor diff --git a/application/src/main/java/org/opentripplanner/standalone/config/framework/json/EnumMapper.java b/application/src/main/java/org/opentripplanner/standalone/config/framework/json/EnumMapper.java index c57220c41d5..c39c2ef7377 100644 --- a/application/src/main/java/org/opentripplanner/standalone/config/framework/json/EnumMapper.java +++ b/application/src/main/java/org/opentripplanner/standalone/config/framework/json/EnumMapper.java @@ -3,7 +3,7 @@ import java.util.Arrays; import java.util.Optional; import org.opentripplanner.framework.doc.DocumentedEnum; -import org.opentripplanner.framework.lang.StringUtils; +import org.opentripplanner.utils.lang.StringUtils; /** * This converts strings appearing in configuration files into enum values. diff --git a/application/src/main/java/org/opentripplanner/standalone/config/framework/json/NodeInfo.java b/application/src/main/java/org/opentripplanner/standalone/config/framework/json/NodeInfo.java index ce29639b924..b9db7fb75c8 100644 --- a/application/src/main/java/org/opentripplanner/standalone/config/framework/json/NodeInfo.java +++ b/application/src/main/java/org/opentripplanner/standalone/config/framework/json/NodeInfo.java @@ -6,8 +6,8 @@ import java.util.List; import java.util.Objects; import javax.annotation.Nullable; -import org.opentripplanner.framework.lang.StringUtils; -import org.opentripplanner.framework.tostring.ValueObjectToStringBuilder; +import org.opentripplanner.utils.lang.StringUtils; +import org.opentripplanner.utils.tostring.ValueObjectToStringBuilder; /** * Information about a configuration parameter. diff --git a/application/src/main/java/org/opentripplanner/standalone/config/framework/json/ParameterBuilder.java b/application/src/main/java/org/opentripplanner/standalone/config/framework/json/ParameterBuilder.java index 0afca602872..784d381a2e6 100644 --- a/application/src/main/java/org/opentripplanner/standalone/config/framework/json/ParameterBuilder.java +++ b/application/src/main/java/org/opentripplanner/standalone/config/framework/json/ParameterBuilder.java @@ -36,11 +36,11 @@ import java.util.function.Function; import java.util.regex.Pattern; import org.opentripplanner.framework.application.OtpAppException; -import org.opentripplanner.framework.time.DurationUtils; -import org.opentripplanner.framework.time.LocalDateUtils; import org.opentripplanner.routing.api.request.framework.CostLinearFunction; import org.opentripplanner.routing.api.request.framework.TimePenalty; import org.opentripplanner.transit.model.framework.FeedScopedId; +import org.opentripplanner.utils.time.DurationUtils; +import org.opentripplanner.utils.time.LocalDateUtils; /** * TODO RT_AB: add Javadoc to clarify whether this is building a declarative representation of the diff --git a/application/src/main/java/org/opentripplanner/standalone/config/routerequest/RouteRequestConfig.java b/application/src/main/java/org/opentripplanner/standalone/config/routerequest/RouteRequestConfig.java index dc91388458a..d05aee96ccf 100644 --- a/application/src/main/java/org/opentripplanner/standalone/config/routerequest/RouteRequestConfig.java +++ b/application/src/main/java/org/opentripplanner/standalone/config/routerequest/RouteRequestConfig.java @@ -18,7 +18,6 @@ import java.util.stream.Collectors; import org.opentripplanner.api.parameter.QualifiedModeSet; import org.opentripplanner.framework.application.OTPFeature; -import org.opentripplanner.framework.lang.StringUtils; import org.opentripplanner.routing.api.request.RequestModes; import org.opentripplanner.routing.api.request.RouteRequest; import org.opentripplanner.routing.api.request.StreetMode; @@ -35,6 +34,7 @@ import org.opentripplanner.standalone.config.framework.json.NodeAdapter; import org.opentripplanner.standalone.config.sandbox.DataOverlayParametersMapper; import org.opentripplanner.transit.model.basic.TransitMode; +import org.opentripplanner.utils.lang.StringUtils; public class RouteRequestConfig { diff --git a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java index 979467299cd..279c3c48368 100644 --- a/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java +++ b/application/src/main/java/org/opentripplanner/standalone/configure/ConstructApplication.java @@ -8,7 +8,6 @@ import org.opentripplanner.ext.stopconsolidation.StopConsolidationRepository; import org.opentripplanner.framework.application.LogMDCSupport; import org.opentripplanner.framework.application.OTPFeature; -import org.opentripplanner.framework.logging.ProgressTracker; import org.opentripplanner.graph_builder.GraphBuilder; import org.opentripplanner.graph_builder.GraphBuilderDataSources; import org.opentripplanner.graph_builder.issue.api.DataImportIssueSummary; @@ -35,6 +34,7 @@ import org.opentripplanner.transit.service.DefaultTransitService; import org.opentripplanner.transit.service.TimetableRepository; import org.opentripplanner.updater.configure.UpdaterConfigurator; +import org.opentripplanner.utils.logging.ProgressTracker; import org.opentripplanner.visualizer.GraphVisualizer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/standalone/server/EtagRequestFilter.java b/application/src/main/java/org/opentripplanner/standalone/server/EtagRequestFilter.java index 65cdec32a7d..b53739084ae 100644 --- a/application/src/main/java/org/opentripplanner/standalone/server/EtagRequestFilter.java +++ b/application/src/main/java/org/opentripplanner/standalone/server/EtagRequestFilter.java @@ -10,7 +10,7 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import org.apache.hc.core5.http.HttpStatus; -import org.opentripplanner.framework.text.HexString; +import org.opentripplanner.utils.text.HexString; public class EtagRequestFilter implements ContainerResponseFilter { diff --git a/application/src/main/java/org/opentripplanner/standalone/server/RequestTraceFilter.java b/application/src/main/java/org/opentripplanner/standalone/server/RequestTraceFilter.java index 8ee2e6bbd27..31d2745913b 100644 --- a/application/src/main/java/org/opentripplanner/standalone/server/RequestTraceFilter.java +++ b/application/src/main/java/org/opentripplanner/standalone/server/RequestTraceFilter.java @@ -12,7 +12,7 @@ import java.util.Random; import java.util.regex.Pattern; import org.opentripplanner.framework.application.LogMDCSupport; -import org.opentripplanner.framework.lang.StringUtils; +import org.opentripplanner.utils.lang.StringUtils; /** * This filter manages OTP request trace parameters. A trace parameter can be read from the diff --git a/application/src/main/java/org/opentripplanner/standalone/server/RequestTraceParameter.java b/application/src/main/java/org/opentripplanner/standalone/server/RequestTraceParameter.java index 98abe8c8091..6e1b3286dcc 100644 --- a/application/src/main/java/org/opentripplanner/standalone/server/RequestTraceParameter.java +++ b/application/src/main/java/org/opentripplanner/standalone/server/RequestTraceParameter.java @@ -1,6 +1,6 @@ package org.opentripplanner.standalone.server; -import org.opentripplanner.framework.lang.StringUtils; +import org.opentripplanner.utils.lang.StringUtils; /** * OTP supports tracing user requests across log events and "outside" services. It does so by diff --git a/application/src/main/java/org/opentripplanner/street/model/edge/ElevatorBoardEdge.java b/application/src/main/java/org/opentripplanner/street/model/edge/ElevatorBoardEdge.java index 81856476f2e..9bf0d67afa5 100644 --- a/application/src/main/java/org/opentripplanner/street/model/edge/ElevatorBoardEdge.java +++ b/application/src/main/java/org/opentripplanner/street/model/edge/ElevatorBoardEdge.java @@ -6,7 +6,6 @@ import org.opentripplanner.framework.geometry.GeometryUtils; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.framework.i18n.NonLocalizedString; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.street.model.vertex.ElevatorOffboardVertex; import org.opentripplanner.street.model.vertex.ElevatorOnboardVertex; import org.opentripplanner.street.search.state.State; diff --git a/application/src/main/java/org/opentripplanner/street/model/edge/ElevatorHopEdge.java b/application/src/main/java/org/opentripplanner/street/model/edge/ElevatorHopEdge.java index 4acecd05a64..75eddb53777 100644 --- a/application/src/main/java/org/opentripplanner/street/model/edge/ElevatorHopEdge.java +++ b/application/src/main/java/org/opentripplanner/street/model/edge/ElevatorHopEdge.java @@ -1,7 +1,6 @@ package org.opentripplanner.street.model.edge; import org.opentripplanner.framework.i18n.I18NString; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.routing.api.request.preference.RoutingPreferences; import org.opentripplanner.street.model.StreetTraversalPermission; import org.opentripplanner.street.model.vertex.Vertex; diff --git a/application/src/main/java/org/opentripplanner/street/model/edge/StreetEdge.java b/application/src/main/java/org/opentripplanner/street/model/edge/StreetEdge.java index 505d2a95a3a..fbd4173b68c 100644 --- a/application/src/main/java/org/opentripplanner/street/model/edge/StreetEdge.java +++ b/application/src/main/java/org/opentripplanner/street/model/edge/StreetEdge.java @@ -17,8 +17,6 @@ import org.opentripplanner.framework.geometry.SphericalDistanceLibrary; import org.opentripplanner.framework.geometry.SplitLineString; import org.opentripplanner.framework.i18n.I18NString; -import org.opentripplanner.framework.lang.BitSetUtils; -import org.opentripplanner.framework.lang.IntUtils; import org.opentripplanner.routing.api.request.preference.RoutingPreferences; import org.opentripplanner.routing.linking.DisposableEdgeCollection; import org.opentripplanner.routing.linking.LinkingDirection; @@ -36,6 +34,8 @@ import org.opentripplanner.street.search.state.State; import org.opentripplanner.street.search.state.StateEditor; import org.opentripplanner.street.search.state.VehicleRentalState; +import org.opentripplanner.utils.lang.BitSetUtils; +import org.opentripplanner.utils.lang.IntUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/street/model/edge/StreetEdgeBuilder.java b/application/src/main/java/org/opentripplanner/street/model/edge/StreetEdgeBuilder.java index b3173b7bed5..99a02205eb6 100644 --- a/application/src/main/java/org/opentripplanner/street/model/edge/StreetEdgeBuilder.java +++ b/application/src/main/java/org/opentripplanner/street/model/edge/StreetEdgeBuilder.java @@ -14,10 +14,10 @@ import org.locationtech.jts.geom.LineString; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.framework.i18n.NonLocalizedString; -import org.opentripplanner.framework.lang.BitSetUtils; import org.opentripplanner.street.model.StreetTraversalPermission; import org.opentripplanner.street.model.vertex.StreetVertex; import org.opentripplanner.street.search.TraverseMode; +import org.opentripplanner.utils.lang.BitSetUtils; public class StreetEdgeBuilder> { diff --git a/application/src/main/java/org/opentripplanner/street/model/edge/StreetElevationExtension.java b/application/src/main/java/org/opentripplanner/street/model/edge/StreetElevationExtension.java index 65ab72093ef..d741fb0a763 100644 --- a/application/src/main/java/org/opentripplanner/street/model/edge/StreetElevationExtension.java +++ b/application/src/main/java/org/opentripplanner/street/model/edge/StreetElevationExtension.java @@ -3,7 +3,7 @@ import java.io.Serializable; import org.locationtech.jts.geom.impl.PackedCoordinateSequence; import org.opentripplanner.framework.geometry.CompactElevationProfile; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; public class StreetElevationExtension implements Serializable { diff --git a/application/src/main/java/org/opentripplanner/street/model/edge/StreetTransitEntityLink.java b/application/src/main/java/org/opentripplanner/street/model/edge/StreetTransitEntityLink.java index 92897232700..5a62eda0f90 100644 --- a/application/src/main/java/org/opentripplanner/street/model/edge/StreetTransitEntityLink.java +++ b/application/src/main/java/org/opentripplanner/street/model/edge/StreetTransitEntityLink.java @@ -4,7 +4,6 @@ import org.locationtech.jts.geom.LineString; import org.opentripplanner.framework.geometry.GeometryUtils; import org.opentripplanner.framework.i18n.I18NString; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.routing.api.request.preference.RoutingPreferences; import org.opentripplanner.street.model.vertex.StreetVertex; import org.opentripplanner.street.model.vertex.Vertex; diff --git a/application/src/main/java/org/opentripplanner/street/model/edge/StreetVehicleParkingLink.java b/application/src/main/java/org/opentripplanner/street/model/edge/StreetVehicleParkingLink.java index e8fbae31b5f..682aeca0b3e 100644 --- a/application/src/main/java/org/opentripplanner/street/model/edge/StreetVehicleParkingLink.java +++ b/application/src/main/java/org/opentripplanner/street/model/edge/StreetVehicleParkingLink.java @@ -3,7 +3,6 @@ import org.locationtech.jts.geom.LineString; import org.opentripplanner.framework.geometry.GeometryUtils; import org.opentripplanner.framework.i18n.I18NString; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.routing.api.request.preference.VehicleParkingPreferences; import org.opentripplanner.routing.vehicle_parking.VehicleParking; import org.opentripplanner.street.model.vertex.StreetVertex; diff --git a/application/src/main/java/org/opentripplanner/street/model/note/StreetNoteAndMatcher.java b/application/src/main/java/org/opentripplanner/street/model/note/StreetNoteAndMatcher.java index 84d775aca3b..953645c46bc 100644 --- a/application/src/main/java/org/opentripplanner/street/model/note/StreetNoteAndMatcher.java +++ b/application/src/main/java/org/opentripplanner/street/model/note/StreetNoteAndMatcher.java @@ -2,7 +2,7 @@ import java.io.Serializable; import java.util.Objects; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * A container for a pair (note and note matcher). diff --git a/application/src/main/java/org/opentripplanner/street/model/vertex/IntersectionVertex.java b/application/src/main/java/org/opentripplanner/street/model/vertex/IntersectionVertex.java index baea576a85f..2a8582cbaab 100644 --- a/application/src/main/java/org/opentripplanner/street/model/vertex/IntersectionVertex.java +++ b/application/src/main/java/org/opentripplanner/street/model/vertex/IntersectionVertex.java @@ -1,6 +1,6 @@ package org.opentripplanner.street.model.vertex; -import org.opentripplanner.framework.lang.BitSetUtils; +import org.opentripplanner.utils.lang.BitSetUtils; /** * Represents an ordinary location in space, typically an intersection. diff --git a/application/src/main/java/org/opentripplanner/street/model/vertex/OsmBoardingLocationVertex.java b/application/src/main/java/org/opentripplanner/street/model/vertex/OsmBoardingLocationVertex.java index 8ba8b25c2b2..8d89ebbe8e0 100644 --- a/application/src/main/java/org/opentripplanner/street/model/vertex/OsmBoardingLocationVertex.java +++ b/application/src/main/java/org/opentripplanner/street/model/vertex/OsmBoardingLocationVertex.java @@ -5,7 +5,7 @@ import java.util.Set; import javax.annotation.Nullable; import org.opentripplanner.framework.i18n.I18NString; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * A vertex for an OSM node that represents a transit stop and has a tag to cross-reference this to diff --git a/application/src/main/java/org/opentripplanner/street/search/state/State.java b/application/src/main/java/org/opentripplanner/street/search/state/State.java index 6c7f342cad6..9413cbcbd57 100644 --- a/application/src/main/java/org/opentripplanner/street/search/state/State.java +++ b/application/src/main/java/org/opentripplanner/street/search/state/State.java @@ -1,6 +1,6 @@ package org.opentripplanner.street.search.state; -import static org.opentripplanner.framework.lang.ObjectUtils.requireNotInitialized; +import static org.opentripplanner.utils.lang.ObjectUtils.requireNotInitialized; import java.time.Instant; import java.util.ArrayList; @@ -11,7 +11,6 @@ import javax.annotation.Nullable; import org.opentripplanner.astar.spi.AStarState; import org.opentripplanner.ext.dataoverlay.routing.DataOverlayContext; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.routing.api.request.preference.RoutingPreferences; import org.opentripplanner.service.vehiclerental.street.VehicleRentalEdge; import org.opentripplanner.service.vehiclerental.street.VehicleRentalPlaceVertex; @@ -21,6 +20,7 @@ import org.opentripplanner.street.search.TraverseMode; import org.opentripplanner.street.search.intersection_model.IntersectionTraversalCalculator; import org.opentripplanner.street.search.request.StreetSearchRequest; +import org.opentripplanner.utils.tostring.ToStringBuilder; public class State implements AStarState, Cloneable { diff --git a/application/src/main/java/org/opentripplanner/transit/api/request/TripOnServiceDateRequest.java b/application/src/main/java/org/opentripplanner/transit/api/request/TripOnServiceDateRequest.java index 6735dc1db29..adc7283ee4d 100644 --- a/application/src/main/java/org/opentripplanner/transit/api/request/TripOnServiceDateRequest.java +++ b/application/src/main/java/org/opentripplanner/transit/api/request/TripOnServiceDateRequest.java @@ -2,9 +2,9 @@ import java.time.LocalDate; import java.util.List; -import org.opentripplanner.framework.collection.ListUtils; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.transit.model.timetable.TripAlteration; +import org.opentripplanner.utils.collection.ListUtils; /* * A request for trips on a specific service date. diff --git a/application/src/main/java/org/opentripplanner/transit/model/basic/Money.java b/application/src/main/java/org/opentripplanner/transit/model/basic/Money.java index de1c6647b6b..97d6f91be5a 100644 --- a/application/src/main/java/org/opentripplanner/transit/model/basic/Money.java +++ b/application/src/main/java/org/opentripplanner/transit/model/basic/Money.java @@ -8,7 +8,7 @@ import java.util.Locale; import java.util.Objects; import java.util.function.Function; -import org.opentripplanner.framework.lang.IntUtils; +import org.opentripplanner.utils.lang.IntUtils; /** * Represents an amount of money. diff --git a/application/src/main/java/org/opentripplanner/transit/model/framework/Deduplicator.java b/application/src/main/java/org/opentripplanner/transit/model/framework/Deduplicator.java index 587ad2871cd..69b5385ad86 100644 --- a/application/src/main/java/org/opentripplanner/transit/model/framework/Deduplicator.java +++ b/application/src/main/java/org/opentripplanner/transit/model/framework/Deduplicator.java @@ -14,7 +14,7 @@ import java.util.stream.Collectors; import java.util.stream.Stream; import javax.annotation.Nullable; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * Does the same thing as String.intern, but for several different types. Java's String.intern uses diff --git a/application/src/main/java/org/opentripplanner/transit/model/framework/FeedScopedId.java b/application/src/main/java/org/opentripplanner/transit/model/framework/FeedScopedId.java index bdb09cb0db8..be12be83548 100644 --- a/application/src/main/java/org/opentripplanner/transit/model/framework/FeedScopedId.java +++ b/application/src/main/java/org/opentripplanner/transit/model/framework/FeedScopedId.java @@ -1,12 +1,12 @@ package org.opentripplanner.transit.model.framework; -import static org.opentripplanner.framework.lang.StringUtils.assertHasValue; +import static org.opentripplanner.utils.lang.StringUtils.assertHasValue; import java.io.Serializable; import java.util.Arrays; import java.util.List; import javax.annotation.Nullable; -import org.opentripplanner.framework.lang.StringUtils; +import org.opentripplanner.utils.lang.StringUtils; public final class FeedScopedId implements Serializable, Comparable { diff --git a/application/src/main/java/org/opentripplanner/transit/model/network/Route.java b/application/src/main/java/org/opentripplanner/transit/model/network/Route.java index bd868fba10d..1daae1e6209 100644 --- a/application/src/main/java/org/opentripplanner/transit/model/network/Route.java +++ b/application/src/main/java/org/opentripplanner/transit/model/network/Route.java @@ -9,7 +9,6 @@ import java.util.Objects; import javax.annotation.Nullable; import org.opentripplanner.framework.i18n.I18NString; -import org.opentripplanner.framework.lang.IntUtils; import org.opentripplanner.transit.model.basic.SubMode; import org.opentripplanner.transit.model.basic.TransitMode; import org.opentripplanner.transit.model.framework.AbstractTransitEntity; @@ -18,6 +17,7 @@ import org.opentripplanner.transit.model.organization.Agency; import org.opentripplanner.transit.model.organization.Branding; import org.opentripplanner.transit.model.organization.Operator; +import org.opentripplanner.utils.lang.IntUtils; public final class Route extends AbstractTransitEntity implements LogInfo { diff --git a/application/src/main/java/org/opentripplanner/transit/model/network/StopPattern.java b/application/src/main/java/org/opentripplanner/transit/model/network/StopPattern.java index 7395d28419f..9df095d5170 100644 --- a/application/src/main/java/org/opentripplanner/transit/model/network/StopPattern.java +++ b/application/src/main/java/org/opentripplanner/transit/model/network/StopPattern.java @@ -9,13 +9,13 @@ import java.util.Optional; import java.util.function.Predicate; import javax.annotation.Nullable; -import org.opentripplanner.framework.lang.MemEfficientArrayBuilder; import org.opentripplanner.model.PickDrop; import org.opentripplanner.model.StopTime; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.transit.model.site.RegularStop; import org.opentripplanner.transit.model.site.Station; import org.opentripplanner.transit.model.site.StopLocation; +import org.opentripplanner.utils.lang.MemEfficientArrayBuilder; /** * This class represents what is called a JourneyPattern in Transmodel: the sequence of stops at diff --git a/application/src/main/java/org/opentripplanner/transit/model/network/TripPattern.java b/application/src/main/java/org/opentripplanner/transit/model/network/TripPattern.java index becf1686733..88d48d741f3 100644 --- a/application/src/main/java/org/opentripplanner/transit/model/network/TripPattern.java +++ b/application/src/main/java/org/opentripplanner/transit/model/network/TripPattern.java @@ -1,7 +1,7 @@ package org.opentripplanner.transit.model.network; import static java.util.Objects.requireNonNull; -import static org.opentripplanner.framework.lang.ObjectUtils.requireNotInitialized; +import static org.opentripplanner.utils.lang.ObjectUtils.requireNotInitialized; import java.util.ArrayList; import java.util.Collection; diff --git a/application/src/main/java/org/opentripplanner/transit/model/network/grouppriority/TransitGroupPriorityService.java b/application/src/main/java/org/opentripplanner/transit/model/network/grouppriority/TransitGroupPriorityService.java index 048b2279a88..e8172cdf546 100644 --- a/application/src/main/java/org/opentripplanner/transit/model/network/grouppriority/TransitGroupPriorityService.java +++ b/application/src/main/java/org/opentripplanner/transit/model/network/grouppriority/TransitGroupPriorityService.java @@ -7,12 +7,12 @@ import java.util.Collection; import java.util.List; import java.util.stream.Stream; -import org.opentripplanner.framework.lang.ArrayUtils; import org.opentripplanner.routing.api.request.framework.CostLinearFunction; import org.opentripplanner.routing.api.request.request.filter.TransitGroupSelect; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.transit.model.network.TripPattern; import org.opentripplanner.transit.model.timetable.Trip; +import org.opentripplanner.utils.lang.ArrayUtils; /** * This class dynamically builds an index of transit-group-ids from the provided diff --git a/application/src/main/java/org/opentripplanner/transit/model/organization/Agency.java b/application/src/main/java/org/opentripplanner/transit/model/organization/Agency.java index 4d82ab05e57..dc684511ca1 100644 --- a/application/src/main/java/org/opentripplanner/transit/model/organization/Agency.java +++ b/application/src/main/java/org/opentripplanner/transit/model/organization/Agency.java @@ -1,7 +1,7 @@ /* This file is based on code copied from project OneBusAway, see the LICENSE file for further information. */ package org.opentripplanner.transit.model.organization; -import static org.opentripplanner.framework.lang.StringUtils.assertHasValue; +import static org.opentripplanner.utils.lang.StringUtils.assertHasValue; import java.time.ZoneId; import java.util.Objects; diff --git a/application/src/main/java/org/opentripplanner/transit/model/organization/ContactInfo.java b/application/src/main/java/org/opentripplanner/transit/model/organization/ContactInfo.java index 01ad5047510..d54b38dba24 100644 --- a/application/src/main/java/org/opentripplanner/transit/model/organization/ContactInfo.java +++ b/application/src/main/java/org/opentripplanner/transit/model/organization/ContactInfo.java @@ -2,8 +2,8 @@ import java.util.Objects; import javax.annotation.Nullable; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.transit.model.framework.TransitObject; +import org.opentripplanner.utils.tostring.ToStringBuilder; public class ContactInfo implements TransitObject { diff --git a/application/src/main/java/org/opentripplanner/transit/model/organization/Operator.java b/application/src/main/java/org/opentripplanner/transit/model/organization/Operator.java index 399b726602f..35461fd7498 100644 --- a/application/src/main/java/org/opentripplanner/transit/model/organization/Operator.java +++ b/application/src/main/java/org/opentripplanner/transit/model/organization/Operator.java @@ -1,6 +1,6 @@ package org.opentripplanner.transit.model.organization; -import static org.opentripplanner.framework.lang.StringUtils.assertHasValue; +import static org.opentripplanner.utils.lang.StringUtils.assertHasValue; import java.util.Objects; import javax.annotation.Nullable; diff --git a/application/src/main/java/org/opentripplanner/transit/model/site/StopLocation.java b/application/src/main/java/org/opentripplanner/transit/model/site/StopLocation.java index d9c79732970..ecd0cf440b6 100644 --- a/application/src/main/java/org/opentripplanner/transit/model/site/StopLocation.java +++ b/application/src/main/java/org/opentripplanner/transit/model/site/StopLocation.java @@ -8,12 +8,12 @@ import org.locationtech.jts.geom.Geometry; import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.framework.i18n.I18NString; -import org.opentripplanner.framework.lang.ObjectUtils; import org.opentripplanner.transit.model.basic.Accessibility; import org.opentripplanner.transit.model.basic.SubMode; import org.opentripplanner.transit.model.basic.TransitMode; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.transit.model.framework.LogInfo; +import org.opentripplanner.utils.lang.ObjectUtils; /** * A StopLocation describes a place where a vehicle can be boarded or alighted, which is not diff --git a/application/src/main/java/org/opentripplanner/transit/model/site/StopLocationsGroup.java b/application/src/main/java/org/opentripplanner/transit/model/site/StopLocationsGroup.java index 3536f59e9b6..4158828e9a4 100644 --- a/application/src/main/java/org/opentripplanner/transit/model/site/StopLocationsGroup.java +++ b/application/src/main/java/org/opentripplanner/transit/model/site/StopLocationsGroup.java @@ -3,9 +3,9 @@ import java.util.Collection; import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.framework.i18n.I18NString; -import org.opentripplanner.framework.lang.ObjectUtils; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.transit.model.framework.LogInfo; +import org.opentripplanner.utils.lang.ObjectUtils; /** * A grouping of Stops referred to by the same name. No actual boarding or alighting happens at this diff --git a/application/src/main/java/org/opentripplanner/transit/model/timetable/ScheduledTripTimes.java b/application/src/main/java/org/opentripplanner/transit/model/timetable/ScheduledTripTimes.java index 3cae0c1678b..9a7298cd15e 100644 --- a/application/src/main/java/org/opentripplanner/transit/model/timetable/ScheduledTripTimes.java +++ b/application/src/main/java/org/opentripplanner/transit/model/timetable/ScheduledTripTimes.java @@ -13,14 +13,14 @@ import javax.annotation.Nullable; import org.opentripplanner.framework.error.OtpError; import org.opentripplanner.framework.i18n.I18NString; -import org.opentripplanner.framework.lang.IntUtils; -import org.opentripplanner.framework.time.DurationUtils; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.transit.model.basic.Accessibility; import org.opentripplanner.transit.model.framework.DataValidationException; import org.opentripplanner.transit.model.framework.Deduplicator; import org.opentripplanner.transit.model.framework.DeduplicatorService; import org.opentripplanner.transit.model.timetable.booking.BookingInfo; +import org.opentripplanner.utils.lang.IntUtils; +import org.opentripplanner.utils.time.DurationUtils; +import org.opentripplanner.utils.time.TimeUtils; /** * Regular/planed/scheduled read-only version of {@link TripTimes}. The set of static diff --git a/application/src/main/java/org/opentripplanner/transit/model/timetable/ScheduledTripTimesBuilder.java b/application/src/main/java/org/opentripplanner/transit/model/timetable/ScheduledTripTimesBuilder.java index 200afc27e8d..acca4a6a526 100644 --- a/application/src/main/java/org/opentripplanner/transit/model/timetable/ScheduledTripTimesBuilder.java +++ b/application/src/main/java/org/opentripplanner/transit/model/timetable/ScheduledTripTimesBuilder.java @@ -4,9 +4,9 @@ import java.util.List; import javax.annotation.Nullable; import org.opentripplanner.framework.i18n.I18NString; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.transit.model.framework.DeduplicatorService; import org.opentripplanner.transit.model.timetable.booking.BookingInfo; +import org.opentripplanner.utils.time.TimeUtils; public class ScheduledTripTimesBuilder { diff --git a/application/src/main/java/org/opentripplanner/transit/model/timetable/Trip.java b/application/src/main/java/org/opentripplanner/transit/model/timetable/Trip.java index 6e829e15866..c9bacc3a298 100644 --- a/application/src/main/java/org/opentripplanner/transit/model/timetable/Trip.java +++ b/application/src/main/java/org/opentripplanner/transit/model/timetable/Trip.java @@ -3,12 +3,11 @@ import static java.util.Objects.requireNonNull; import static java.util.Objects.requireNonNullElse; -import static org.opentripplanner.framework.lang.ObjectUtils.ifNotNull; +import static org.opentripplanner.utils.lang.ObjectUtils.ifNotNull; import java.util.Objects; import javax.annotation.Nullable; import org.opentripplanner.framework.i18n.I18NString; -import org.opentripplanner.framework.lang.StringUtils; import org.opentripplanner.transit.model.basic.Accessibility; import org.opentripplanner.transit.model.basic.SubMode; import org.opentripplanner.transit.model.basic.TransitMode; @@ -18,6 +17,7 @@ import org.opentripplanner.transit.model.network.BikeAccess; import org.opentripplanner.transit.model.network.Route; import org.opentripplanner.transit.model.organization.Operator; +import org.opentripplanner.utils.lang.StringUtils; /** * A Trip represents the movement of a public transport vehicle on a given {@link Route}, using a diff --git a/application/src/main/java/org/opentripplanner/transit/model/timetable/TripTimesStringBuilder.java b/application/src/main/java/org/opentripplanner/transit/model/timetable/TripTimesStringBuilder.java index a5e77037dea..143cb59ff31 100644 --- a/application/src/main/java/org/opentripplanner/transit/model/timetable/TripTimesStringBuilder.java +++ b/application/src/main/java/org/opentripplanner/transit/model/timetable/TripTimesStringBuilder.java @@ -1,8 +1,8 @@ package org.opentripplanner.transit.model.timetable; import java.util.ArrayList; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.transit.model.network.TripPattern; +import org.opentripplanner.utils.time.TimeUtils; public class TripTimesStringBuilder { diff --git a/application/src/main/java/org/opentripplanner/transit/model/timetable/booking/BookingInfo.java b/application/src/main/java/org/opentripplanner/transit/model/timetable/booking/BookingInfo.java index 3e23696b65a..b21543b717c 100644 --- a/application/src/main/java/org/opentripplanner/transit/model/timetable/booking/BookingInfo.java +++ b/application/src/main/java/org/opentripplanner/transit/model/timetable/booking/BookingInfo.java @@ -4,8 +4,8 @@ import java.time.Duration; import java.util.EnumSet; import javax.annotation.Nullable; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.transit.model.organization.ContactInfo; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * Info about how a trip might be booked at a particular stop. All of this is pass-through diff --git a/application/src/main/java/org/opentripplanner/transit/model/timetable/booking/BookingTime.java b/application/src/main/java/org/opentripplanner/transit/model/timetable/booking/BookingTime.java index 8034fe07388..d0f1558e0d4 100644 --- a/application/src/main/java/org/opentripplanner/transit/model/timetable/booking/BookingTime.java +++ b/application/src/main/java/org/opentripplanner/transit/model/timetable/booking/BookingTime.java @@ -3,7 +3,7 @@ import java.io.Serializable; import java.time.LocalTime; import java.util.Objects; -import org.opentripplanner.framework.time.TimeUtils; +import org.opentripplanner.utils.time.TimeUtils; /** * Represents either the earliest or latest time a trip can be booked relative to the departure day diff --git a/application/src/main/java/org/opentripplanner/transit/model/timetable/booking/RoutingBookingInfo.java b/application/src/main/java/org/opentripplanner/transit/model/timetable/booking/RoutingBookingInfo.java index 8dad53a0bde..471cff394e2 100644 --- a/application/src/main/java/org/opentripplanner/transit/model/timetable/booking/RoutingBookingInfo.java +++ b/application/src/main/java/org/opentripplanner/transit/model/timetable/booking/RoutingBookingInfo.java @@ -3,7 +3,7 @@ import java.time.Duration; import java.util.Objects; import javax.annotation.Nullable; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * This is the contract between booking info and the router. The router will enforce diff --git a/application/src/main/java/org/opentripplanner/transit/service/DefaultTransitService.java b/application/src/main/java/org/opentripplanner/transit/service/DefaultTransitService.java index 2ce99e7809b..5f7cfa95524 100644 --- a/application/src/main/java/org/opentripplanner/transit/service/DefaultTransitService.java +++ b/application/src/main/java/org/opentripplanner/transit/service/DefaultTransitService.java @@ -22,7 +22,6 @@ import org.locationtech.jts.geom.Envelope; import org.opentripplanner.ext.flex.FlexIndex; import org.opentripplanner.framework.application.OTPRequestTimeoutException; -import org.opentripplanner.framework.collection.CollectionsView; import org.opentripplanner.model.FeedInfo; import org.opentripplanner.model.PathTransfer; import org.opentripplanner.model.StopTimesInPattern; @@ -59,6 +58,7 @@ import org.opentripplanner.transit.model.timetable.TripIdAndServiceDate; import org.opentripplanner.transit.model.timetable.TripOnServiceDate; import org.opentripplanner.updater.GraphUpdaterStatus; +import org.opentripplanner.utils.collection.CollectionsView; /** * Default implementation of the Transit Service and Transit Editor Service. diff --git a/application/src/main/java/org/opentripplanner/transit/service/SiteRepository.java b/application/src/main/java/org/opentripplanner/transit/service/SiteRepository.java index 6c9d591933a..a2a4adea931 100644 --- a/application/src/main/java/org/opentripplanner/transit/service/SiteRepository.java +++ b/application/src/main/java/org/opentripplanner/transit/service/SiteRepository.java @@ -8,8 +8,6 @@ import java.util.concurrent.atomic.AtomicInteger; import javax.annotation.Nullable; import org.locationtech.jts.geom.Envelope; -import org.opentripplanner.framework.collection.CollectionsView; -import org.opentripplanner.framework.collection.MapUtils; import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.transit.model.site.AreaStop; @@ -20,6 +18,8 @@ import org.opentripplanner.transit.model.site.Station; import org.opentripplanner.transit.model.site.StopLocation; import org.opentripplanner.transit.model.site.StopLocationsGroup; +import org.opentripplanner.utils.collection.CollectionsView; +import org.opentripplanner.utils.collection.MapUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/transit/service/StopModelIndex.java b/application/src/main/java/org/opentripplanner/transit/service/StopModelIndex.java index 48048101b3d..13a8c0d278d 100644 --- a/application/src/main/java/org/opentripplanner/transit/service/StopModelIndex.java +++ b/application/src/main/java/org/opentripplanner/transit/service/StopModelIndex.java @@ -7,7 +7,6 @@ import java.util.Objects; import javax.annotation.Nullable; import org.locationtech.jts.geom.Envelope; -import org.opentripplanner.framework.collection.CollectionsView; import org.opentripplanner.framework.geometry.HashGridSpatialIndex; import org.opentripplanner.transit.model.site.AreaStop; import org.opentripplanner.transit.model.site.GroupStop; @@ -15,6 +14,7 @@ import org.opentripplanner.transit.model.site.RegularStop; import org.opentripplanner.transit.model.site.Station; import org.opentripplanner.transit.model.site.StopLocation; +import org.opentripplanner.utils.collection.CollectionsView; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.slf4j.event.Level; diff --git a/application/src/main/java/org/opentripplanner/transit/service/TimetableRepository.java b/application/src/main/java/org/opentripplanner/transit/service/TimetableRepository.java index 6dec0c09eb6..532bc2e6e8f 100644 --- a/application/src/main/java/org/opentripplanner/transit/service/TimetableRepository.java +++ b/application/src/main/java/org/opentripplanner/transit/service/TimetableRepository.java @@ -22,8 +22,6 @@ import java.util.Set; import javax.annotation.Nullable; import org.opentripplanner.ext.flex.trip.FlexTrip; -import org.opentripplanner.framework.lang.ObjectUtils; -import org.opentripplanner.framework.time.ServiceDateUtils; import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.graph_builder.issues.NoFutureDates; import org.opentripplanner.model.FeedInfo; @@ -51,6 +49,8 @@ import org.opentripplanner.transit.model.timetable.TripOnServiceDate; import org.opentripplanner.updater.GraphUpdaterManager; import org.opentripplanner.updater.configure.UpdaterConfigurator; +import org.opentripplanner.utils.lang.ObjectUtils; +import org.opentripplanner.utils.time.ServiceDateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/updater/GtfsRealtimeFuzzyTripMatcher.java b/application/src/main/java/org/opentripplanner/updater/GtfsRealtimeFuzzyTripMatcher.java index 6972bfb6208..96e2d25bbd8 100644 --- a/application/src/main/java/org/opentripplanner/updater/GtfsRealtimeFuzzyTripMatcher.java +++ b/application/src/main/java/org/opentripplanner/updater/GtfsRealtimeFuzzyTripMatcher.java @@ -4,8 +4,6 @@ import gnu.trove.set.TIntSet; import java.text.ParseException; import java.time.LocalDate; -import org.opentripplanner.framework.time.ServiceDateUtils; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.gtfs.mapping.DirectionMapper; import org.opentripplanner.transit.model.framework.FeedScopedId; @@ -15,6 +13,8 @@ import org.opentripplanner.transit.model.timetable.Trip; import org.opentripplanner.transit.model.timetable.TripTimes; import org.opentripplanner.transit.service.TransitService; +import org.opentripplanner.utils.time.ServiceDateUtils; +import org.opentripplanner.utils.time.TimeUtils; /** * This class is used for matching TripDescriptors without trip_ids to scheduled GTFS data and to diff --git a/application/src/main/java/org/opentripplanner/updater/alert/GtfsRealtimeAlertsUpdater.java b/application/src/main/java/org/opentripplanner/updater/alert/GtfsRealtimeAlertsUpdater.java index 23b6d741e10..b71dad6a656 100644 --- a/application/src/main/java/org/opentripplanner/updater/alert/GtfsRealtimeAlertsUpdater.java +++ b/application/src/main/java/org/opentripplanner/updater/alert/GtfsRealtimeAlertsUpdater.java @@ -4,13 +4,13 @@ import java.net.URI; import org.opentripplanner.framework.io.OtpHttpClient; import org.opentripplanner.framework.io.OtpHttpClientFactory; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.routing.impl.TransitAlertServiceImpl; import org.opentripplanner.routing.services.TransitAlertService; import org.opentripplanner.transit.service.TimetableRepository; import org.opentripplanner.updater.spi.HttpHeaders; import org.opentripplanner.updater.spi.PollingGraphUpdater; import org.opentripplanner.updater.spi.WriteToGraphCallback; +import org.opentripplanner.utils.tostring.ToStringBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/updater/siri/AddedTripBuilder.java b/application/src/main/java/org/opentripplanner/updater/siri/AddedTripBuilder.java index 3be1bcbc4a2..a1ca89f5c83 100644 --- a/application/src/main/java/org/opentripplanner/updater/siri/AddedTripBuilder.java +++ b/application/src/main/java/org/opentripplanner/updater/siri/AddedTripBuilder.java @@ -16,7 +16,6 @@ import java.util.function.Function; import javax.annotation.Nullable; import org.opentripplanner.framework.i18n.NonLocalizedString; -import org.opentripplanner.framework.time.ServiceDateUtils; import org.opentripplanner.model.StopTime; import org.opentripplanner.transit.model.basic.TransitMode; import org.opentripplanner.transit.model.framework.DataValidationException; @@ -37,6 +36,7 @@ import org.opentripplanner.updater.siri.mapper.PickDropMapper; import org.opentripplanner.updater.spi.DataValidationExceptionMapper; import org.opentripplanner.updater.spi.UpdateError; +import org.opentripplanner.utils.time.ServiceDateUtils; import org.rutebanken.netex.model.BusSubmodeEnumeration; import org.rutebanken.netex.model.RailSubmodeEnumeration; import org.slf4j.Logger; diff --git a/application/src/main/java/org/opentripplanner/updater/siri/DebugString.java b/application/src/main/java/org/opentripplanner/updater/siri/DebugString.java index e8265856245..fa5d45544e0 100644 --- a/application/src/main/java/org/opentripplanner/updater/siri/DebugString.java +++ b/application/src/main/java/org/opentripplanner/updater/siri/DebugString.java @@ -1,6 +1,6 @@ package org.opentripplanner.updater.siri; -import org.opentripplanner.framework.tostring.ToStringBuilder; +import org.opentripplanner.utils.tostring.ToStringBuilder; import uk.org.siri.siri20.DataFrameRefStructure; import uk.org.siri.siri20.DatedVehicleJourneyRef; import uk.org.siri.siri20.EstimatedVehicleJourney; diff --git a/application/src/main/java/org/opentripplanner/updater/siri/ModifiedTripBuilder.java b/application/src/main/java/org/opentripplanner/updater/siri/ModifiedTripBuilder.java index 68435290d1b..0f1475f7b50 100644 --- a/application/src/main/java/org/opentripplanner/updater/siri/ModifiedTripBuilder.java +++ b/application/src/main/java/org/opentripplanner/updater/siri/ModifiedTripBuilder.java @@ -10,7 +10,6 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import org.opentripplanner.framework.time.ServiceDateUtils; import org.opentripplanner.transit.model.framework.DataValidationException; import org.opentripplanner.transit.model.framework.Result; import org.opentripplanner.transit.model.network.StopPattern; @@ -23,6 +22,7 @@ import org.opentripplanner.updater.siri.mapper.PickDropMapper; import org.opentripplanner.updater.spi.DataValidationExceptionMapper; import org.opentripplanner.updater.spi.UpdateError; +import org.opentripplanner.utils.time.ServiceDateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import uk.org.siri.siri20.EstimatedVehicleJourney; diff --git a/application/src/main/java/org/opentripplanner/updater/siri/SiriFuzzyTripMatcher.java b/application/src/main/java/org/opentripplanner/updater/siri/SiriFuzzyTripMatcher.java index db3fa50e94c..604dceed408 100644 --- a/application/src/main/java/org/opentripplanner/updater/siri/SiriFuzzyTripMatcher.java +++ b/application/src/main/java/org/opentripplanner/updater/siri/SiriFuzzyTripMatcher.java @@ -11,7 +11,6 @@ import java.util.function.BiFunction; import java.util.stream.Collectors; import javax.annotation.Nullable; -import org.opentripplanner.framework.time.ServiceDateUtils; import org.opentripplanner.model.Timetable; import org.opentripplanner.model.calendar.CalendarService; import org.opentripplanner.transit.model.basic.TransitMode; @@ -21,6 +20,7 @@ import org.opentripplanner.transit.model.timetable.Trip; import org.opentripplanner.transit.model.timetable.TripTimes; import org.opentripplanner.transit.service.TransitService; +import org.opentripplanner.utils.time.ServiceDateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import uk.org.siri.siri20.EstimatedVehicleJourney; diff --git a/application/src/main/java/org/opentripplanner/updater/siri/TimetableHelper.java b/application/src/main/java/org/opentripplanner/updater/siri/TimetableHelper.java index 870316403f6..dad1bc9a243 100644 --- a/application/src/main/java/org/opentripplanner/updater/siri/TimetableHelper.java +++ b/application/src/main/java/org/opentripplanner/updater/siri/TimetableHelper.java @@ -5,9 +5,9 @@ import java.time.ZonedDateTime; import java.util.function.Supplier; import org.opentripplanner.framework.i18n.NonLocalizedString; -import org.opentripplanner.framework.time.ServiceDateUtils; import org.opentripplanner.transit.model.timetable.RealTimeTripTimes; import org.opentripplanner.updater.siri.mapper.OccupancyMapper; +import org.opentripplanner.utils.time.ServiceDateUtils; import uk.org.siri.siri20.NaturalLanguageStringStructure; import uk.org.siri.siri20.OccupancyEnumeration; diff --git a/application/src/main/java/org/opentripplanner/updater/siri/updater/google/GooglePubsubEstimatedTimetableSource.java b/application/src/main/java/org/opentripplanner/updater/siri/updater/google/GooglePubsubEstimatedTimetableSource.java index 4592d102d1d..b9812576fd8 100644 --- a/application/src/main/java/org/opentripplanner/updater/siri/updater/google/GooglePubsubEstimatedTimetableSource.java +++ b/application/src/main/java/org/opentripplanner/updater/siri/updater/google/GooglePubsubEstimatedTimetableSource.java @@ -29,9 +29,9 @@ import org.opentripplanner.framework.io.OtpHttpClientFactory; import org.opentripplanner.framework.retry.OtpRetry; import org.opentripplanner.framework.retry.OtpRetryBuilder; -import org.opentripplanner.framework.text.FileSizeToTextConverter; -import org.opentripplanner.framework.time.DurationUtils; import org.opentripplanner.updater.siri.updater.AsyncEstimatedTimetableSource; +import org.opentripplanner.utils.text.FileSizeToTextConverter; +import org.opentripplanner.utils.time.DurationUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import uk.org.siri.siri20.ServiceDelivery; diff --git a/application/src/main/java/org/opentripplanner/updater/siri/updater/google/SiriETGooglePubsubUpdaterParameters.java b/application/src/main/java/org/opentripplanner/updater/siri/updater/google/SiriETGooglePubsubUpdaterParameters.java index fc698142adc..2970ac114c0 100644 --- a/application/src/main/java/org/opentripplanner/updater/siri/updater/google/SiriETGooglePubsubUpdaterParameters.java +++ b/application/src/main/java/org/opentripplanner/updater/siri/updater/google/SiriETGooglePubsubUpdaterParameters.java @@ -3,8 +3,8 @@ import java.time.Duration; import java.util.Objects; import javax.annotation.Nullable; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.updater.trip.UrlUpdaterParameters; +import org.opentripplanner.utils.tostring.ToStringBuilder; public record SiriETGooglePubsubUpdaterParameters( String configRef, diff --git a/application/src/main/java/org/opentripplanner/updater/spi/ResultLogger.java b/application/src/main/java/org/opentripplanner/updater/spi/ResultLogger.java index 97af8d650bb..9ea737fa0e7 100644 --- a/application/src/main/java/org/opentripplanner/updater/spi/ResultLogger.java +++ b/application/src/main/java/org/opentripplanner/updater/spi/ResultLogger.java @@ -3,7 +3,7 @@ import static net.logstash.logback.argument.StructuredArguments.keyValue; import java.util.stream.Collectors; -import org.opentripplanner.framework.lang.DoubleUtils; +import org.opentripplanner.utils.lang.DoubleUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/updater/spi/UpdateSuccess.java b/application/src/main/java/org/opentripplanner/updater/spi/UpdateSuccess.java index 3e6135d88c0..6d797a9a650 100644 --- a/application/src/main/java/org/opentripplanner/updater/spi/UpdateSuccess.java +++ b/application/src/main/java/org/opentripplanner/updater/spi/UpdateSuccess.java @@ -3,7 +3,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; -import org.opentripplanner.framework.collection.ListUtils; +import org.opentripplanner.utils.collection.ListUtils; /** * The result of a successful application of a realtime update, for example for trips or diff --git a/application/src/main/java/org/opentripplanner/updater/trip/GtfsRealtimeTripUpdateSource.java b/application/src/main/java/org/opentripplanner/updater/trip/GtfsRealtimeTripUpdateSource.java index 48f2d39ccc4..0b20a4c22c7 100644 --- a/application/src/main/java/org/opentripplanner/updater/trip/GtfsRealtimeTripUpdateSource.java +++ b/application/src/main/java/org/opentripplanner/updater/trip/GtfsRealtimeTripUpdateSource.java @@ -14,8 +14,8 @@ import java.util.List; import org.opentripplanner.framework.io.OtpHttpClient; import org.opentripplanner.framework.io.OtpHttpClientFactory; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.updater.spi.HttpHeaders; +import org.opentripplanner.utils.tostring.ToStringBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/updater/trip/MqttGtfsRealtimeUpdater.java b/application/src/main/java/org/opentripplanner/updater/trip/MqttGtfsRealtimeUpdater.java index e1c8bf4ea83..20b49ed022f 100644 --- a/application/src/main/java/org/opentripplanner/updater/trip/MqttGtfsRealtimeUpdater.java +++ b/application/src/main/java/org/opentripplanner/updater/trip/MqttGtfsRealtimeUpdater.java @@ -16,11 +16,11 @@ import org.eclipse.paho.client.mqttv3.MqttException; import org.eclipse.paho.client.mqttv3.MqttMessage; import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.updater.spi.GraphUpdater; import org.opentripplanner.updater.spi.UpdateResult; import org.opentripplanner.updater.spi.WriteToGraphCallback; import org.opentripplanner.updater.trip.metrics.TripUpdateMetrics; +import org.opentripplanner.utils.tostring.ToStringBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/updater/trip/PollingTripUpdater.java b/application/src/main/java/org/opentripplanner/updater/trip/PollingTripUpdater.java index 71f93235e01..c725c8b1088 100644 --- a/application/src/main/java/org/opentripplanner/updater/trip/PollingTripUpdater.java +++ b/application/src/main/java/org/opentripplanner/updater/trip/PollingTripUpdater.java @@ -3,11 +3,11 @@ import com.google.transit.realtime.GtfsRealtime.TripUpdate; import java.util.List; import java.util.function.Consumer; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.updater.spi.PollingGraphUpdater; import org.opentripplanner.updater.spi.UpdateResult; import org.opentripplanner.updater.spi.WriteToGraphCallback; import org.opentripplanner.updater.trip.metrics.BatchTripUpdateMetrics; +import org.opentripplanner.utils.tostring.ToStringBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/updater/trip/TimetableSnapshotSource.java b/application/src/main/java/org/opentripplanner/updater/trip/TimetableSnapshotSource.java index f83fa9d247e..54c3901f3e8 100644 --- a/application/src/main/java/org/opentripplanner/updater/trip/TimetableSnapshotSource.java +++ b/application/src/main/java/org/opentripplanner/updater/trip/TimetableSnapshotSource.java @@ -37,8 +37,6 @@ import java.util.function.Supplier; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.framework.i18n.NonLocalizedString; -import org.opentripplanner.framework.lang.StringUtils; -import org.opentripplanner.framework.time.ServiceDateUtils; import org.opentripplanner.gtfs.mapping.TransitModeMapper; import org.opentripplanner.model.RealTimeTripUpdate; import org.opentripplanner.model.StopTime; @@ -70,6 +68,8 @@ import org.opentripplanner.updater.spi.UpdateError; import org.opentripplanner.updater.spi.UpdateResult; import org.opentripplanner.updater.spi.UpdateSuccess; +import org.opentripplanner.utils.lang.StringUtils; +import org.opentripplanner.utils.time.ServiceDateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/updater/vehicle_parking/AvailabiltyUpdate.java b/application/src/main/java/org/opentripplanner/updater/vehicle_parking/AvailabiltyUpdate.java index a9d352cbaf2..414a62938ba 100644 --- a/application/src/main/java/org/opentripplanner/updater/vehicle_parking/AvailabiltyUpdate.java +++ b/application/src/main/java/org/opentripplanner/updater/vehicle_parking/AvailabiltyUpdate.java @@ -1,8 +1,8 @@ package org.opentripplanner.updater.vehicle_parking; import java.util.Objects; -import org.opentripplanner.framework.lang.IntUtils; import org.opentripplanner.transit.model.framework.FeedScopedId; +import org.opentripplanner.utils.lang.IntUtils; public record AvailabiltyUpdate(FeedScopedId vehicleParkingId, int spacesAvailable) { public AvailabiltyUpdate { diff --git a/application/src/main/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdater.java b/application/src/main/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdater.java index 96544321735..b23f46522c3 100644 --- a/application/src/main/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdater.java +++ b/application/src/main/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingAvailabilityUpdater.java @@ -4,7 +4,6 @@ import java.util.Map; import java.util.function.Function; import java.util.stream.Collectors; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.routing.vehicle_parking.VehicleParking; import org.opentripplanner.routing.vehicle_parking.VehicleParkingService; import org.opentripplanner.routing.vehicle_parking.VehicleParkingSpaces; @@ -14,6 +13,7 @@ import org.opentripplanner.updater.spi.DataSource; import org.opentripplanner.updater.spi.PollingGraphUpdater; import org.opentripplanner.updater.spi.WriteToGraphCallback; +import org.opentripplanner.utils.tostring.ToStringBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingUpdater.java b/application/src/main/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingUpdater.java index 59aea16e928..830429151b4 100644 --- a/application/src/main/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingUpdater.java +++ b/application/src/main/java/org/opentripplanner/updater/vehicle_parking/VehicleParkingUpdater.java @@ -8,7 +8,6 @@ import java.util.Set; import java.util.function.Function; import java.util.stream.Collectors; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.linking.DisposableEdgeCollection; import org.opentripplanner.routing.linking.LinkingDirection; @@ -28,6 +27,7 @@ import org.opentripplanner.updater.spi.DataSource; import org.opentripplanner.updater.spi.PollingGraphUpdater; import org.opentripplanner.updater.spi.WriteToGraphCallback; +import org.opentripplanner.utils.tostring.ToStringBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/updater/vehicle_position/GtfsRealtimeHttpVehiclePositionSource.java b/application/src/main/java/org/opentripplanner/updater/vehicle_position/GtfsRealtimeHttpVehiclePositionSource.java index ec0be6822e7..31ae9a32faf 100644 --- a/application/src/main/java/org/opentripplanner/updater/vehicle_position/GtfsRealtimeHttpVehiclePositionSource.java +++ b/application/src/main/java/org/opentripplanner/updater/vehicle_position/GtfsRealtimeHttpVehiclePositionSource.java @@ -10,8 +10,8 @@ import org.opentripplanner.framework.io.OtpHttpClient; import org.opentripplanner.framework.io.OtpHttpClientException; import org.opentripplanner.framework.io.OtpHttpClientFactory; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.updater.spi.HttpHeaders; +import org.opentripplanner.utils.tostring.ToStringBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/updater/vehicle_position/PollingVehiclePositionUpdater.java b/application/src/main/java/org/opentripplanner/updater/vehicle_position/PollingVehiclePositionUpdater.java index c2860d1d091..4c487ac997b 100644 --- a/application/src/main/java/org/opentripplanner/updater/vehicle_position/PollingVehiclePositionUpdater.java +++ b/application/src/main/java/org/opentripplanner/updater/vehicle_position/PollingVehiclePositionUpdater.java @@ -3,12 +3,12 @@ import com.google.transit.realtime.GtfsRealtime.VehiclePosition; import java.util.List; import java.util.Set; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.service.realtimevehicles.RealtimeVehicleRepository; import org.opentripplanner.service.realtimevehicles.model.RealtimeVehicle; import org.opentripplanner.standalone.config.routerconfig.updaters.VehiclePositionsUpdaterConfig; import org.opentripplanner.updater.spi.PollingGraphUpdater; import org.opentripplanner.updater.spi.WriteToGraphCallback; +import org.opentripplanner.utils.tostring.ToStringBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/updater/vehicle_position/RealtimeVehiclePatternMatcher.java b/application/src/main/java/org/opentripplanner/updater/vehicle_position/RealtimeVehiclePatternMatcher.java index 0723adc91b8..27ee0d479ab 100644 --- a/application/src/main/java/org/opentripplanner/updater/vehicle_position/RealtimeVehiclePatternMatcher.java +++ b/application/src/main/java/org/opentripplanner/updater/vehicle_position/RealtimeVehiclePatternMatcher.java @@ -30,8 +30,6 @@ import java.util.stream.Collectors; import java.util.stream.Stream; import org.opentripplanner.framework.geometry.WgsCoordinate; -import org.opentripplanner.framework.lang.StringUtils; -import org.opentripplanner.framework.time.ServiceDateUtils; import org.opentripplanner.service.realtimevehicles.RealtimeVehicleRepository; import org.opentripplanner.service.realtimevehicles.model.RealtimeVehicle; import org.opentripplanner.service.realtimevehicles.model.RealtimeVehicle.StopStatus; @@ -48,6 +46,8 @@ import org.opentripplanner.updater.spi.UpdateError; import org.opentripplanner.updater.spi.UpdateResult; import org.opentripplanner.updater.spi.UpdateSuccess; +import org.opentripplanner.utils.lang.StringUtils; +import org.opentripplanner.utils.time.ServiceDateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/updater/vehicle_rental/VehicleRentalUpdater.java b/application/src/main/java/org/opentripplanner/updater/vehicle_rental/VehicleRentalUpdater.java index 77c3c8d01c6..24686edce6c 100644 --- a/application/src/main/java/org/opentripplanner/updater/vehicle_rental/VehicleRentalUpdater.java +++ b/application/src/main/java/org/opentripplanner/updater/vehicle_rental/VehicleRentalUpdater.java @@ -10,11 +10,6 @@ import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; -import org.opentripplanner.framework.lang.ObjectUtils; -import org.opentripplanner.framework.logging.Throttle; -import org.opentripplanner.framework.time.DurationUtils; -import org.opentripplanner.framework.time.TimeUtils; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.routing.linking.DisposableEdgeCollection; import org.opentripplanner.routing.linking.LinkingDirection; import org.opentripplanner.routing.linking.VertexLinker; @@ -37,6 +32,11 @@ import org.opentripplanner.updater.spi.UpdaterConstructionException; import org.opentripplanner.updater.spi.WriteToGraphCallback; import org.opentripplanner.updater.vehicle_rental.datasources.VehicleRentalDatasource; +import org.opentripplanner.utils.lang.ObjectUtils; +import org.opentripplanner.utils.logging.Throttle; +import org.opentripplanner.utils.time.DurationUtils; +import org.opentripplanner.utils.time.TimeUtils; +import org.opentripplanner.utils.tostring.ToStringBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/updater/vehicle_rental/datasources/GbfsGeofencingZoneMapper.java b/application/src/main/java/org/opentripplanner/updater/vehicle_rental/datasources/GbfsGeofencingZoneMapper.java index 22a4131f338..934243a1e76 100644 --- a/application/src/main/java/org/opentripplanner/updater/vehicle_rental/datasources/GbfsGeofencingZoneMapper.java +++ b/application/src/main/java/org/opentripplanner/updater/vehicle_rental/datasources/GbfsGeofencingZoneMapper.java @@ -10,9 +10,9 @@ import org.mobilitydata.gbfs.v2_3.geofencing_zones.GBFSGeofencingZones; import org.opentripplanner.framework.geometry.GeometryUtils; import org.opentripplanner.framework.geometry.UnsupportedGeometryException; -import org.opentripplanner.framework.lang.StringUtils; import org.opentripplanner.service.vehiclerental.model.GeofencingZone; import org.opentripplanner.transit.model.framework.FeedScopedId; +import org.opentripplanner.utils.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/main/java/org/opentripplanner/updater/vehicle_rental/datasources/GbfsVehicleRentalDataSource.java b/application/src/main/java/org/opentripplanner/updater/vehicle_rental/datasources/GbfsVehicleRentalDataSource.java index c441efb974a..e3e86981bc8 100644 --- a/application/src/main/java/org/opentripplanner/updater/vehicle_rental/datasources/GbfsVehicleRentalDataSource.java +++ b/application/src/main/java/org/opentripplanner/updater/vehicle_rental/datasources/GbfsVehicleRentalDataSource.java @@ -17,12 +17,12 @@ import org.opentripplanner.framework.application.OTPFeature; import org.opentripplanner.framework.io.OtpHttpClient; import org.opentripplanner.framework.io.OtpHttpClientFactory; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.service.vehiclerental.model.GeofencingZone; import org.opentripplanner.service.vehiclerental.model.RentalVehicleType; import org.opentripplanner.service.vehiclerental.model.VehicleRentalPlace; import org.opentripplanner.service.vehiclerental.model.VehicleRentalSystem; import org.opentripplanner.updater.vehicle_rental.datasources.params.GbfsVehicleRentalDataSourceParameters; +import org.opentripplanner.utils.tostring.ToStringBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/test/java/org/opentripplanner/DateTimeHelper.java b/application/src/test/java/org/opentripplanner/DateTimeHelper.java index 6a058118d1b..2751af48daf 100644 --- a/application/src/test/java/org/opentripplanner/DateTimeHelper.java +++ b/application/src/test/java/org/opentripplanner/DateTimeHelper.java @@ -3,7 +3,7 @@ import java.time.LocalDate; import java.time.ZoneId; import java.time.ZonedDateTime; -import org.opentripplanner.framework.time.DateUtils; +import org.opentripplanner.utils.time.DateUtils; public class DateTimeHelper { diff --git a/application/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java b/application/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java index 406217e6604..3aad9075f73 100644 --- a/application/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java +++ b/application/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java @@ -38,7 +38,6 @@ import org.opentripplanner._support.time.ZoneIds; import org.opentripplanner.ext.fares.FaresToItineraryMapper; import org.opentripplanner.ext.fares.impl.DefaultFareService; -import org.opentripplanner.framework.collection.ListUtils; import org.opentripplanner.framework.geometry.WgsCoordinate; import org.opentripplanner.framework.i18n.I18NString; import org.opentripplanner.framework.i18n.NonLocalizedString; @@ -97,6 +96,7 @@ import org.opentripplanner.transit.service.TimetableRepository; import org.opentripplanner.transit.service.TransitEditorService; import org.opentripplanner.transit.service.TransitService; +import org.opentripplanner.utils.collection.ListUtils; class GraphQLIntegrationTest { diff --git a/application/src/test/java/org/opentripplanner/apis/transmodel/mapping/TripRequestMapperTest.java b/application/src/test/java/org/opentripplanner/apis/transmodel/mapping/TripRequestMapperTest.java index 593fb622adc..84743571cc3 100644 --- a/application/src/test/java/org/opentripplanner/apis/transmodel/mapping/TripRequestMapperTest.java +++ b/application/src/test/java/org/opentripplanner/apis/transmodel/mapping/TripRequestMapperTest.java @@ -5,8 +5,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.opentripplanner.framework.time.TimeUtils.time; import static org.opentripplanner.model.plan.TestItineraryBuilder.newItinerary; +import static org.opentripplanner.utils.time.TimeUtils.time; import graphql.ExecutionInput; import graphql.execution.ExecutionId; diff --git a/application/src/test/java/org/opentripplanner/apis/transmodel/model/plan/TripPlanTimePenaltyDtoTest.java b/application/src/test/java/org/opentripplanner/apis/transmodel/model/plan/TripPlanTimePenaltyDtoTest.java index 58054a3c778..0548bde0612 100644 --- a/application/src/test/java/org/opentripplanner/apis/transmodel/model/plan/TripPlanTimePenaltyDtoTest.java +++ b/application/src/test/java/org/opentripplanner/apis/transmodel/model/plan/TripPlanTimePenaltyDtoTest.java @@ -7,11 +7,11 @@ import org.junit.jupiter.api.Test; import org.opentripplanner.framework.model.Cost; import org.opentripplanner.framework.model.TimeAndCost; -import org.opentripplanner.framework.time.DurationUtils; import org.opentripplanner.model.plan.Itinerary; import org.opentripplanner.model.plan.Place; import org.opentripplanner.model.plan.TestItineraryBuilder; import org.opentripplanner.transit.model._data.TimetableRepositoryForTest; +import org.opentripplanner.utils.time.DurationUtils; class TripPlanTimePenaltyDtoTest { diff --git a/application/src/test/java/org/opentripplanner/apis/transmodel/support/ExecutionResultMapperTest.java b/application/src/test/java/org/opentripplanner/apis/transmodel/support/ExecutionResultMapperTest.java index b697adc9288..7cc373e5145 100644 --- a/application/src/test/java/org/opentripplanner/apis/transmodel/support/ExecutionResultMapperTest.java +++ b/application/src/test/java/org/opentripplanner/apis/transmodel/support/ExecutionResultMapperTest.java @@ -1,7 +1,7 @@ package org.opentripplanner.apis.transmodel.support; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.opentripplanner.framework.lang.StringUtils.quoteReplace; +import static org.opentripplanner.utils.lang.StringUtils.quoteReplace; import graphql.ExecutionResult; import graphql.GraphQLError; diff --git a/application/src/test/java/org/opentripplanner/datastore/OtpDataStoreTest.java b/application/src/test/java/org/opentripplanner/datastore/OtpDataStoreTest.java index 1733a97777b..d7afc55a556 100644 --- a/application/src/test/java/org/opentripplanner/datastore/OtpDataStoreTest.java +++ b/application/src/test/java/org/opentripplanner/datastore/OtpDataStoreTest.java @@ -34,8 +34,8 @@ import org.opentripplanner.datastore.api.FileType; import org.opentripplanner.datastore.api.OtpDataStoreConfig; import org.opentripplanner.datastore.configure.DataStoreModule; -import org.opentripplanner.framework.lang.StringUtils; import org.opentripplanner.standalone.config.OtpConfigLoader; +import org.opentripplanner.utils.lang.StringUtils; public class OtpDataStoreTest { diff --git a/application/src/test/java/org/opentripplanner/framework/model/TimeAndCostTest.java b/application/src/test/java/org/opentripplanner/framework/model/TimeAndCostTest.java index 4660da480b2..5eca02043ef 100644 --- a/application/src/test/java/org/opentripplanner/framework/model/TimeAndCostTest.java +++ b/application/src/test/java/org/opentripplanner/framework/model/TimeAndCostTest.java @@ -6,7 +6,7 @@ import java.time.Duration; import org.junit.jupiter.api.Test; -import org.opentripplanner.framework.time.DurationUtils; +import org.opentripplanner.utils.time.DurationUtils; class TimeAndCostTest { diff --git a/application/src/test/java/org/opentripplanner/framework/token/TestTokenSchemaConstants.java b/application/src/test/java/org/opentripplanner/framework/token/TestTokenSchemaConstants.java index 09ac58a0d2d..94303a28e14 100644 --- a/application/src/test/java/org/opentripplanner/framework/token/TestTokenSchemaConstants.java +++ b/application/src/test/java/org/opentripplanner/framework/token/TestTokenSchemaConstants.java @@ -3,7 +3,7 @@ import java.time.Duration; import java.time.Instant; import java.time.Month; -import org.opentripplanner.framework.time.DurationUtils; +import org.opentripplanner.utils.time.DurationUtils; public interface TestTokenSchemaConstants { // Token field names. These are used to reference a specific field value in theString BYTE_FIELD = "AByte"; diff --git a/application/src/test/java/org/opentripplanner/generate/doc/BuildConfigurationDocTest.java b/application/src/test/java/org/opentripplanner/generate/doc/BuildConfigurationDocTest.java index 8189f18f20e..a44d013fd03 100644 --- a/application/src/test/java/org/opentripplanner/generate/doc/BuildConfigurationDocTest.java +++ b/application/src/test/java/org/opentripplanner/generate/doc/BuildConfigurationDocTest.java @@ -3,13 +3,13 @@ import static org.opentripplanner.framework.io.FileUtils.assertFileEquals; import static org.opentripplanner.framework.io.FileUtils.readFile; import static org.opentripplanner.framework.io.FileUtils.writeFile; -import static org.opentripplanner.framework.text.MarkdownFormatter.HEADER_3; import static org.opentripplanner.generate.doc.framework.DocsTestConstants.TEMPLATE_PATH; import static org.opentripplanner.generate.doc.framework.DocsTestConstants.USER_DOC_PATH; import static org.opentripplanner.generate.doc.framework.TemplateUtil.replaceJsonExample; import static org.opentripplanner.generate.doc.framework.TemplateUtil.replaceParametersDetails; import static org.opentripplanner.generate.doc.framework.TemplateUtil.replaceParametersTable; import static org.opentripplanner.standalone.config.framework.json.JsonSupport.jsonNodeFromResource; +import static org.opentripplanner.utils.text.MarkdownFormatter.HEADER_3; import java.io.File; import org.junit.jupiter.api.Test; diff --git a/application/src/test/java/org/opentripplanner/generate/doc/EmissionsConfigurationDocTest.java b/application/src/test/java/org/opentripplanner/generate/doc/EmissionsConfigurationDocTest.java index 5010c78d527..94f0679cdfc 100644 --- a/application/src/test/java/org/opentripplanner/generate/doc/EmissionsConfigurationDocTest.java +++ b/application/src/test/java/org/opentripplanner/generate/doc/EmissionsConfigurationDocTest.java @@ -3,11 +3,11 @@ import static org.opentripplanner.framework.io.FileUtils.assertFileEquals; import static org.opentripplanner.framework.io.FileUtils.readFile; import static org.opentripplanner.framework.io.FileUtils.writeFile; -import static org.opentripplanner.framework.text.MarkdownFormatter.HEADER_4; import static org.opentripplanner.generate.doc.framework.DocsTestConstants.TEMPLATE_PATH; import static org.opentripplanner.generate.doc.framework.DocsTestConstants.USER_DOC_PATH; import static org.opentripplanner.generate.doc.framework.TemplateUtil.replaceSection; import static org.opentripplanner.standalone.config.framework.json.JsonSupport.jsonNodeFromResource; +import static org.opentripplanner.utils.text.MarkdownFormatter.HEADER_4; import java.io.File; import org.junit.jupiter.api.Test; diff --git a/application/src/test/java/org/opentripplanner/generate/doc/FlexConfigurationDocTest.java b/application/src/test/java/org/opentripplanner/generate/doc/FlexConfigurationDocTest.java index e18090466b9..1958d200ca3 100644 --- a/application/src/test/java/org/opentripplanner/generate/doc/FlexConfigurationDocTest.java +++ b/application/src/test/java/org/opentripplanner/generate/doc/FlexConfigurationDocTest.java @@ -3,11 +3,11 @@ import static org.opentripplanner.framework.io.FileUtils.assertFileEquals; import static org.opentripplanner.framework.io.FileUtils.readFile; import static org.opentripplanner.framework.io.FileUtils.writeFile; -import static org.opentripplanner.framework.text.MarkdownFormatter.HEADER_4; import static org.opentripplanner.generate.doc.framework.DocsTestConstants.TEMPLATE_PATH; import static org.opentripplanner.generate.doc.framework.DocsTestConstants.USER_DOC_PATH; import static org.opentripplanner.generate.doc.framework.TemplateUtil.replaceSection; import static org.opentripplanner.standalone.config.framework.json.JsonSupport.jsonNodeFromResource; +import static org.opentripplanner.utils.text.MarkdownFormatter.HEADER_4; import java.io.File; import org.junit.jupiter.api.Test; diff --git a/application/src/test/java/org/opentripplanner/generate/doc/OsmMapperDocTest.java b/application/src/test/java/org/opentripplanner/generate/doc/OsmMapperDocTest.java index 91c6f5c530a..e2844437ca5 100644 --- a/application/src/test/java/org/opentripplanner/generate/doc/OsmMapperDocTest.java +++ b/application/src/test/java/org/opentripplanner/generate/doc/OsmMapperDocTest.java @@ -18,13 +18,13 @@ import java.util.Set; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; -import org.opentripplanner.framework.text.Table; -import org.opentripplanner.framework.text.TableBuilder; import org.opentripplanner.generate.doc.framework.GeneratesDocumentation; import org.opentripplanner.osm.tagmapping.OsmTagMapper; import org.opentripplanner.osm.tagmapping.OsmTagMapperSource; import org.opentripplanner.osm.wayproperty.SafetyFeatures; import org.opentripplanner.osm.wayproperty.WayPropertySet; +import org.opentripplanner.utils.text.Table; +import org.opentripplanner.utils.text.TableBuilder; @GeneratesDocumentation public class OsmMapperDocTest { diff --git a/application/src/test/java/org/opentripplanner/generate/doc/RideHailingDocTest.java b/application/src/test/java/org/opentripplanner/generate/doc/RideHailingDocTest.java index 2d04e002413..fe959d9138d 100644 --- a/application/src/test/java/org/opentripplanner/generate/doc/RideHailingDocTest.java +++ b/application/src/test/java/org/opentripplanner/generate/doc/RideHailingDocTest.java @@ -4,11 +4,11 @@ import static org.opentripplanner.framework.io.FileUtils.assertFileEquals; import static org.opentripplanner.framework.io.FileUtils.readFile; import static org.opentripplanner.framework.io.FileUtils.writeFile; -import static org.opentripplanner.framework.text.MarkdownFormatter.HEADER_4; import static org.opentripplanner.generate.doc.framework.DocsTestConstants.TEMPLATE_PATH; import static org.opentripplanner.generate.doc.framework.DocsTestConstants.USER_DOC_PATH; import static org.opentripplanner.generate.doc.framework.TemplateUtil.replaceSection; import static org.opentripplanner.standalone.config.framework.json.JsonSupport.jsonNodeFromResource; +import static org.opentripplanner.utils.text.MarkdownFormatter.HEADER_4; import java.io.File; import org.junit.jupiter.api.Test; diff --git a/application/src/test/java/org/opentripplanner/generate/doc/RouteRequestDocTest.java b/application/src/test/java/org/opentripplanner/generate/doc/RouteRequestDocTest.java index b4725c5e2a1..c51660a9a60 100644 --- a/application/src/test/java/org/opentripplanner/generate/doc/RouteRequestDocTest.java +++ b/application/src/test/java/org/opentripplanner/generate/doc/RouteRequestDocTest.java @@ -4,13 +4,13 @@ import static org.opentripplanner.framework.io.FileUtils.assertFileEquals; import static org.opentripplanner.framework.io.FileUtils.readFile; import static org.opentripplanner.framework.io.FileUtils.writeFile; -import static org.opentripplanner.framework.text.MarkdownFormatter.HEADER_3; import static org.opentripplanner.generate.doc.framework.DocsTestConstants.TEMPLATE_PATH; import static org.opentripplanner.generate.doc.framework.DocsTestConstants.USER_DOC_PATH; import static org.opentripplanner.generate.doc.framework.TemplateUtil.replaceJsonExample; import static org.opentripplanner.generate.doc.framework.TemplateUtil.replaceParametersDetails; import static org.opentripplanner.generate.doc.framework.TemplateUtil.replaceParametersTable; import static org.opentripplanner.standalone.config.framework.json.JsonSupport.jsonNodeFromResource; +import static org.opentripplanner.utils.text.MarkdownFormatter.HEADER_3; import java.io.File; import org.junit.jupiter.api.Test; diff --git a/application/src/test/java/org/opentripplanner/generate/doc/RouterConfigurationDocTest.java b/application/src/test/java/org/opentripplanner/generate/doc/RouterConfigurationDocTest.java index 77490c506fd..cdb10e28c6a 100644 --- a/application/src/test/java/org/opentripplanner/generate/doc/RouterConfigurationDocTest.java +++ b/application/src/test/java/org/opentripplanner/generate/doc/RouterConfigurationDocTest.java @@ -4,13 +4,13 @@ import static org.opentripplanner.framework.io.FileUtils.assertFileEquals; import static org.opentripplanner.framework.io.FileUtils.readFile; import static org.opentripplanner.framework.io.FileUtils.writeFile; -import static org.opentripplanner.framework.text.MarkdownFormatter.HEADER_3; import static org.opentripplanner.generate.doc.framework.DocsTestConstants.TEMPLATE_PATH; import static org.opentripplanner.generate.doc.framework.DocsTestConstants.USER_DOC_PATH; import static org.opentripplanner.generate.doc.framework.TemplateUtil.replaceJsonExample; import static org.opentripplanner.generate.doc.framework.TemplateUtil.replaceParametersDetails; import static org.opentripplanner.generate.doc.framework.TemplateUtil.replaceParametersTable; import static org.opentripplanner.standalone.config.framework.json.JsonSupport.jsonNodeFromResource; +import static org.opentripplanner.utils.text.MarkdownFormatter.HEADER_3; import java.io.File; import org.junit.jupiter.api.Test; diff --git a/application/src/test/java/org/opentripplanner/generate/doc/SiriAzureConfigDocTest.java b/application/src/test/java/org/opentripplanner/generate/doc/SiriAzureConfigDocTest.java index fcf93770f38..003b29ebcbb 100644 --- a/application/src/test/java/org/opentripplanner/generate/doc/SiriAzureConfigDocTest.java +++ b/application/src/test/java/org/opentripplanner/generate/doc/SiriAzureConfigDocTest.java @@ -4,11 +4,11 @@ import static org.opentripplanner.framework.io.FileUtils.assertFileEquals; import static org.opentripplanner.framework.io.FileUtils.readFile; import static org.opentripplanner.framework.io.FileUtils.writeFile; -import static org.opentripplanner.framework.text.MarkdownFormatter.HEADER_4; import static org.opentripplanner.generate.doc.framework.DocsTestConstants.TEMPLATE_PATH; import static org.opentripplanner.generate.doc.framework.DocsTestConstants.USER_DOC_PATH; import static org.opentripplanner.generate.doc.framework.TemplateUtil.replaceSection; import static org.opentripplanner.standalone.config.framework.json.JsonSupport.jsonNodeFromResource; +import static org.opentripplanner.utils.text.MarkdownFormatter.HEADER_4; import com.fasterxml.jackson.databind.ObjectMapper; import java.io.File; diff --git a/application/src/test/java/org/opentripplanner/generate/doc/SiriConfigDocTest.java b/application/src/test/java/org/opentripplanner/generate/doc/SiriConfigDocTest.java index 71df3027c7d..b53c5370b53 100644 --- a/application/src/test/java/org/opentripplanner/generate/doc/SiriConfigDocTest.java +++ b/application/src/test/java/org/opentripplanner/generate/doc/SiriConfigDocTest.java @@ -4,11 +4,11 @@ import static org.opentripplanner.framework.io.FileUtils.assertFileEquals; import static org.opentripplanner.framework.io.FileUtils.readFile; import static org.opentripplanner.framework.io.FileUtils.writeFile; -import static org.opentripplanner.framework.text.MarkdownFormatter.HEADER_4; import static org.opentripplanner.generate.doc.framework.DocsTestConstants.TEMPLATE_PATH; import static org.opentripplanner.generate.doc.framework.DocsTestConstants.USER_DOC_PATH; import static org.opentripplanner.generate.doc.framework.TemplateUtil.replaceSection; import static org.opentripplanner.standalone.config.framework.json.JsonSupport.jsonNodeFromResource; +import static org.opentripplanner.utils.text.MarkdownFormatter.HEADER_4; import com.fasterxml.jackson.databind.ObjectMapper; import java.io.File; diff --git a/application/src/test/java/org/opentripplanner/generate/doc/SiriGooglePubSubConfigDocTest.java b/application/src/test/java/org/opentripplanner/generate/doc/SiriGooglePubSubConfigDocTest.java index ce414b298d0..c6daed2e4b0 100644 --- a/application/src/test/java/org/opentripplanner/generate/doc/SiriGooglePubSubConfigDocTest.java +++ b/application/src/test/java/org/opentripplanner/generate/doc/SiriGooglePubSubConfigDocTest.java @@ -4,11 +4,11 @@ import static org.opentripplanner.framework.io.FileUtils.assertFileEquals; import static org.opentripplanner.framework.io.FileUtils.readFile; import static org.opentripplanner.framework.io.FileUtils.writeFile; -import static org.opentripplanner.framework.text.MarkdownFormatter.HEADER_4; import static org.opentripplanner.generate.doc.framework.DocsTestConstants.TEMPLATE_PATH; import static org.opentripplanner.generate.doc.framework.DocsTestConstants.USER_DOC_PATH; import static org.opentripplanner.generate.doc.framework.TemplateUtil.replaceSection; import static org.opentripplanner.standalone.config.framework.json.JsonSupport.jsonNodeFromResource; +import static org.opentripplanner.utils.text.MarkdownFormatter.HEADER_4; import com.fasterxml.jackson.databind.ObjectMapper; import java.io.File; diff --git a/application/src/test/java/org/opentripplanner/generate/doc/UpdaterConfigDocTest.java b/application/src/test/java/org/opentripplanner/generate/doc/UpdaterConfigDocTest.java index 7a3f2969c4d..234d4c68b33 100644 --- a/application/src/test/java/org/opentripplanner/generate/doc/UpdaterConfigDocTest.java +++ b/application/src/test/java/org/opentripplanner/generate/doc/UpdaterConfigDocTest.java @@ -4,11 +4,11 @@ import static org.opentripplanner.framework.io.FileUtils.assertFileEquals; import static org.opentripplanner.framework.io.FileUtils.readFile; import static org.opentripplanner.framework.io.FileUtils.writeFile; -import static org.opentripplanner.framework.text.MarkdownFormatter.HEADER_4; import static org.opentripplanner.generate.doc.framework.DocsTestConstants.TEMPLATE_PATH; import static org.opentripplanner.generate.doc.framework.DocsTestConstants.USER_DOC_PATH; import static org.opentripplanner.generate.doc.framework.TemplateUtil.replaceSection; import static org.opentripplanner.standalone.config.framework.json.JsonSupport.jsonNodeFromResource; +import static org.opentripplanner.utils.text.MarkdownFormatter.HEADER_4; import com.fasterxml.jackson.databind.ObjectMapper; import java.io.File; diff --git a/application/src/test/java/org/opentripplanner/generate/doc/VehicleParkingDocTest.java b/application/src/test/java/org/opentripplanner/generate/doc/VehicleParkingDocTest.java index caffafdf72b..cca0d45d0f5 100644 --- a/application/src/test/java/org/opentripplanner/generate/doc/VehicleParkingDocTest.java +++ b/application/src/test/java/org/opentripplanner/generate/doc/VehicleParkingDocTest.java @@ -4,11 +4,11 @@ import static org.opentripplanner.framework.io.FileUtils.assertFileEquals; import static org.opentripplanner.framework.io.FileUtils.readFile; import static org.opentripplanner.framework.io.FileUtils.writeFile; -import static org.opentripplanner.framework.text.MarkdownFormatter.HEADER_4; import static org.opentripplanner.generate.doc.framework.DocsTestConstants.TEMPLATE_PATH; import static org.opentripplanner.generate.doc.framework.DocsTestConstants.USER_DOC_PATH; import static org.opentripplanner.generate.doc.framework.TemplateUtil.replaceSection; import static org.opentripplanner.standalone.config.framework.json.JsonSupport.jsonNodeFromResource; +import static org.opentripplanner.utils.text.MarkdownFormatter.HEADER_4; import java.io.File; import org.junit.jupiter.api.Test; diff --git a/application/src/test/java/org/opentripplanner/generate/doc/framework/AbstractTable.java b/application/src/test/java/org/opentripplanner/generate/doc/framework/AbstractTable.java index 1805b8e6dde..0af3cc938cf 100644 --- a/application/src/test/java/org/opentripplanner/generate/doc/framework/AbstractTable.java +++ b/application/src/test/java/org/opentripplanner/generate/doc/framework/AbstractTable.java @@ -1,18 +1,18 @@ package org.opentripplanner.generate.doc.framework; -import static org.opentripplanner.framework.text.MarkdownFormatter.code; -import static org.opentripplanner.framework.text.MarkdownFormatter.escapeInTable; import static org.opentripplanner.generate.doc.framework.NodeAdapterHelper.anchor; import static org.opentripplanner.standalone.config.framework.json.ConfigType.ENUM_MAP; import static org.opentripplanner.standalone.config.framework.json.ConfigType.ENUM_SET; +import static org.opentripplanner.utils.text.MarkdownFormatter.code; +import static org.opentripplanner.utils.text.MarkdownFormatter.escapeInTable; import java.util.List; -import org.opentripplanner.framework.text.MarkdownFormatter; -import org.opentripplanner.framework.text.Table; -import org.opentripplanner.framework.text.TableBuilder; import org.opentripplanner.standalone.config.framework.json.ConfigType; import org.opentripplanner.standalone.config.framework.json.NodeAdapter; import org.opentripplanner.standalone.config.framework.json.NodeInfo; +import org.opentripplanner.utils.text.MarkdownFormatter; +import org.opentripplanner.utils.text.Table; +import org.opentripplanner.utils.text.TableBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/test/java/org/opentripplanner/generate/doc/framework/DocBuilder.java b/application/src/test/java/org/opentripplanner/generate/doc/framework/DocBuilder.java index 16579075077..ea62f3a052c 100644 --- a/application/src/test/java/org/opentripplanner/generate/doc/framework/DocBuilder.java +++ b/application/src/test/java/org/opentripplanner/generate/doc/framework/DocBuilder.java @@ -1,12 +1,12 @@ package org.opentripplanner.generate.doc.framework; -import static org.opentripplanner.framework.text.MarkdownFormatter.NEW_LINE; +import static org.opentripplanner.utils.text.MarkdownFormatter.NEW_LINE; import com.fasterxml.jackson.databind.JsonNode; import java.util.List; import java.util.stream.Collectors; -import org.opentripplanner.framework.text.MarkdownFormatter; import org.opentripplanner.standalone.config.framework.json.EnumMapper; +import org.opentripplanner.utils.text.MarkdownFormatter; /** * Builder for creating a new document diff --git a/application/src/test/java/org/opentripplanner/generate/doc/framework/DocBuilderTest.java b/application/src/test/java/org/opentripplanner/generate/doc/framework/DocBuilderTest.java index 8885a400af8..1a9796e9aac 100644 --- a/application/src/test/java/org/opentripplanner/generate/doc/framework/DocBuilderTest.java +++ b/application/src/test/java/org/opentripplanner/generate/doc/framework/DocBuilderTest.java @@ -1,7 +1,7 @@ package org.opentripplanner.generate.doc.framework; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.opentripplanner.framework.text.MarkdownFormatter.HEADER_1; +import static org.opentripplanner.utils.text.MarkdownFormatter.HEADER_1; import java.util.Arrays; import org.junit.jupiter.api.Test; diff --git a/application/src/test/java/org/opentripplanner/generate/doc/framework/ParameterDetailsList.java b/application/src/test/java/org/opentripplanner/generate/doc/framework/ParameterDetailsList.java index 6593c7c0359..ea165d3dc16 100644 --- a/application/src/test/java/org/opentripplanner/generate/doc/framework/ParameterDetailsList.java +++ b/application/src/test/java/org/opentripplanner/generate/doc/framework/ParameterDetailsList.java @@ -5,11 +5,11 @@ import static org.opentripplanner.standalone.config.framework.json.ConfigType.ENUM_SET; import java.util.EnumSet; -import org.opentripplanner.framework.text.MarkdownFormatter; import org.opentripplanner.standalone.config.framework.json.ConfigType; import org.opentripplanner.standalone.config.framework.json.EnumMapper; import org.opentripplanner.standalone.config.framework.json.NodeAdapter; import org.opentripplanner.standalone.config.framework.json.NodeInfo; +import org.opentripplanner.utils.text.MarkdownFormatter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/test/java/org/opentripplanner/generate/doc/framework/ParameterSummaryTable.java b/application/src/test/java/org/opentripplanner/generate/doc/framework/ParameterSummaryTable.java index f95b76b8a0f..8712c0fe47d 100644 --- a/application/src/test/java/org/opentripplanner/generate/doc/framework/ParameterSummaryTable.java +++ b/application/src/test/java/org/opentripplanner/generate/doc/framework/ParameterSummaryTable.java @@ -1,14 +1,14 @@ package org.opentripplanner.generate.doc.framework; -import static org.opentripplanner.framework.text.Table.Align.Center; -import static org.opentripplanner.framework.text.Table.Align.Left; +import static org.opentripplanner.utils.text.Table.Align.Center; +import static org.opentripplanner.utils.text.Table.Align.Left; import java.util.List; -import org.opentripplanner.framework.text.MarkdownFormatter; -import org.opentripplanner.framework.text.Table; -import org.opentripplanner.framework.text.TableBuilder; import org.opentripplanner.standalone.config.framework.json.NodeAdapter; import org.opentripplanner.standalone.config.framework.json.NodeInfo; +import org.opentripplanner.utils.text.MarkdownFormatter; +import org.opentripplanner.utils.text.Table; +import org.opentripplanner.utils.text.TableBuilder; public class ParameterSummaryTable extends AbstractTable { diff --git a/application/src/test/java/org/opentripplanner/generate/doc/support/ConfigTypeTable.java b/application/src/test/java/org/opentripplanner/generate/doc/support/ConfigTypeTable.java index 85c9476549c..e85eee9eedb 100644 --- a/application/src/test/java/org/opentripplanner/generate/doc/support/ConfigTypeTable.java +++ b/application/src/test/java/org/opentripplanner/generate/doc/support/ConfigTypeTable.java @@ -1,8 +1,8 @@ package org.opentripplanner.generate.doc.support; -import org.opentripplanner.framework.text.MarkdownFormatter; -import org.opentripplanner.framework.text.Table; import org.opentripplanner.standalone.config.framework.json.ConfigType; +import org.opentripplanner.utils.text.MarkdownFormatter; +import org.opentripplanner.utils.text.Table; @SuppressWarnings("NewClassNamingConvention") public class ConfigTypeTable { diff --git a/application/src/test/java/org/opentripplanner/generate/doc/support/OTPFeatureTable.java b/application/src/test/java/org/opentripplanner/generate/doc/support/OTPFeatureTable.java index 22966028192..ccdc1337b87 100644 --- a/application/src/test/java/org/opentripplanner/generate/doc/support/OTPFeatureTable.java +++ b/application/src/test/java/org/opentripplanner/generate/doc/support/OTPFeatureTable.java @@ -1,12 +1,12 @@ package org.opentripplanner.generate.doc.support; -import static org.opentripplanner.framework.text.MarkdownFormatter.checkMark; -import static org.opentripplanner.framework.text.Table.Align.Center; -import static org.opentripplanner.framework.text.Table.Align.Left; +import static org.opentripplanner.utils.text.MarkdownFormatter.checkMark; +import static org.opentripplanner.utils.text.Table.Align.Center; +import static org.opentripplanner.utils.text.Table.Align.Left; import org.opentripplanner.framework.application.OTPFeature; -import org.opentripplanner.framework.text.MarkdownFormatter; -import org.opentripplanner.framework.text.Table; +import org.opentripplanner.utils.text.MarkdownFormatter; +import org.opentripplanner.utils.text.Table; @SuppressWarnings("NewClassNamingConvention") public class OTPFeatureTable { diff --git a/application/src/test/java/org/opentripplanner/graph_builder/issue/api/DataImportIssueSummaryTest.java b/application/src/test/java/org/opentripplanner/graph_builder/issue/api/DataImportIssueSummaryTest.java index 6524d53547e..989e2ca2016 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/issue/api/DataImportIssueSummaryTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/issue/api/DataImportIssueSummaryTest.java @@ -5,7 +5,7 @@ import java.util.List; import java.util.Map; import org.junit.jupiter.api.Test; -import org.opentripplanner.framework.collection.ListUtils; +import org.opentripplanner.utils.collection.ListUtils; class DataImportIssueSummaryTest { diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/DirectTransferGeneratorTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/DirectTransferGeneratorTest.java index bb3144aa904..8a17e5258d8 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/DirectTransferGeneratorTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/DirectTransferGeneratorTest.java @@ -16,7 +16,6 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.function.Executable; import org.opentripplanner.TestOtpModel; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.model.PathTransfer; import org.opentripplanner.routing.algorithm.GraphRoutingTest; @@ -31,6 +30,7 @@ import org.opentripplanner.transit.model.network.StopPattern; import org.opentripplanner.transit.model.network.TripPattern; import org.opentripplanner.transit.model.site.StopLocation; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * This creates a graph with trip patterns diff --git a/application/src/test/java/org/opentripplanner/gtfs/mapping/ServiceCalendarDateMapperTest.java b/application/src/test/java/org/opentripplanner/gtfs/mapping/ServiceCalendarDateMapperTest.java index 320ef4ba555..f363b1c1cb1 100644 --- a/application/src/test/java/org/opentripplanner/gtfs/mapping/ServiceCalendarDateMapperTest.java +++ b/application/src/test/java/org/opentripplanner/gtfs/mapping/ServiceCalendarDateMapperTest.java @@ -11,7 +11,7 @@ import org.onebusaway.gtfs.model.AgencyAndId; import org.onebusaway.gtfs.model.ServiceCalendarDate; import org.onebusaway.gtfs.model.calendar.ServiceDate; -import org.opentripplanner.framework.time.ServiceDateUtils; +import org.opentripplanner.utils.time.ServiceDateUtils; public class ServiceCalendarDateMapperTest { diff --git a/application/src/test/java/org/opentripplanner/gtfs/mapping/ServiceCalendarMapperTest.java b/application/src/test/java/org/opentripplanner/gtfs/mapping/ServiceCalendarMapperTest.java index 41d3c4c64cc..8a9265376f3 100644 --- a/application/src/test/java/org/opentripplanner/gtfs/mapping/ServiceCalendarMapperTest.java +++ b/application/src/test/java/org/opentripplanner/gtfs/mapping/ServiceCalendarMapperTest.java @@ -12,7 +12,7 @@ import org.onebusaway.gtfs.model.AgencyAndId; import org.onebusaway.gtfs.model.ServiceCalendar; import org.onebusaway.gtfs.model.calendar.ServiceDate; -import org.opentripplanner.framework.time.ServiceDateUtils; +import org.opentripplanner.utils.time.ServiceDateUtils; public class ServiceCalendarMapperTest { diff --git a/application/src/test/java/org/opentripplanner/model/calendar/impl/CalendarServiceDataFactoryImplTest.java b/application/src/test/java/org/opentripplanner/model/calendar/impl/CalendarServiceDataFactoryImplTest.java index 9516ce03a32..1a322fde916 100644 --- a/application/src/test/java/org/opentripplanner/model/calendar/impl/CalendarServiceDataFactoryImplTest.java +++ b/application/src/test/java/org/opentripplanner/model/calendar/impl/CalendarServiceDataFactoryImplTest.java @@ -19,7 +19,6 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.opentripplanner.ConstantsForTests; -import org.opentripplanner.framework.time.ServiceDateUtils; import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; import org.opentripplanner.gtfs.GtfsContext; import org.opentripplanner.gtfs.GtfsContextBuilder; @@ -30,6 +29,7 @@ import org.opentripplanner.model.impl.OtpTransitServiceBuilder; import org.opentripplanner.transit.model._data.TimetableRepositoryForTest; import org.opentripplanner.transit.model.framework.FeedScopedId; +import org.opentripplanner.utils.time.ServiceDateUtils; /** * @author Thomas Gran (Capra) - tgr@capraconsulting.no (08.11.2017) diff --git a/application/src/test/java/org/opentripplanner/model/plan/PlanTestConstants.java b/application/src/test/java/org/opentripplanner/model/plan/PlanTestConstants.java index e5ec76af8af..adebe4f111c 100644 --- a/application/src/test/java/org/opentripplanner/model/plan/PlanTestConstants.java +++ b/application/src/test/java/org/opentripplanner/model/plan/PlanTestConstants.java @@ -1,9 +1,9 @@ package org.opentripplanner.model.plan; -import static org.opentripplanner.framework.time.TimeUtils.time; +import static org.opentripplanner.utils.time.TimeUtils.time; -import org.opentripplanner.framework.time.DurationUtils; import org.opentripplanner.transit.model._data.TimetableRepositoryForTest; +import org.opentripplanner.utils.time.DurationUtils; public interface PlanTestConstants { int NOT_SET = -999_999; diff --git a/application/src/test/java/org/opentripplanner/model/plan/TestItineraryBuilder.java b/application/src/test/java/org/opentripplanner/model/plan/TestItineraryBuilder.java index d23759907c2..33eeae0a553 100644 --- a/application/src/test/java/org/opentripplanner/model/plan/TestItineraryBuilder.java +++ b/application/src/test/java/org/opentripplanner/model/plan/TestItineraryBuilder.java @@ -22,8 +22,6 @@ import org.opentripplanner.ext.ridehailing.model.RideHailingLeg; import org.opentripplanner.ext.ridehailing.model.RideHailingProvider; import org.opentripplanner.framework.i18n.I18NString; -import org.opentripplanner.framework.lang.IntUtils; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.model.StopTime; import org.opentripplanner.model.transfer.ConstrainedTransfer; import org.opentripplanner.model.transfer.TransferConstraint; @@ -41,6 +39,8 @@ import org.opentripplanner.transit.model.timetable.Trip; import org.opentripplanner.transit.model.timetable.TripTimes; import org.opentripplanner.transit.model.timetable.TripTimesFactory; +import org.opentripplanner.utils.lang.IntUtils; +import org.opentripplanner.utils.time.TimeUtils; /** * This is a helper class to allow unit-testing on Itineraries. The builder does not necessarily diff --git a/application/src/test/java/org/opentripplanner/model/plan/paging/PagingSearchWindowAdjusterTest.java b/application/src/test/java/org/opentripplanner/model/plan/paging/PagingSearchWindowAdjusterTest.java index 22dcd49e63f..784fa4b5f99 100644 --- a/application/src/test/java/org/opentripplanner/model/plan/paging/PagingSearchWindowAdjusterTest.java +++ b/application/src/test/java/org/opentripplanner/model/plan/paging/PagingSearchWindowAdjusterTest.java @@ -1,7 +1,7 @@ package org.opentripplanner.model.plan.paging; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.opentripplanner.framework.time.DurationUtils.duration; +import static org.opentripplanner.utils.time.DurationUtils.duration; import java.time.Duration; import java.time.Instant; diff --git a/application/src/test/java/org/opentripplanner/model/plan/paging/cursor/PageCursorFactoryTest.java b/application/src/test/java/org/opentripplanner/model/plan/paging/cursor/PageCursorFactoryTest.java index 7bf54d05bc2..910620872f3 100644 --- a/application/src/test/java/org/opentripplanner/model/plan/paging/cursor/PageCursorFactoryTest.java +++ b/application/src/test/java/org/opentripplanner/model/plan/paging/cursor/PageCursorFactoryTest.java @@ -10,10 +10,10 @@ import java.time.Duration; import java.time.Instant; import org.junit.jupiter.api.Test; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.model.plan.Itinerary; import org.opentripplanner.model.plan.ItinerarySortKey; import org.opentripplanner.model.plan.PlanTestConstants; +import org.opentripplanner.utils.time.TimeUtils; @SuppressWarnings("ConstantConditions") class PageCursorFactoryTest implements PlanTestConstants { diff --git a/application/src/test/java/org/opentripplanner/model/plan/paging/cursor/PageCursorSerializerTest.java b/application/src/test/java/org/opentripplanner/model/plan/paging/cursor/PageCursorSerializerTest.java index 20c0230f309..e60c2aa1a5b 100644 --- a/application/src/test/java/org/opentripplanner/model/plan/paging/cursor/PageCursorSerializerTest.java +++ b/application/src/test/java/org/opentripplanner/model/plan/paging/cursor/PageCursorSerializerTest.java @@ -8,8 +8,8 @@ import java.time.Duration; import java.time.Instant; import org.junit.jupiter.api.Test; -import org.opentripplanner.framework.time.DurationUtils; import org.opentripplanner.model.plan.ItinerarySortKey; +import org.opentripplanner.utils.time.DurationUtils; class PageCursorSerializerTest { diff --git a/application/src/test/java/org/opentripplanner/model/plan/paging/cursor/PageCursorTest.java b/application/src/test/java/org/opentripplanner/model/plan/paging/cursor/PageCursorTest.java index f9896c66d6a..bd6037ef4a1 100644 --- a/application/src/test/java/org/opentripplanner/model/plan/paging/cursor/PageCursorTest.java +++ b/application/src/test/java/org/opentripplanner/model/plan/paging/cursor/PageCursorTest.java @@ -2,12 +2,12 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; -import static org.opentripplanner.framework.collection.ListSection.HEAD; -import static org.opentripplanner.framework.collection.ListSection.TAIL; import static org.opentripplanner.model.plan.SortOrder.STREET_AND_ARRIVAL_TIME; import static org.opentripplanner.model.plan.SortOrder.STREET_AND_DEPARTURE_TIME; import static org.opentripplanner.model.plan.paging.cursor.PageType.NEXT_PAGE; import static org.opentripplanner.model.plan.paging.cursor.PageType.PREVIOUS_PAGE; +import static org.opentripplanner.utils.collection.ListSection.HEAD; +import static org.opentripplanner.utils.collection.ListSection.TAIL; import java.time.Duration; import java.time.Instant; @@ -21,13 +21,13 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; import org.opentripplanner._support.time.ZoneIds; -import org.opentripplanner.framework.collection.ListSection; import org.opentripplanner.model.plan.Itinerary; import org.opentripplanner.model.plan.Place; import org.opentripplanner.model.plan.PlanTestConstants; import org.opentripplanner.model.plan.SortOrder; import org.opentripplanner.model.plan.TestItineraryBuilder; import org.opentripplanner.transit.model._data.TimetableRepositoryForTest; +import org.opentripplanner.utils.collection.ListSection; class PageCursorTest implements PlanTestConstants { diff --git a/application/src/test/java/org/opentripplanner/model/transfer/TransferConstraintTest.java b/application/src/test/java/org/opentripplanner/model/transfer/TransferConstraintTest.java index 100e3137f49..47ff414790e 100644 --- a/application/src/test/java/org/opentripplanner/model/transfer/TransferConstraintTest.java +++ b/application/src/test/java/org/opentripplanner/model/transfer/TransferConstraintTest.java @@ -10,7 +10,7 @@ import java.util.function.IntSupplier; import org.junit.jupiter.api.Test; -import org.opentripplanner.framework.time.DurationUtils; +import org.opentripplanner.utils.time.DurationUtils; public class TransferConstraintTest { diff --git a/application/src/test/java/org/opentripplanner/raptor/_data/RaptorTestConstants.java b/application/src/test/java/org/opentripplanner/raptor/_data/RaptorTestConstants.java index 78489508dc4..0b5e47c977a 100644 --- a/application/src/test/java/org/opentripplanner/raptor/_data/RaptorTestConstants.java +++ b/application/src/test/java/org/opentripplanner/raptor/_data/RaptorTestConstants.java @@ -1,7 +1,7 @@ package org.opentripplanner.raptor._data; -import static org.opentripplanner.framework.time.DurationUtils.durationInSeconds; -import static org.opentripplanner.framework.time.TimeUtils.hm2time; +import static org.opentripplanner.utils.time.DurationUtils.durationInSeconds; +import static org.opentripplanner.utils.time.TimeUtils.hm2time; import org.opentripplanner.raptor.spi.DefaultSlackProvider; import org.opentripplanner.raptor.spi.RaptorSlackProvider; diff --git a/application/src/test/java/org/opentripplanner/raptor/_data/api/TestPathBuilderTestRaptor.java b/application/src/test/java/org/opentripplanner/raptor/_data/api/TestPathBuilderTestRaptor.java index de40c29d583..9b37057cdc6 100644 --- a/application/src/test/java/org/opentripplanner/raptor/_data/api/TestPathBuilderTestRaptor.java +++ b/application/src/test/java/org/opentripplanner/raptor/_data/api/TestPathBuilderTestRaptor.java @@ -2,13 +2,12 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.opentripplanner.framework.time.DurationUtils.durationInSeconds; -import static org.opentripplanner.framework.time.TimeUtils.time; import static org.opentripplanner.model.transfer.TransferConstraint.REGULAR_TRANSFER; import static org.opentripplanner.raptor._data.stoparrival.BasicPathTestCase.C1_CALCULATOR; import static org.opentripplanner.raptor._data.transit.TestAccessEgress.walk; +import static org.opentripplanner.utils.time.DurationUtils.durationInSeconds; +import static org.opentripplanner.utils.time.TimeUtils.time; -import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.opentripplanner.raptor._data.RaptorTestConstants; import org.opentripplanner.raptor._data.stoparrival.BasicPathTestCase; diff --git a/application/src/test/java/org/opentripplanner/raptor/_data/stoparrival/BasicPathTestCase.java b/application/src/test/java/org/opentripplanner/raptor/_data/stoparrival/BasicPathTestCase.java index 4a92264e87c..88aa857f76a 100644 --- a/application/src/test/java/org/opentripplanner/raptor/_data/stoparrival/BasicPathTestCase.java +++ b/application/src/test/java/org/opentripplanner/raptor/_data/stoparrival/BasicPathTestCase.java @@ -1,8 +1,6 @@ package org.opentripplanner.raptor._data.stoparrival; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.opentripplanner.framework.time.DurationUtils.durationToStr; -import static org.opentripplanner.framework.time.TimeUtils.time; import static org.opentripplanner.model.transfer.TransferConstraint.REGULAR_TRANSFER; import static org.opentripplanner.raptor._data.stoparrival.TestArrivals.access; import static org.opentripplanner.raptor._data.stoparrival.TestArrivals.bus; @@ -11,6 +9,8 @@ import static org.opentripplanner.raptor._data.transit.TestAccessEgress.flexWithOnBoard; import static org.opentripplanner.raptor._data.transit.TestTripPattern.pattern; import static org.opentripplanner.routing.algorithm.raptoradapter.transit.cost.RaptorCostConverter.toRaptorCost; +import static org.opentripplanner.utils.time.DurationUtils.durationToStr; +import static org.opentripplanner.utils.time.TimeUtils.time; import java.util.Arrays; import java.util.List; diff --git a/application/src/test/java/org/opentripplanner/raptor/_data/stoparrival/Egress.java b/application/src/test/java/org/opentripplanner/raptor/_data/stoparrival/Egress.java index a244acdf720..302de528d9f 100644 --- a/application/src/test/java/org/opentripplanner/raptor/_data/stoparrival/Egress.java +++ b/application/src/test/java/org/opentripplanner/raptor/_data/stoparrival/Egress.java @@ -1,11 +1,11 @@ package org.opentripplanner.raptor._data.stoparrival; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.raptor._data.transit.TestTripSchedule; import org.opentripplanner.raptor.api.model.PathLegType; import org.opentripplanner.raptor.api.model.RaptorAccessEgress; import org.opentripplanner.raptor.api.view.ArrivalView; import org.opentripplanner.raptor.api.view.EgressPathView; +import org.opentripplanner.utils.time.TimeUtils; public class Egress extends AbstractStopArrival { diff --git a/application/src/test/java/org/opentripplanner/raptor/_data/stoparrival/FlexAccessAndEgressPathTestCase.java b/application/src/test/java/org/opentripplanner/raptor/_data/stoparrival/FlexAccessAndEgressPathTestCase.java index 1e694e3d771..51639ecc72d 100644 --- a/application/src/test/java/org/opentripplanner/raptor/_data/stoparrival/FlexAccessAndEgressPathTestCase.java +++ b/application/src/test/java/org/opentripplanner/raptor/_data/stoparrival/FlexAccessAndEgressPathTestCase.java @@ -1,15 +1,14 @@ package org.opentripplanner.raptor._data.stoparrival; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.opentripplanner.framework.time.DurationUtils.durationInSeconds; -import static org.opentripplanner.framework.time.TimeUtils.time; import static org.opentripplanner.raptor._data.stoparrival.TestArrivals.access; import static org.opentripplanner.raptor._data.stoparrival.TestArrivals.bus; import static org.opentripplanner.raptor.api.model.RaptorValueFormatter.formatC1; import static org.opentripplanner.routing.algorithm.raptoradapter.transit.cost.RaptorCostConverter.toRaptorCost; +import static org.opentripplanner.utils.time.DurationUtils.durationInSeconds; +import static org.opentripplanner.utils.time.TimeUtils.time; import org.junit.jupiter.api.Test; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.raptor._data.RaptorTestConstants; import org.opentripplanner.raptor._data.transit.TestAccessEgress; import org.opentripplanner.raptor._data.transit.TestTransfer; @@ -24,6 +23,7 @@ import org.opentripplanner.raptor.spi.RaptorSlackProvider; import org.opentripplanner.routing.algorithm.raptoradapter.transit.cost.DefaultCostCalculator; import org.opentripplanner.routing.algorithm.raptoradapter.transit.cost.RaptorCostConverter; +import org.opentripplanner.utils.time.TimeUtils; /** * This test case construct two Raptor paths for forward and reverse search, with and without diff --git a/application/src/test/java/org/opentripplanner/raptor/_data/transit/TestAccessEgress.java b/application/src/test/java/org/opentripplanner/raptor/_data/transit/TestAccessEgress.java index 8047ec0d4cb..c58240126de 100644 --- a/application/src/test/java/org/opentripplanner/raptor/_data/transit/TestAccessEgress.java +++ b/application/src/test/java/org/opentripplanner/raptor/_data/transit/TestAccessEgress.java @@ -9,9 +9,9 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.raptor.api.model.RaptorAccessEgress; import org.opentripplanner.raptor.api.model.RaptorConstants; +import org.opentripplanner.utils.time.TimeUtils; /** * Simple implementation for {@link RaptorAccessEgress} for use in unit-tests. diff --git a/application/src/test/java/org/opentripplanner/raptor/_data/transit/TestConstrainedBoardingSearch.java b/application/src/test/java/org/opentripplanner/raptor/_data/transit/TestConstrainedBoardingSearch.java index 7812b9d2fce..5e8980dc50a 100644 --- a/application/src/test/java/org/opentripplanner/raptor/_data/transit/TestConstrainedBoardingSearch.java +++ b/application/src/test/java/org/opentripplanner/raptor/_data/transit/TestConstrainedBoardingSearch.java @@ -9,11 +9,11 @@ import java.util.function.BiPredicate; import java.util.stream.Collectors; import javax.annotation.Nullable; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.model.transfer.TransferConstraint; import org.opentripplanner.raptor.spi.RaptorBoardOrAlightEvent; import org.opentripplanner.raptor.spi.RaptorConstrainedBoardingSearch; import org.opentripplanner.raptor.spi.RaptorTimeTable; +import org.opentripplanner.utils.tostring.ToStringBuilder; public class TestConstrainedBoardingSearch implements RaptorConstrainedBoardingSearch { diff --git a/application/src/test/java/org/opentripplanner/raptor/_data/transit/TestConstrainedTransfer.java b/application/src/test/java/org/opentripplanner/raptor/_data/transit/TestConstrainedTransfer.java index 66233e4eb74..643585f8c5b 100644 --- a/application/src/test/java/org/opentripplanner/raptor/_data/transit/TestConstrainedTransfer.java +++ b/application/src/test/java/org/opentripplanner/raptor/_data/transit/TestConstrainedTransfer.java @@ -1,12 +1,12 @@ package org.opentripplanner.raptor._data.transit; import javax.annotation.Nullable; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.model.transfer.TransferConstraint; import org.opentripplanner.raptor.api.model.RaptorConstrainedTransfer; import org.opentripplanner.raptor.api.model.RaptorTransferConstraint; import org.opentripplanner.raptor.spi.RaptorBoardOrAlightEvent; import org.opentripplanner.routing.algorithm.raptoradapter.transit.constrainedtransfer.ConstrainedTransferBoarding; +import org.opentripplanner.utils.tostring.ToStringBuilder; class TestConstrainedTransfer implements RaptorConstrainedTransfer { diff --git a/application/src/test/java/org/opentripplanner/raptor/_data/transit/TestRoute.java b/application/src/test/java/org/opentripplanner/raptor/_data/transit/TestRoute.java index c3029b9ebfd..6a606876e0e 100644 --- a/application/src/test/java/org/opentripplanner/raptor/_data/transit/TestRoute.java +++ b/application/src/test/java/org/opentripplanner/raptor/_data/transit/TestRoute.java @@ -3,7 +3,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.model.transfer.TransferConstraint; import org.opentripplanner.raptor.api.model.SearchDirection; import org.opentripplanner.raptor.spi.RaptorConstrainedBoardingSearch; @@ -12,6 +11,7 @@ import org.opentripplanner.raptor.spi.RaptorTripScheduleSearch; import org.opentripplanner.routing.algorithm.raptoradapter.api.DefaultTripPattern; import org.opentripplanner.routing.algorithm.raptoradapter.transit.request.TripScheduleSearchFactory; +import org.opentripplanner.utils.tostring.ToStringBuilder; public class TestRoute implements RaptorRoute, RaptorTimeTable { diff --git a/application/src/test/java/org/opentripplanner/raptor/_data/transit/TestTransferPoint.java b/application/src/test/java/org/opentripplanner/raptor/_data/transit/TestTransferPoint.java index d3a0e4c3d4e..ef2271e51ae 100644 --- a/application/src/test/java/org/opentripplanner/raptor/_data/transit/TestTransferPoint.java +++ b/application/src/test/java/org/opentripplanner/raptor/_data/transit/TestTransferPoint.java @@ -1,7 +1,7 @@ package org.opentripplanner.raptor._data.transit; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.model.transfer.TransferPoint; +import org.opentripplanner.utils.tostring.ToStringBuilder; public class TestTransferPoint implements TransferPoint { diff --git a/application/src/test/java/org/opentripplanner/raptor/_data/transit/TestTripPattern.java b/application/src/test/java/org/opentripplanner/raptor/_data/transit/TestTripPattern.java index 63dcbeb5863..811c17cc568 100644 --- a/application/src/test/java/org/opentripplanner/raptor/_data/transit/TestTripPattern.java +++ b/application/src/test/java/org/opentripplanner/raptor/_data/transit/TestTripPattern.java @@ -1,8 +1,8 @@ package org.opentripplanner.raptor._data.transit; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.routing.algorithm.raptoradapter.api.DefaultTripPattern; import org.opentripplanner.transit.model.network.Route; +import org.opentripplanner.utils.tostring.ToStringBuilder; public class TestTripPattern implements DefaultTripPattern { diff --git a/application/src/test/java/org/opentripplanner/raptor/_data/transit/TestTripSchedule.java b/application/src/test/java/org/opentripplanner/raptor/_data/transit/TestTripSchedule.java index ab8d26406ee..75062d9a61e 100644 --- a/application/src/test/java/org/opentripplanner/raptor/_data/transit/TestTripSchedule.java +++ b/application/src/test/java/org/opentripplanner/raptor/_data/transit/TestTripSchedule.java @@ -5,15 +5,15 @@ import java.time.LocalDate; import java.util.Arrays; import java.util.stream.IntStream; -import org.opentripplanner.framework.lang.IntUtils; -import org.opentripplanner.framework.time.TimeUtils; -import org.opentripplanner.framework.tostring.ToStringBuilder; import org.opentripplanner.raptor.api.model.RaptorTripSchedule; import org.opentripplanner.routing.algorithm.raptoradapter.api.DefaultTripPattern; import org.opentripplanner.routing.algorithm.raptoradapter.transit.TripSchedule; import org.opentripplanner.transit.model.basic.Accessibility; import org.opentripplanner.transit.model.network.TripPattern; import org.opentripplanner.transit.model.timetable.TripTimes; +import org.opentripplanner.utils.lang.IntUtils; +import org.opentripplanner.utils.time.TimeUtils; +import org.opentripplanner.utils.tostring.ToStringBuilder; /** * An implementation of the {@link RaptorTripSchedule} for unit-testing. diff --git a/application/src/test/java/org/opentripplanner/raptor/api/path/PathTest.java b/application/src/test/java/org/opentripplanner/raptor/api/path/PathTest.java index de71574a952..7ea3c9805f5 100644 --- a/application/src/test/java/org/opentripplanner/raptor/api/path/PathTest.java +++ b/application/src/test/java/org/opentripplanner/raptor/api/path/PathTest.java @@ -3,8 +3,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; -import static org.opentripplanner.framework.time.TimeUtils.time; -import static org.opentripplanner.framework.time.TimeUtils.timeToStrCompact; import static org.opentripplanner.raptor._data.stoparrival.BasicPathTestCase.ACCESS_START; import static org.opentripplanner.raptor._data.stoparrival.BasicPathTestCase.BASIC_PATH_AS_DETAILED_STRING; import static org.opentripplanner.raptor._data.stoparrival.BasicPathTestCase.BASIC_PATH_AS_STRING; @@ -13,6 +11,8 @@ import static org.opentripplanner.raptor._data.stoparrival.BasicPathTestCase.TOTAL_C1; import static org.opentripplanner.raptor._data.stoparrival.BasicPathTestCase.basicTripStops; import static org.opentripplanner.raptor._data.transit.TestTripPattern.pattern; +import static org.opentripplanner.utils.time.TimeUtils.time; +import static org.opentripplanner.utils.time.TimeUtils.timeToStrCompact; import java.util.List; import java.util.stream.Collectors; diff --git a/application/src/test/java/org/opentripplanner/raptor/moduletests/B01_AccessTest.java b/application/src/test/java/org/opentripplanner/raptor/moduletests/B01_AccessTest.java index 37814d6c6dc..76583a38649 100644 --- a/application/src/test/java/org/opentripplanner/raptor/moduletests/B01_AccessTest.java +++ b/application/src/test/java/org/opentripplanner/raptor/moduletests/B01_AccessTest.java @@ -12,7 +12,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; -import org.opentripplanner.framework.time.DurationUtils; import org.opentripplanner.raptor.RaptorService; import org.opentripplanner.raptor._data.RaptorTestConstants; import org.opentripplanner.raptor._data.transit.TestAccessEgress; @@ -22,6 +21,7 @@ import org.opentripplanner.raptor.configure.RaptorConfig; import org.opentripplanner.raptor.moduletests.support.ModuleTestDebugLogging; import org.opentripplanner.raptor.moduletests.support.RaptorModuleTestCase; +import org.opentripplanner.utils.time.DurationUtils; /** * FEATURE UNDER TEST diff --git a/application/src/test/java/org/opentripplanner/raptor/moduletests/F02_EgressWithRidesTest.java b/application/src/test/java/org/opentripplanner/raptor/moduletests/F02_EgressWithRidesTest.java index 87b2237fac8..1b5164c79a4 100644 --- a/application/src/test/java/org/opentripplanner/raptor/moduletests/F02_EgressWithRidesTest.java +++ b/application/src/test/java/org/opentripplanner/raptor/moduletests/F02_EgressWithRidesTest.java @@ -17,7 +17,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; -import org.opentripplanner.framework.time.DurationUtils; import org.opentripplanner.raptor.RaptorService; import org.opentripplanner.raptor._data.RaptorTestConstants; import org.opentripplanner.raptor._data.transit.TestTransitData; @@ -27,6 +26,7 @@ import org.opentripplanner.raptor.moduletests.support.ModuleTestDebugLogging; import org.opentripplanner.raptor.moduletests.support.RaptorModuleTestCase; import org.opentripplanner.raptor.spi.DefaultSlackProvider; +import org.opentripplanner.utils.time.DurationUtils; /** * FEATURE UNDER TEST diff --git a/application/src/test/java/org/opentripplanner/raptor/moduletests/G01_AccessWithOpeningHoursTest.java b/application/src/test/java/org/opentripplanner/raptor/moduletests/G01_AccessWithOpeningHoursTest.java index 7f5e5421e79..bf3bf359001 100644 --- a/application/src/test/java/org/opentripplanner/raptor/moduletests/G01_AccessWithOpeningHoursTest.java +++ b/application/src/test/java/org/opentripplanner/raptor/moduletests/G01_AccessWithOpeningHoursTest.java @@ -19,7 +19,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.raptor.RaptorService; import org.opentripplanner.raptor._data.RaptorTestConstants; import org.opentripplanner.raptor._data.transit.TestTransitData; @@ -30,6 +29,7 @@ import org.opentripplanner.raptor.moduletests.support.ModuleTestDebugLogging; import org.opentripplanner.raptor.moduletests.support.RaptorModuleTestCase; import org.opentripplanner.raptor.moduletests.support.RaptorModuleTestCaseFactory; +import org.opentripplanner.utils.time.TimeUtils; /* * FEATURE UNDER TEST diff --git a/application/src/test/java/org/opentripplanner/raptor/moduletests/G02_EgressWithOpeningHoursTest.java b/application/src/test/java/org/opentripplanner/raptor/moduletests/G02_EgressWithOpeningHoursTest.java index 9498f0b0080..994305cb0d5 100644 --- a/application/src/test/java/org/opentripplanner/raptor/moduletests/G02_EgressWithOpeningHoursTest.java +++ b/application/src/test/java/org/opentripplanner/raptor/moduletests/G02_EgressWithOpeningHoursTest.java @@ -1,7 +1,6 @@ package org.opentripplanner.raptor.moduletests; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.opentripplanner.framework.time.TimeUtils.hm2time; import static org.opentripplanner.raptor._data.api.PathUtils.withoutCost; import static org.opentripplanner.raptor._data.transit.TestAccessEgress.walk; import static org.opentripplanner.raptor._data.transit.TestRoute.route; @@ -13,6 +12,7 @@ import static org.opentripplanner.raptor.moduletests.support.RaptorModuleTestConfig.minDuration; import static org.opentripplanner.raptor.moduletests.support.RaptorModuleTestConfig.multiCriteria; import static org.opentripplanner.raptor.moduletests.support.RaptorModuleTestConfig.standard; +import static org.opentripplanner.utils.time.TimeUtils.hm2time; import java.time.Duration; import java.util.List; diff --git a/application/src/test/java/org/opentripplanner/raptor/moduletests/L01_TimePenaltyAccessTest.java b/application/src/test/java/org/opentripplanner/raptor/moduletests/L01_TimePenaltyAccessTest.java index 778dd36a227..a4753cc2c17 100644 --- a/application/src/test/java/org/opentripplanner/raptor/moduletests/L01_TimePenaltyAccessTest.java +++ b/application/src/test/java/org/opentripplanner/raptor/moduletests/L01_TimePenaltyAccessTest.java @@ -1,7 +1,6 @@ package org.opentripplanner.raptor.moduletests; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.opentripplanner.framework.time.TimeUtils.time; import static org.opentripplanner.raptor._data.api.PathUtils.withoutCost; import static org.opentripplanner.raptor._data.transit.TestAccessEgress.walk; import static org.opentripplanner.raptor._data.transit.TestRoute.route; @@ -11,6 +10,7 @@ import static org.opentripplanner.raptor.moduletests.support.RaptorModuleTestConfig.TC_STANDARD_REV; import static org.opentripplanner.raptor.moduletests.support.RaptorModuleTestConfig.TC_STANDARD_REV_ONE; import static org.opentripplanner.raptor.moduletests.support.RaptorModuleTestConfig.multiCriteria; +import static org.opentripplanner.utils.time.TimeUtils.time; import java.time.Duration; import java.util.List; diff --git a/application/src/test/java/org/opentripplanner/raptor/moduletests/L01_TimePenaltyEgressTest.java b/application/src/test/java/org/opentripplanner/raptor/moduletests/L01_TimePenaltyEgressTest.java index 1e6897475f4..d75b91c7aee 100644 --- a/application/src/test/java/org/opentripplanner/raptor/moduletests/L01_TimePenaltyEgressTest.java +++ b/application/src/test/java/org/opentripplanner/raptor/moduletests/L01_TimePenaltyEgressTest.java @@ -1,7 +1,6 @@ package org.opentripplanner.raptor.moduletests; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.opentripplanner.framework.time.TimeUtils.time; import static org.opentripplanner.raptor._data.api.PathUtils.withoutCost; import static org.opentripplanner.raptor._data.transit.TestAccessEgress.walk; import static org.opentripplanner.raptor._data.transit.TestRoute.route; @@ -11,6 +10,7 @@ import static org.opentripplanner.raptor.moduletests.support.RaptorModuleTestConfig.TC_STANDARD_REV; import static org.opentripplanner.raptor.moduletests.support.RaptorModuleTestConfig.TC_STANDARD_REV_ONE; import static org.opentripplanner.raptor.moduletests.support.RaptorModuleTestConfig.multiCriteria; +import static org.opentripplanner.utils.time.TimeUtils.time; import java.time.Duration; import java.util.List; diff --git a/application/src/test/java/org/opentripplanner/raptor/moduletests/support/RaptorModuleTestCaseFactory.java b/application/src/test/java/org/opentripplanner/raptor/moduletests/support/RaptorModuleTestCaseFactory.java index 0f7554dccab..937acd7fcc4 100644 --- a/application/src/test/java/org/opentripplanner/raptor/moduletests/support/RaptorModuleTestCaseFactory.java +++ b/application/src/test/java/org/opentripplanner/raptor/moduletests/support/RaptorModuleTestCaseFactory.java @@ -7,10 +7,10 @@ import java.util.Arrays; import java.util.List; import java.util.function.Consumer; -import org.opentripplanner.framework.time.DurationUtils; import org.opentripplanner.raptor._data.transit.TestTripSchedule; import org.opentripplanner.raptor.api.request.RaptorRequestBuilder; import org.opentripplanner.raptor.spi.UnknownPath; +import org.opentripplanner.utils.time.DurationUtils; /** * Factory for {@link RaptorModuleTestConfig}, create a list of test-cases. diff --git a/application/src/test/java/org/opentripplanner/raptor/rangeraptor/multicriteria/arrivals/c1/StopArrivalFactoryC1Test.java b/application/src/test/java/org/opentripplanner/raptor/rangeraptor/multicriteria/arrivals/c1/StopArrivalFactoryC1Test.java index d47edf1c58f..4d18cde5232 100644 --- a/application/src/test/java/org/opentripplanner/raptor/rangeraptor/multicriteria/arrivals/c1/StopArrivalFactoryC1Test.java +++ b/application/src/test/java/org/opentripplanner/raptor/rangeraptor/multicriteria/arrivals/c1/StopArrivalFactoryC1Test.java @@ -3,8 +3,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test; -import org.opentripplanner.framework.time.DurationUtils; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.raptor._data.transit.TestAccessEgress; import org.opentripplanner.raptor._data.transit.TestTransfer; import org.opentripplanner.raptor._data.transit.TestTripPattern; @@ -13,6 +11,8 @@ import org.opentripplanner.raptor.api.view.PatternRideView; import org.opentripplanner.raptor.rangeraptor.multicriteria.arrivals.McStopArrival; import org.opentripplanner.raptor.rangeraptor.multicriteria.ride.c1.PatternRideC1; +import org.opentripplanner.utils.time.DurationUtils; +import org.opentripplanner.utils.time.TimeUtils; public class StopArrivalFactoryC1Test { diff --git a/application/src/test/java/org/opentripplanner/raptor/rangeraptor/multicriteria/arrivals/c2/StopArrivalFactoryC2Test.java b/application/src/test/java/org/opentripplanner/raptor/rangeraptor/multicriteria/arrivals/c2/StopArrivalFactoryC2Test.java index 4c78461b016..c71ca7fee11 100644 --- a/application/src/test/java/org/opentripplanner/raptor/rangeraptor/multicriteria/arrivals/c2/StopArrivalFactoryC2Test.java +++ b/application/src/test/java/org/opentripplanner/raptor/rangeraptor/multicriteria/arrivals/c2/StopArrivalFactoryC2Test.java @@ -3,8 +3,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test; -import org.opentripplanner.framework.time.DurationUtils; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.raptor._data.transit.TestAccessEgress; import org.opentripplanner.raptor._data.transit.TestTransfer; import org.opentripplanner.raptor._data.transit.TestTripPattern; @@ -13,6 +11,8 @@ import org.opentripplanner.raptor.rangeraptor.multicriteria.arrivals.McStopArrival; import org.opentripplanner.raptor.rangeraptor.multicriteria.ride.c2.PatternRideC2; import org.opentripplanner.raptor.spi.RaptorCostCalculator; +import org.opentripplanner.utils.time.DurationUtils; +import org.opentripplanner.utils.time.TimeUtils; public class StopArrivalFactoryC2Test { diff --git a/application/src/test/java/org/opentripplanner/raptor/rangeraptor/transit/EgressPathsTest.java b/application/src/test/java/org/opentripplanner/raptor/rangeraptor/transit/EgressPathsTest.java index 144904fa3e6..3939bbb865f 100644 --- a/application/src/test/java/org/opentripplanner/raptor/rangeraptor/transit/EgressPathsTest.java +++ b/application/src/test/java/org/opentripplanner/raptor/rangeraptor/transit/EgressPathsTest.java @@ -10,9 +10,9 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; import org.junit.jupiter.api.Test; -import org.opentripplanner.framework.time.DurationUtils; import org.opentripplanner.raptor.api.model.RaptorAccessEgress; import org.opentripplanner.raptor.api.request.RaptorProfile; +import org.opentripplanner.utils.time.DurationUtils; class EgressPathsTest { diff --git a/application/src/test/java/org/opentripplanner/raptor/rangeraptor/transit/ForwardRaptorTransitCalculatorTest.java b/application/src/test/java/org/opentripplanner/raptor/rangeraptor/transit/ForwardRaptorTransitCalculatorTest.java index ad7a269b856..bf1999d88fc 100644 --- a/application/src/test/java/org/opentripplanner/raptor/rangeraptor/transit/ForwardRaptorTransitCalculatorTest.java +++ b/application/src/test/java/org/opentripplanner/raptor/rangeraptor/transit/ForwardRaptorTransitCalculatorTest.java @@ -3,10 +3,10 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.opentripplanner.framework.time.TimeUtils.hm2time; import static org.opentripplanner.raptor._data.RaptorTestConstants.D1m; import static org.opentripplanner.raptor._data.RaptorTestConstants.STOP_A; import static org.opentripplanner.raptor._data.RaptorTestConstants.STOP_B; +import static org.opentripplanner.utils.time.TimeUtils.hm2time; import org.junit.jupiter.api.Test; import org.opentripplanner.raptor._data.transit.TestAccessEgress; diff --git a/application/src/test/java/org/opentripplanner/raptor/rangeraptor/transit/ForwardTransitCalculatorTest.java b/application/src/test/java/org/opentripplanner/raptor/rangeraptor/transit/ForwardTransitCalculatorTest.java index 10f5e18875b..5fb1cb5fade 100644 --- a/application/src/test/java/org/opentripplanner/raptor/rangeraptor/transit/ForwardTransitCalculatorTest.java +++ b/application/src/test/java/org/opentripplanner/raptor/rangeraptor/transit/ForwardTransitCalculatorTest.java @@ -1,11 +1,11 @@ package org.opentripplanner.raptor.rangeraptor.transit; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.opentripplanner.framework.time.TimeUtils.hm2time; import static org.opentripplanner.raptor._data.transit.TestAccessEgress.flex; import static org.opentripplanner.raptor._data.transit.TestAccessEgress.flexAndWalk; import static org.opentripplanner.raptor._data.transit.TestAccessEgress.free; import static org.opentripplanner.raptor._data.transit.TestAccessEgress.walk; +import static org.opentripplanner.utils.time.TimeUtils.hm2time; import org.junit.jupiter.api.Test; import org.opentripplanner.raptor._data.RaptorTestConstants; diff --git a/application/src/test/java/org/opentripplanner/raptor/rangeraptor/transit/ReverseRaptorTransitCalculatorTest.java b/application/src/test/java/org/opentripplanner/raptor/rangeraptor/transit/ReverseRaptorTransitCalculatorTest.java index 3afecaf3e81..981fb058f9b 100644 --- a/application/src/test/java/org/opentripplanner/raptor/rangeraptor/transit/ReverseRaptorTransitCalculatorTest.java +++ b/application/src/test/java/org/opentripplanner/raptor/rangeraptor/transit/ReverseRaptorTransitCalculatorTest.java @@ -3,10 +3,10 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.opentripplanner.framework.time.TimeUtils.hm2time; import static org.opentripplanner.raptor._data.RaptorTestConstants.D1m; import static org.opentripplanner.raptor._data.RaptorTestConstants.STOP_A; import static org.opentripplanner.raptor._data.RaptorTestConstants.STOP_B; +import static org.opentripplanner.utils.time.TimeUtils.hm2time; import org.junit.jupiter.api.Test; import org.opentripplanner.raptor._data.transit.TestTransfer; diff --git a/application/src/test/java/org/opentripplanner/raptor/rangeraptor/transit/TripTimesSearchTest.java b/application/src/test/java/org/opentripplanner/raptor/rangeraptor/transit/TripTimesSearchTest.java index 50295b0341e..d70f58fd1c5 100644 --- a/application/src/test/java/org/opentripplanner/raptor/rangeraptor/transit/TripTimesSearchTest.java +++ b/application/src/test/java/org/opentripplanner/raptor/rangeraptor/transit/TripTimesSearchTest.java @@ -2,7 +2,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.opentripplanner.framework.time.TimeUtils.timeToStrLong; import static org.opentripplanner.raptor._data.stoparrival.TestArrivals.access; import static org.opentripplanner.raptor._data.stoparrival.TestArrivals.bus; import static org.opentripplanner.raptor._data.transit.TestAccessEgress.free; @@ -11,13 +10,14 @@ import static org.opentripplanner.raptor.rangeraptor.transit.TripTimesSearch.findTripForwardSearchApproximateTime; import static org.opentripplanner.raptor.rangeraptor.transit.TripTimesSearch.findTripReverseSearch; import static org.opentripplanner.raptor.rangeraptor.transit.TripTimesSearch.findTripReverseSearchApproximateTime; +import static org.opentripplanner.utils.time.TimeUtils.timeToStrLong; import org.junit.jupiter.api.Test; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.raptor._data.RaptorTestConstants; import org.opentripplanner.raptor._data.transit.TestTripSchedule; import org.opentripplanner.raptor.api.view.ArrivalView; import org.opentripplanner.raptor.spi.BoardAndAlightTime; +import org.opentripplanner.utils.time.TimeUtils; public class TripTimesSearchTest implements RaptorTestConstants { diff --git a/application/src/test/java/org/opentripplanner/raptor/spi/RaptorTripScheduleTest.java b/application/src/test/java/org/opentripplanner/raptor/spi/RaptorTripScheduleTest.java index 6b4392a13a9..9188617016a 100644 --- a/application/src/test/java/org/opentripplanner/raptor/spi/RaptorTripScheduleTest.java +++ b/application/src/test/java/org/opentripplanner/raptor/spi/RaptorTripScheduleTest.java @@ -1,7 +1,7 @@ package org.opentripplanner.raptor.spi; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.opentripplanner.framework.time.TimeUtils.timeToStrLong; +import static org.opentripplanner.utils.time.TimeUtils.timeToStrLong; import org.junit.jupiter.api.Test; import org.opentripplanner.raptor._data.transit.TestTripPattern; diff --git a/application/src/test/java/org/opentripplanner/raptor/util/paretoset/ParetoSetTest.java b/application/src/test/java/org/opentripplanner/raptor/util/paretoset/ParetoSetTest.java index 1c410c13e1c..5f2d56cfcdd 100644 --- a/application/src/test/java/org/opentripplanner/raptor/util/paretoset/ParetoSetTest.java +++ b/application/src/test/java/org/opentripplanner/raptor/util/paretoset/ParetoSetTest.java @@ -12,7 +12,7 @@ import java.util.stream.Collectors; import java.util.stream.StreamSupport; import org.junit.jupiter.api.Test; -import org.opentripplanner.framework.lang.IntUtils; +import org.opentripplanner.utils.lang.IntUtils; public class ParetoSetTest { diff --git a/application/src/test/java/org/opentripplanner/routing/algorithm/filterchain/filters/street/RemoveBikeRentalWithMostlyWalkingTest.java b/application/src/test/java/org/opentripplanner/routing/algorithm/filterchain/filters/street/RemoveBikeRentalWithMostlyWalkingTest.java index 4e47306601c..c1dc34413cd 100644 --- a/application/src/test/java/org/opentripplanner/routing/algorithm/filterchain/filters/street/RemoveBikeRentalWithMostlyWalkingTest.java +++ b/application/src/test/java/org/opentripplanner/routing/algorithm/filterchain/filters/street/RemoveBikeRentalWithMostlyWalkingTest.java @@ -8,9 +8,9 @@ import java.util.List; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.opentripplanner.framework.time.DurationUtils; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.model.plan.Itinerary; +import org.opentripplanner.utils.time.DurationUtils; +import org.opentripplanner.utils.time.TimeUtils; public class RemoveBikeRentalWithMostlyWalkingTest { diff --git a/application/src/test/java/org/opentripplanner/routing/algorithm/filterchain/filters/street/RemoveParkAndRideWithMostlyWalkingTest.java b/application/src/test/java/org/opentripplanner/routing/algorithm/filterchain/filters/street/RemoveParkAndRideWithMostlyWalkingTest.java index a4c90d1346f..88baabb1e2a 100644 --- a/application/src/test/java/org/opentripplanner/routing/algorithm/filterchain/filters/street/RemoveParkAndRideWithMostlyWalkingTest.java +++ b/application/src/test/java/org/opentripplanner/routing/algorithm/filterchain/filters/street/RemoveParkAndRideWithMostlyWalkingTest.java @@ -8,9 +8,9 @@ import java.util.List; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.opentripplanner.framework.time.DurationUtils; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.model.plan.Itinerary; +import org.opentripplanner.utils.time.DurationUtils; +import org.opentripplanner.utils.time.TimeUtils; public class RemoveParkAndRideWithMostlyWalkingTest { diff --git a/application/src/test/java/org/opentripplanner/routing/algorithm/filterchain/filters/street/RemoveWalkOnlyFilterTest.java b/application/src/test/java/org/opentripplanner/routing/algorithm/filterchain/filters/street/RemoveWalkOnlyFilterTest.java index 359423a842b..6281c4f744c 100644 --- a/application/src/test/java/org/opentripplanner/routing/algorithm/filterchain/filters/street/RemoveWalkOnlyFilterTest.java +++ b/application/src/test/java/org/opentripplanner/routing/algorithm/filterchain/filters/street/RemoveWalkOnlyFilterTest.java @@ -8,9 +8,9 @@ import java.util.List; import org.junit.jupiter.api.Test; -import org.opentripplanner.framework.time.DurationUtils; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.model.plan.Itinerary; +import org.opentripplanner.utils.time.DurationUtils; +import org.opentripplanner.utils.time.TimeUtils; public class RemoveWalkOnlyFilterTest { diff --git a/application/src/test/java/org/opentripplanner/routing/algorithm/filterchain/filters/system/FlexSearchWindowFilterTest.java b/application/src/test/java/org/opentripplanner/routing/algorithm/filterchain/filters/system/FlexSearchWindowFilterTest.java index 30c8872b859..dd51ccbcd19 100644 --- a/application/src/test/java/org/opentripplanner/routing/algorithm/filterchain/filters/system/FlexSearchWindowFilterTest.java +++ b/application/src/test/java/org/opentripplanner/routing/algorithm/filterchain/filters/system/FlexSearchWindowFilterTest.java @@ -2,8 +2,8 @@ import static com.google.common.truth.Truth.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.opentripplanner.framework.time.TimeUtils.time; import static org.opentripplanner.model.plan.TestItineraryBuilder.newItinerary; +import static org.opentripplanner.utils.time.TimeUtils.time; import java.time.Duration; import java.time.Instant; diff --git a/application/src/test/java/org/opentripplanner/routing/algorithm/filterchain/filters/system/NumItinerariesFilterTest.java b/application/src/test/java/org/opentripplanner/routing/algorithm/filterchain/filters/system/NumItinerariesFilterTest.java index 622482fe4b3..1943104e1d0 100644 --- a/application/src/test/java/org/opentripplanner/routing/algorithm/filterchain/filters/system/NumItinerariesFilterTest.java +++ b/application/src/test/java/org/opentripplanner/routing/algorithm/filterchain/filters/system/NumItinerariesFilterTest.java @@ -8,9 +8,9 @@ import java.util.List; import org.junit.jupiter.api.Test; -import org.opentripplanner.framework.collection.ListSection; import org.opentripplanner.model.plan.Itinerary; import org.opentripplanner.model.plan.paging.cursor.PageCursorInput; +import org.opentripplanner.utils.collection.ListSection; public class NumItinerariesFilterTest { diff --git a/application/src/test/java/org/opentripplanner/routing/algorithm/filterchain/filters/system/OutsideSearchWindowFilterTest.java b/application/src/test/java/org/opentripplanner/routing/algorithm/filterchain/filters/system/OutsideSearchWindowFilterTest.java index 6e475ac5893..0e61d146d17 100644 --- a/application/src/test/java/org/opentripplanner/routing/algorithm/filterchain/filters/system/OutsideSearchWindowFilterTest.java +++ b/application/src/test/java/org/opentripplanner/routing/algorithm/filterchain/filters/system/OutsideSearchWindowFilterTest.java @@ -4,8 +4,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.opentripplanner.framework.time.TimeUtils.time; import static org.opentripplanner.model.plan.TestItineraryBuilder.newItinerary; +import static org.opentripplanner.utils.time.TimeUtils.time; import java.time.Duration; import java.util.List; diff --git a/application/src/test/java/org/opentripplanner/routing/algorithm/filterchain/filters/system/PagingFilterTest.java b/application/src/test/java/org/opentripplanner/routing/algorithm/filterchain/filters/system/PagingFilterTest.java index 713e72e344c..165cddd31f3 100644 --- a/application/src/test/java/org/opentripplanner/routing/algorithm/filterchain/filters/system/PagingFilterTest.java +++ b/application/src/test/java/org/opentripplanner/routing/algorithm/filterchain/filters/system/PagingFilterTest.java @@ -1,10 +1,10 @@ package org.opentripplanner.routing.algorithm.filterchain.filters.system; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.opentripplanner.framework.collection.ListUtils.first; -import static org.opentripplanner.framework.collection.ListUtils.last; import static org.opentripplanner.model.plan.Itinerary.toStr; import static org.opentripplanner.model.plan.TestItineraryBuilder.newItinerary; +import static org.opentripplanner.utils.collection.ListUtils.first; +import static org.opentripplanner.utils.collection.ListUtils.last; import java.util.ArrayList; import java.util.List; @@ -13,14 +13,14 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; import org.opentripplanner._support.debug.TestDebug; -import org.opentripplanner.framework.collection.ListSection; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.model.plan.Itinerary; import org.opentripplanner.model.plan.Place; import org.opentripplanner.model.plan.PlanTestConstants; import org.opentripplanner.model.plan.SortOrder; import org.opentripplanner.routing.algorithm.filterchain.framework.sort.SortOrderComparator; import org.opentripplanner.transit.model._data.TimetableRepositoryForTest; +import org.opentripplanner.utils.collection.ListSection; +import org.opentripplanner.utils.time.TimeUtils; public class PagingFilterTest implements PlanTestConstants { diff --git a/application/src/test/java/org/opentripplanner/routing/algorithm/mapping/PagingServiceFactoryTest.java b/application/src/test/java/org/opentripplanner/routing/algorithm/mapping/PagingServiceFactoryTest.java index 369f58d6ef1..64797b9c5a1 100644 --- a/application/src/test/java/org/opentripplanner/routing/algorithm/mapping/PagingServiceFactoryTest.java +++ b/application/src/test/java/org/opentripplanner/routing/algorithm/mapping/PagingServiceFactoryTest.java @@ -7,14 +7,14 @@ import java.time.Instant; import java.util.List; import org.junit.jupiter.api.Test; -import org.opentripplanner.framework.time.DurationUtils; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.raptor._data.transit.TestAccessEgress; import org.opentripplanner.raptor.api.request.RaptorRequestBuilder; import org.opentripplanner.raptor.api.request.RaptorTuningParameters; import org.opentripplanner.raptor.api.request.SearchParams; import org.opentripplanner.routing.algorithm.raptoradapter.transit.TransitTuningParameters; import org.opentripplanner.routing.api.request.RouteRequest; +import org.opentripplanner.utils.time.DurationUtils; +import org.opentripplanner.utils.time.TimeUtils; class PagingServiceFactoryTest { diff --git a/application/src/test/java/org/opentripplanner/routing/algorithm/mapping/RaptorPathToItineraryMapperTest.java b/application/src/test/java/org/opentripplanner/routing/algorithm/mapping/RaptorPathToItineraryMapperTest.java index 4887b1e6f03..ede3166e22b 100644 --- a/application/src/test/java/org/opentripplanner/routing/algorithm/mapping/RaptorPathToItineraryMapperTest.java +++ b/application/src/test/java/org/opentripplanner/routing/algorithm/mapping/RaptorPathToItineraryMapperTest.java @@ -24,7 +24,6 @@ import org.opentripplanner.framework.application.OTPFeature; import org.opentripplanner.framework.model.Cost; import org.opentripplanner.framework.model.TimeAndCost; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.model.PickDrop; import org.opentripplanner.model.StopTime; import org.opentripplanner.model.plan.Leg; @@ -67,6 +66,7 @@ import org.opentripplanner.transit.model.timetable.booking.RoutingBookingInfo; import org.opentripplanner.transit.service.DefaultTransitService; import org.opentripplanner.transit.service.TimetableRepository; +import org.opentripplanner.utils.time.TimeUtils; public class RaptorPathToItineraryMapperTest { diff --git a/application/src/test/java/org/opentripplanner/routing/algorithm/mapping/SnapshotTestBase.java b/application/src/test/java/org/opentripplanner/routing/algorithm/mapping/SnapshotTestBase.java index 98acfeeb7af..cab308c092b 100644 --- a/application/src/test/java/org/opentripplanner/routing/algorithm/mapping/SnapshotTestBase.java +++ b/application/src/test/java/org/opentripplanner/routing/algorithm/mapping/SnapshotTestBase.java @@ -41,7 +41,6 @@ import org.opentripplanner.api.parameter.Qualifier; import org.opentripplanner.ext.restapi.mapping.ItineraryMapper; import org.opentripplanner.ext.restapi.model.ApiLeg; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.model.GenericLocation; import org.opentripplanner.model.plan.Itinerary; import org.opentripplanner.model.plan.Leg; @@ -54,6 +53,7 @@ import org.opentripplanner.standalone.api.OtpServerRequestContext; import org.opentripplanner.transit.model.basic.MainAndSubMode; import org.opentripplanner.transit.model.basic.TransitMode; +import org.opentripplanner.utils.time.TimeUtils; /** * A base class for creating snapshots test of itinerary generation using the Portland graph. diff --git a/application/src/test/java/org/opentripplanner/routing/algorithm/raptoradapter/router/street/AccessEgressPenaltyDecoratorTest.java b/application/src/test/java/org/opentripplanner/routing/algorithm/raptoradapter/router/street/AccessEgressPenaltyDecoratorTest.java index 78b12a97b82..a1b58ce76fa 100644 --- a/application/src/test/java/org/opentripplanner/routing/algorithm/raptoradapter/router/street/AccessEgressPenaltyDecoratorTest.java +++ b/application/src/test/java/org/opentripplanner/routing/algorithm/raptoradapter/router/street/AccessEgressPenaltyDecoratorTest.java @@ -10,7 +10,6 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; -import org.opentripplanner.framework.time.DurationUtils; import org.opentripplanner.routing.algorithm.raptoradapter.transit.DefaultAccessEgress; import org.opentripplanner.routing.algorithm.raptoradapter.transit.RoutingAccessEgress; import org.opentripplanner.routing.api.request.StreetMode; @@ -19,6 +18,7 @@ import org.opentripplanner.routing.api.request.framework.TimePenalty; import org.opentripplanner.street.search.state.State; import org.opentripplanner.street.search.state.TestStateBuilder; +import org.opentripplanner.utils.time.DurationUtils; class AccessEgressPenaltyDecoratorTest { diff --git a/application/src/test/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RaptorRoutingRequestTransitDataCreatorTest.java b/application/src/test/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RaptorRoutingRequestTransitDataCreatorTest.java index b81792877ae..7df9677082d 100644 --- a/application/src/test/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RaptorRoutingRequestTransitDataCreatorTest.java +++ b/application/src/test/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RaptorRoutingRequestTransitDataCreatorTest.java @@ -10,7 +10,6 @@ import java.util.List; import org.junit.jupiter.api.Test; import org.opentripplanner._support.time.ZoneIds; -import org.opentripplanner.framework.time.ServiceDateUtils; import org.opentripplanner.model.StopTime; import org.opentripplanner.routing.algorithm.raptoradapter.transit.TripPatternForDate; import org.opentripplanner.transit.model._data.TimetableRepositoryForTest; @@ -22,6 +21,7 @@ import org.opentripplanner.transit.model.network.grouppriority.TransitGroupPriorityService; import org.opentripplanner.transit.model.timetable.ScheduledTripTimes; import org.opentripplanner.transit.model.timetable.TripTimes; +import org.opentripplanner.utils.time.ServiceDateUtils; public class RaptorRoutingRequestTransitDataCreatorTest { diff --git a/application/src/test/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/TestRouteData.java b/application/src/test/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/TestRouteData.java index 1d266ce9953..5c345e55931 100644 --- a/application/src/test/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/TestRouteData.java +++ b/application/src/test/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/TestRouteData.java @@ -12,7 +12,6 @@ import java.util.Map; import java.util.stream.Collectors; import org.opentripplanner.framework.i18n.NonLocalizedString; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.model.StopTime; import org.opentripplanner.raptor.spi.RaptorTimeTable; import org.opentripplanner.routing.algorithm.raptoradapter.transit.TripPatternForDate; @@ -29,6 +28,7 @@ import org.opentripplanner.transit.model.timetable.Trip; import org.opentripplanner.transit.model.timetable.TripTimes; import org.opentripplanner.transit.model.timetable.TripTimesFactory; +import org.opentripplanner.utils.time.TimeUtils; public class TestRouteData { diff --git a/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/model/MinSafeTransferTimeCalculatorTest.java b/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/model/MinSafeTransferTimeCalculatorTest.java index ae10dd0d03e..9b0cf342c0b 100644 --- a/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/model/MinSafeTransferTimeCalculatorTest.java +++ b/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/model/MinSafeTransferTimeCalculatorTest.java @@ -1,18 +1,18 @@ package org.opentripplanner.routing.algorithm.transferoptimization.model; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.opentripplanner.framework.time.TimeUtils.time; import static org.opentripplanner.raptor._data.stoparrival.BasicPathTestCase.C1_CALCULATOR; import static org.opentripplanner.routing.algorithm.transferoptimization.model.MinSafeTransferTimeCalculator.bound; +import static org.opentripplanner.utils.time.TimeUtils.time; import java.util.List; import org.junit.jupiter.api.Test; -import org.opentripplanner.framework.time.DurationUtils; import org.opentripplanner.raptor._data.RaptorTestConstants; import org.opentripplanner.raptor._data.api.TestPathBuilder; import org.opentripplanner.raptor._data.stoparrival.BasicPathTestCase; import org.opentripplanner.raptor._data.transit.TestTripSchedule; import org.opentripplanner.raptor.api.path.RaptorPath; +import org.opentripplanner.utils.time.DurationUtils; public class MinSafeTransferTimeCalculatorTest implements RaptorTestConstants { diff --git a/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/model/TransferWaitTimeCostCalculatorTest.java b/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/model/TransferWaitTimeCostCalculatorTest.java index 3d5ae037428..3a375f7968a 100644 --- a/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/model/TransferWaitTimeCostCalculatorTest.java +++ b/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/model/TransferWaitTimeCostCalculatorTest.java @@ -2,7 +2,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.opentripplanner.framework.time.DurationUtils.durationInSeconds; +import static org.opentripplanner.utils.time.DurationUtils.durationInSeconds; import org.junit.jupiter.api.Test; diff --git a/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/model/TripStopTimeTest.java b/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/model/TripStopTimeTest.java index 0c0d50dfe74..e81b51c4eaa 100644 --- a/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/model/TripStopTimeTest.java +++ b/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/model/TripStopTimeTest.java @@ -1,13 +1,13 @@ package org.opentripplanner.routing.algorithm.transferoptimization.model; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.opentripplanner.framework.time.TimeUtils.time; import static org.opentripplanner.routing.algorithm.transferoptimization.model.StopTime.stopTime; +import static org.opentripplanner.utils.time.TimeUtils.time; import org.junit.jupiter.api.Test; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.raptor._data.transit.TestTripPattern; import org.opentripplanner.raptor._data.transit.TestTripSchedule; +import org.opentripplanner.utils.time.TimeUtils; public class TripStopTimeTest { diff --git a/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/model/passthrough/PassThroughNoTransfersTest.java b/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/model/passthrough/PassThroughNoTransfersTest.java index 926e6ebe15c..11552ea3d1e 100644 --- a/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/model/passthrough/PassThroughNoTransfersTest.java +++ b/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/model/passthrough/PassThroughNoTransfersTest.java @@ -1,11 +1,11 @@ package org.opentripplanner.routing.algorithm.transferoptimization.model.passthrough; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.opentripplanner.framework.time.TimeUtils.time; import static org.opentripplanner.routing.algorithm.transferoptimization.model.passthrough.TestCase.testCase; import static org.opentripplanner.routing.algorithm.transferoptimization.model.passthrough.TestUtils.domainService; import static org.opentripplanner.routing.algorithm.transferoptimization.model.passthrough.TestUtils.first; import static org.opentripplanner.routing.algorithm.transferoptimization.model.passthrough.TestUtils.pathBuilder; +import static org.opentripplanner.utils.time.TimeUtils.time; import java.util.List; import org.junit.jupiter.params.ParameterizedTest; diff --git a/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/model/passthrough/PassThroughOneTransferTest.java b/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/model/passthrough/PassThroughOneTransferTest.java index ad41f43a586..acd99ab4bef 100644 --- a/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/model/passthrough/PassThroughOneTransferTest.java +++ b/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/model/passthrough/PassThroughOneTransferTest.java @@ -1,12 +1,12 @@ package org.opentripplanner.routing.algorithm.transferoptimization.model.passthrough; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.opentripplanner.framework.time.TimeUtils.time; import static org.opentripplanner.routing.algorithm.transferoptimization.model.passthrough.TestCase.testCase; import static org.opentripplanner.routing.algorithm.transferoptimization.model.passthrough.TestUtils.domainService; import static org.opentripplanner.routing.algorithm.transferoptimization.model.passthrough.TestUtils.pathBuilder; import static org.opentripplanner.routing.algorithm.transferoptimization.model.passthrough.TestUtils.pathFocus; import static org.opentripplanner.routing.algorithm.transferoptimization.model.passthrough.TestUtils.tx; +import static org.opentripplanner.utils.time.TimeUtils.time; import java.util.List; import java.util.stream.Collectors; diff --git a/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/model/passthrough/PassThroughTwoTransfersTest.java b/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/model/passthrough/PassThroughTwoTransfersTest.java index e92e0ba0b3b..05da490c857 100644 --- a/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/model/passthrough/PassThroughTwoTransfersTest.java +++ b/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/model/passthrough/PassThroughTwoTransfersTest.java @@ -1,11 +1,11 @@ package org.opentripplanner.routing.algorithm.transferoptimization.model.passthrough; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.opentripplanner.framework.time.TimeUtils.time; import static org.opentripplanner.routing.algorithm.transferoptimization.model.passthrough.TestCase.testCase; import static org.opentripplanner.routing.algorithm.transferoptimization.model.passthrough.TestUtils.domainService; import static org.opentripplanner.routing.algorithm.transferoptimization.model.passthrough.TestUtils.pathBuilder; import static org.opentripplanner.routing.algorithm.transferoptimization.model.passthrough.TestUtils.tx; +import static org.opentripplanner.utils.time.TimeUtils.time; import java.util.List; import org.junit.jupiter.params.ParameterizedTest; diff --git a/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/model/passthrough/WalkDurationForStopCombinations.java b/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/model/passthrough/WalkDurationForStopCombinations.java index cfd8f6c4e53..66bb1e02c17 100644 --- a/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/model/passthrough/WalkDurationForStopCombinations.java +++ b/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/model/passthrough/WalkDurationForStopCombinations.java @@ -4,8 +4,8 @@ import java.util.Collection; import java.util.HashMap; import java.util.Map; -import org.opentripplanner.framework.lang.IntUtils; import org.opentripplanner.raptor.api.request.PassThroughPoint; +import org.opentripplanner.utils.lang.IntUtils; /** * This class is used to adjust the walk time - giving each path an unique generalized-cost. We want diff --git a/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/services/OptimizePathDomainServiceConstrainedTest.java b/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/services/OptimizePathDomainServiceConstrainedTest.java index a040da1d23f..109032a0110 100644 --- a/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/services/OptimizePathDomainServiceConstrainedTest.java +++ b/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/services/OptimizePathDomainServiceConstrainedTest.java @@ -2,12 +2,12 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.opentripplanner.framework.time.TimeUtils.time; import static org.opentripplanner.model.transfer.TransferPriority.ALLOWED; import static org.opentripplanner.model.transfer.TransferPriority.NOT_ALLOWED; import static org.opentripplanner.model.transfer.TransferPriority.PREFERRED; import static org.opentripplanner.model.transfer.TransferPriority.RECOMMENDED; import static org.opentripplanner.routing.algorithm.transferoptimization.services.TransferGeneratorDummy.dummyTransferGenerator; +import static org.opentripplanner.utils.time.TimeUtils.time; import java.util.List; import org.junit.jupiter.api.Test; diff --git a/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/services/OptimizePathDomainServiceTest.java b/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/services/OptimizePathDomainServiceTest.java index be927046c43..54c45b8a76b 100644 --- a/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/services/OptimizePathDomainServiceTest.java +++ b/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/services/OptimizePathDomainServiceTest.java @@ -1,9 +1,9 @@ package org.opentripplanner.routing.algorithm.transferoptimization.services; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.opentripplanner.framework.time.TimeUtils.time; import static org.opentripplanner.routing.algorithm.transferoptimization.services.TestTransferBuilder.tx; import static org.opentripplanner.routing.algorithm.transferoptimization.services.TransferGeneratorDummy.dummyTransferGenerator; +import static org.opentripplanner.utils.time.TimeUtils.time; import java.util.List; import javax.annotation.Nullable; diff --git a/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/services/TestTransferBuilder.java b/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/services/TestTransferBuilder.java index 90dd9e5915e..d553bac75eb 100644 --- a/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/services/TestTransferBuilder.java +++ b/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/services/TestTransferBuilder.java @@ -1,7 +1,6 @@ package org.opentripplanner.routing.algorithm.transferoptimization.services; import java.util.Objects; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.model.transfer.ConstrainedTransfer; import org.opentripplanner.model.transfer.TransferConstraint; import org.opentripplanner.model.transfer.TransferPriority; @@ -13,6 +12,7 @@ import org.opentripplanner.routing.algorithm.transferoptimization.model.TripToTripTransfer; import org.opentripplanner.transit.model._data.TimetableRepositoryForTest; import org.opentripplanner.transit.model.timetable.Trip; +import org.opentripplanner.utils.time.TimeUtils; /** * This builder is used to create a {@link ConstrainedTransfer} for use in unit-tests. It build a diff --git a/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/services/TransferGeneratorTest.java b/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/services/TransferGeneratorTest.java index 4283e5cca62..acaefbcf1d9 100644 --- a/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/services/TransferGeneratorTest.java +++ b/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/services/TransferGeneratorTest.java @@ -16,7 +16,6 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.model.transfer.TransferConstraint; import org.opentripplanner.raptor._data.RaptorTestConstants; import org.opentripplanner.raptor._data.api.TestPathBuilder; @@ -29,6 +28,7 @@ import org.opentripplanner.raptor.api.path.TransitPathLeg; import org.opentripplanner.raptor.spi.DefaultSlackProvider; import org.opentripplanner.raptor.spi.RaptorSlackProvider; +import org.opentripplanner.utils.time.TimeUtils; public class TransferGeneratorTest implements RaptorTestConstants { diff --git a/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/services/TransitPathLegSelectorTest.java b/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/services/TransitPathLegSelectorTest.java index d62f123e7d6..5ce84b4a00d 100644 --- a/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/services/TransitPathLegSelectorTest.java +++ b/application/src/test/java/org/opentripplanner/routing/algorithm/transferoptimization/services/TransitPathLegSelectorTest.java @@ -8,7 +8,6 @@ import java.util.Set; import java.util.stream.Collectors; import org.junit.jupiter.api.Test; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.raptor._data.RaptorTestConstants; import org.opentripplanner.raptor._data.transit.TestAccessEgress; import org.opentripplanner.raptor._data.transit.TestTripSchedule; @@ -21,6 +20,7 @@ import org.opentripplanner.routing.algorithm.transferoptimization.model.OptimizedPathTail; import org.opentripplanner.routing.algorithm.transferoptimization.model.PathTailFilter; import org.opentripplanner.routing.algorithm.transferoptimization.model.costfilter.MinCostPathTailFilterFactory; +import org.opentripplanner.utils.time.TimeUtils; public class TransitPathLegSelectorTest implements RaptorTestConstants { diff --git a/application/src/test/java/org/opentripplanner/routing/algorithm/via/ViaRoutingWorkerTest.java b/application/src/test/java/org/opentripplanner/routing/algorithm/via/ViaRoutingWorkerTest.java index 7b2a4d7e7a6..c11b25d4ac3 100644 --- a/application/src/test/java/org/opentripplanner/routing/algorithm/via/ViaRoutingWorkerTest.java +++ b/application/src/test/java/org/opentripplanner/routing/algorithm/via/ViaRoutingWorkerTest.java @@ -10,7 +10,6 @@ import java.time.ZonedDateTime; import java.util.List; import org.junit.jupiter.api.Test; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.model.GenericLocation; import org.opentripplanner.model.plan.Itinerary; import org.opentripplanner.model.plan.Place; @@ -22,6 +21,7 @@ import org.opentripplanner.routing.api.response.RoutingResponse; import org.opentripplanner.routing.api.response.ViaRoutingResponseConnection; import org.opentripplanner.transit.model._data.TimetableRepositoryForTest; +import org.opentripplanner.utils.time.TimeUtils; /** * Create search from point A to point B via point C. Search will start at 12:00 and will find two diff --git a/application/src/test/java/org/opentripplanner/routing/api/request/framework/CostLinearFunctionTest.java b/application/src/test/java/org/opentripplanner/routing/api/request/framework/CostLinearFunctionTest.java index e4f42fcd409..8d972896878 100644 --- a/application/src/test/java/org/opentripplanner/routing/api/request/framework/CostLinearFunctionTest.java +++ b/application/src/test/java/org/opentripplanner/routing/api/request/framework/CostLinearFunctionTest.java @@ -13,8 +13,8 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; import org.opentripplanner.framework.model.Cost; -import org.opentripplanner.framework.time.DurationUtils; import org.opentripplanner.test.support.TestTableParser; +import org.opentripplanner.utils.time.DurationUtils; class CostLinearFunctionTest { diff --git a/application/src/test/java/org/opentripplanner/routing/api/request/framework/LinearFunctionSerializationTest.java b/application/src/test/java/org/opentripplanner/routing/api/request/framework/LinearFunctionSerializationTest.java index 46ef4b50e77..dbb33e1f97b 100644 --- a/application/src/test/java/org/opentripplanner/routing/api/request/framework/LinearFunctionSerializationTest.java +++ b/application/src/test/java/org/opentripplanner/routing/api/request/framework/LinearFunctionSerializationTest.java @@ -12,8 +12,8 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; -import org.opentripplanner.framework.time.DurationUtils; import org.opentripplanner.test.support.TestTableParser; +import org.opentripplanner.utils.time.DurationUtils; class LinearFunctionSerializationTest { diff --git a/application/src/test/java/org/opentripplanner/routing/api/request/framework/TimeAndCostPenaltyTest.java b/application/src/test/java/org/opentripplanner/routing/api/request/framework/TimeAndCostPenaltyTest.java index 58370722e7c..c13fb0e8c63 100644 --- a/application/src/test/java/org/opentripplanner/routing/api/request/framework/TimeAndCostPenaltyTest.java +++ b/application/src/test/java/org/opentripplanner/routing/api/request/framework/TimeAndCostPenaltyTest.java @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test; import org.opentripplanner.framework.model.Cost; import org.opentripplanner.framework.model.TimeAndCost; -import org.opentripplanner.framework.time.DurationUtils; +import org.opentripplanner.utils.time.DurationUtils; class TimeAndCostPenaltyTest { diff --git a/application/src/test/java/org/opentripplanner/routing/api/request/framework/TimePenaltyTest.java b/application/src/test/java/org/opentripplanner/routing/api/request/framework/TimePenaltyTest.java index 087ffa1d637..7321653192e 100644 --- a/application/src/test/java/org/opentripplanner/routing/api/request/framework/TimePenaltyTest.java +++ b/application/src/test/java/org/opentripplanner/routing/api/request/framework/TimePenaltyTest.java @@ -7,7 +7,7 @@ import java.time.Duration; import org.junit.jupiter.api.Test; -import org.opentripplanner.framework.time.DurationUtils; +import org.opentripplanner.utils.time.DurationUtils; class TimePenaltyTest { diff --git a/application/src/test/java/org/opentripplanner/service/paging/PS1_LegacyMetaDataTest.java b/application/src/test/java/org/opentripplanner/service/paging/PS1_LegacyMetaDataTest.java index 609607d84ff..e87e2a5e406 100644 --- a/application/src/test/java/org/opentripplanner/service/paging/PS1_LegacyMetaDataTest.java +++ b/application/src/test/java/org/opentripplanner/service/paging/PS1_LegacyMetaDataTest.java @@ -5,7 +5,7 @@ import java.time.Duration; import org.junit.jupiter.api.Test; -import org.opentripplanner.framework.time.TimeUtils; +import org.opentripplanner.utils.time.TimeUtils; /** * This tests the entire paging service module. diff --git a/application/src/test/java/org/opentripplanner/service/paging/PS3_FewItinerariesOnSearchWindowLimitTest.java b/application/src/test/java/org/opentripplanner/service/paging/PS3_FewItinerariesOnSearchWindowLimitTest.java index 4db61579a47..fffcf93e5fb 100644 --- a/application/src/test/java/org/opentripplanner/service/paging/PS3_FewItinerariesOnSearchWindowLimitTest.java +++ b/application/src/test/java/org/opentripplanner/service/paging/PS3_FewItinerariesOnSearchWindowLimitTest.java @@ -11,12 +11,12 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.model.plan.Itinerary; import org.opentripplanner.model.plan.ItinerarySortKey; import org.opentripplanner.model.plan.SortOrder; import org.opentripplanner.model.plan.paging.cursor.PageCursor; import org.opentripplanner.model.plan.paging.cursor.PageType; +import org.opentripplanner.utils.time.TimeUtils; /** * This test focus on testing the paging with few itineraries. There should be no page-cuts. The diff --git a/application/src/test/java/org/opentripplanner/service/paging/TestDriver.java b/application/src/test/java/org/opentripplanner/service/paging/TestDriver.java index 928fbaaf01d..e5cbb02012d 100644 --- a/application/src/test/java/org/opentripplanner/service/paging/TestDriver.java +++ b/application/src/test/java/org/opentripplanner/service/paging/TestDriver.java @@ -5,8 +5,6 @@ import java.util.List; import javax.annotation.Nullable; import org.opentripplanner._support.debug.TestDebug; -import org.opentripplanner.framework.collection.ListSection; -import org.opentripplanner.framework.lang.Box; import org.opentripplanner.model.plan.Itinerary; import org.opentripplanner.model.plan.ItinerarySortKey; import org.opentripplanner.model.plan.SortOrder; @@ -15,6 +13,8 @@ import org.opentripplanner.routing.algorithm.filterchain.filters.system.NumItinerariesFilter; import org.opentripplanner.routing.algorithm.filterchain.filters.system.OutsideSearchWindowFilter; import org.opentripplanner.routing.algorithm.filterchain.filters.system.PagingFilter; +import org.opentripplanner.utils.collection.ListSection; +import org.opentripplanner.utils.lang.Box; /** * This class simulate/mock the context the paging is operating in. diff --git a/application/src/test/java/org/opentripplanner/service/paging/TestPagingModel.java b/application/src/test/java/org/opentripplanner/service/paging/TestPagingModel.java index c4db100b56f..9a30b5e8a90 100644 --- a/application/src/test/java/org/opentripplanner/service/paging/TestPagingModel.java +++ b/application/src/test/java/org/opentripplanner/service/paging/TestPagingModel.java @@ -1,13 +1,12 @@ package org.opentripplanner.service.paging; -import static org.opentripplanner.framework.time.TimeUtils.hm2time; import static org.opentripplanner.model.plan.SortOrder.STREET_AND_ARRIVAL_TIME; import static org.opentripplanner.model.plan.SortOrder.STREET_AND_DEPARTURE_TIME; +import static org.opentripplanner.utils.time.TimeUtils.hm2time; import java.time.Duration; import java.time.Instant; import java.util.List; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.model.plan.Itinerary; import org.opentripplanner.model.plan.Place; import org.opentripplanner.model.plan.SortOrder; @@ -15,6 +14,7 @@ import org.opentripplanner.model.plan.paging.cursor.PageCursor; import org.opentripplanner.routing.algorithm.filterchain.framework.sort.SortOrderComparator; import org.opentripplanner.transit.model._data.TimetableRepositoryForTest; +import org.opentripplanner.utils.time.TimeUtils; class TestPagingModel { diff --git a/application/src/test/java/org/opentripplanner/standalone/config/OtpConfigLoaderTest.java b/application/src/test/java/org/opentripplanner/standalone/config/OtpConfigLoaderTest.java index c67983355e1..8dae448e2c6 100644 --- a/application/src/test/java/org/opentripplanner/standalone/config/OtpConfigLoaderTest.java +++ b/application/src/test/java/org/opentripplanner/standalone/config/OtpConfigLoaderTest.java @@ -15,8 +15,8 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.opentripplanner.framework.lang.StringUtils; import org.opentripplanner.standalone.config.framework.file.ConfigFileLoader; +import org.opentripplanner.utils.lang.StringUtils; public class OtpConfigLoaderTest { diff --git a/application/src/test/java/org/opentripplanner/standalone/config/framework/file/ConfigFileLoaderTest.java b/application/src/test/java/org/opentripplanner/standalone/config/framework/file/ConfigFileLoaderTest.java index 6cdba6e4b51..2e698efb64d 100644 --- a/application/src/test/java/org/opentripplanner/standalone/config/framework/file/ConfigFileLoaderTest.java +++ b/application/src/test/java/org/opentripplanner/standalone/config/framework/file/ConfigFileLoaderTest.java @@ -14,8 +14,8 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.opentripplanner.framework.application.OtpAppException; -import org.opentripplanner.framework.lang.StringUtils; import org.opentripplanner.standalone.config.OtpConfigLoader; +import org.opentripplanner.utils.lang.StringUtils; class ConfigFileLoaderTest { diff --git a/application/src/test/java/org/opentripplanner/standalone/config/framework/file/IncludeFileDirectiveTest.java b/application/src/test/java/org/opentripplanner/standalone/config/framework/file/IncludeFileDirectiveTest.java index cfdda47c160..0fc1199236d 100644 --- a/application/src/test/java/org/opentripplanner/standalone/config/framework/file/IncludeFileDirectiveTest.java +++ b/application/src/test/java/org/opentripplanner/standalone/config/framework/file/IncludeFileDirectiveTest.java @@ -8,7 +8,7 @@ import java.nio.file.Files; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Test; -import org.opentripplanner.framework.lang.StringUtils; +import org.opentripplanner.utils.lang.StringUtils; public class IncludeFileDirectiveTest { diff --git a/application/src/test/java/org/opentripplanner/transit/model/timetable/ScheduledTripTimesTest.java b/application/src/test/java/org/opentripplanner/transit/model/timetable/ScheduledTripTimesTest.java index 75bf99a3fcc..06469a34b2a 100644 --- a/application/src/test/java/org/opentripplanner/transit/model/timetable/ScheduledTripTimesTest.java +++ b/application/src/test/java/org/opentripplanner/transit/model/timetable/ScheduledTripTimesTest.java @@ -10,11 +10,11 @@ import java.util.BitSet; import java.util.List; import org.junit.jupiter.api.Test; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.transit.model._data.TimetableRepositoryForTest; import org.opentripplanner.transit.model.basic.Accessibility; import org.opentripplanner.transit.model.framework.DataValidationException; import org.opentripplanner.transit.model.framework.FeedScopedId; +import org.opentripplanner.utils.time.TimeUtils; class ScheduledTripTimesTest { diff --git a/application/src/test/java/org/opentripplanner/transit/model/timetable/booking/BookingTimeTest.java b/application/src/test/java/org/opentripplanner/transit/model/timetable/booking/BookingTimeTest.java index 5036defdb88..88b113aec53 100644 --- a/application/src/test/java/org/opentripplanner/transit/model/timetable/booking/BookingTimeTest.java +++ b/application/src/test/java/org/opentripplanner/transit/model/timetable/booking/BookingTimeTest.java @@ -5,7 +5,7 @@ import java.time.LocalTime; import org.junit.jupiter.api.Test; -import org.opentripplanner.framework.time.TimeUtils; +import org.opentripplanner.utils.time.TimeUtils; class BookingTimeTest { diff --git a/application/src/test/java/org/opentripplanner/transit/model/timetable/booking/RoutingBookingInfoTest.java b/application/src/test/java/org/opentripplanner/transit/model/timetable/booking/RoutingBookingInfoTest.java index e0f507a7983..2b9dfaface8 100644 --- a/application/src/test/java/org/opentripplanner/transit/model/timetable/booking/RoutingBookingInfoTest.java +++ b/application/src/test/java/org/opentripplanner/transit/model/timetable/booking/RoutingBookingInfoTest.java @@ -13,7 +13,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; -import org.opentripplanner.framework.time.TimeUtils; +import org.opentripplanner.utils.time.TimeUtils; class RoutingBookingInfoTest { diff --git a/application/src/test/java/org/opentripplanner/transit/speed_test/ResultPrinter.java b/application/src/test/java/org/opentripplanner/transit/speed_test/ResultPrinter.java index 29348a7e911..1d34c88f08e 100644 --- a/application/src/test/java/org/opentripplanner/transit/speed_test/ResultPrinter.java +++ b/application/src/test/java/org/opentripplanner/transit/speed_test/ResultPrinter.java @@ -1,17 +1,17 @@ package org.opentripplanner.transit.speed_test; -import static org.opentripplanner.framework.time.DurationUtils.msToSecondsStr; +import static org.opentripplanner.utils.time.DurationUtils.msToSecondsStr; import java.util.ArrayList; import java.util.List; import java.util.Map; -import org.opentripplanner.framework.lang.IntUtils; -import org.opentripplanner.framework.text.Table; import org.opentripplanner.transit.speed_test.model.SpeedTestProfile; import org.opentripplanner.transit.speed_test.model.testcase.TestCase; import org.opentripplanner.transit.speed_test.model.testcase.TestCaseFailedException; import org.opentripplanner.transit.speed_test.model.testcase.TestCases; import org.opentripplanner.transit.speed_test.model.timer.SpeedTestTimer; +import org.opentripplanner.utils.lang.IntUtils; +import org.opentripplanner.utils.text.Table; /** * Printing stuff clutters up the code, so it is convenient to put printing and formatting output diff --git a/application/src/test/java/org/opentripplanner/transit/speed_test/model/testcase/ItineraryResultMapper.java b/application/src/test/java/org/opentripplanner/transit/speed_test/model/testcase/ItineraryResultMapper.java index 24cbea4aaa0..18d742b895f 100644 --- a/application/src/test/java/org/opentripplanner/transit/speed_test/model/testcase/ItineraryResultMapper.java +++ b/application/src/test/java/org/opentripplanner/transit/speed_test/model/testcase/ItineraryResultMapper.java @@ -9,7 +9,6 @@ import java.util.Map; import java.util.Set; import java.util.stream.Collectors; -import org.opentripplanner.framework.lang.IntUtils; import org.opentripplanner.model.plan.Itinerary; import org.opentripplanner.model.plan.Leg; import org.opentripplanner.model.plan.StreetLeg; @@ -19,6 +18,7 @@ import org.opentripplanner.transit.model.basic.TransitMode; import org.opentripplanner.transit.model.organization.Agency; import org.opentripplanner.transit.model.site.StopLocation; +import org.opentripplanner.utils.lang.IntUtils; /** * Map an Itinerary to a result instance. We do this to normalize the Itinerary for the purpose of diff --git a/application/src/test/java/org/opentripplanner/transit/speed_test/model/testcase/Result.java b/application/src/test/java/org/opentripplanner/transit/speed_test/model/testcase/Result.java index d44c8e4d8cb..34c63d49dfb 100644 --- a/application/src/test/java/org/opentripplanner/transit/speed_test/model/testcase/Result.java +++ b/application/src/test/java/org/opentripplanner/transit/speed_test/model/testcase/Result.java @@ -4,10 +4,10 @@ import java.util.Collection; import java.util.Comparator; import java.util.List; -import org.opentripplanner.framework.collection.CompositeComparator; -import org.opentripplanner.framework.time.DurationUtils; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.transit.model.basic.TransitMode; +import org.opentripplanner.utils.collection.CompositeComparator; +import org.opentripplanner.utils.time.DurationUtils; +import org.opentripplanner.utils.time.TimeUtils; /** * This class is responsible for holding information about a test result - a single itinerary. The diff --git a/application/src/test/java/org/opentripplanner/transit/speed_test/model/testcase/TableTestReport.java b/application/src/test/java/org/opentripplanner/transit/speed_test/model/testcase/TableTestReport.java index 7534529492f..a746e744a96 100644 --- a/application/src/test/java/org/opentripplanner/transit/speed_test/model/testcase/TableTestReport.java +++ b/application/src/test/java/org/opentripplanner/transit/speed_test/model/testcase/TableTestReport.java @@ -1,16 +1,16 @@ package org.opentripplanner.transit.speed_test.model.testcase; -import static org.opentripplanner.framework.text.Table.Align.Center; -import static org.opentripplanner.framework.text.Table.Align.Left; -import static org.opentripplanner.framework.text.Table.Align.Right; +import static org.opentripplanner.utils.text.Table.Align.Center; +import static org.opentripplanner.utils.text.Table.Align.Left; +import static org.opentripplanner.utils.text.Table.Align.Right; import java.util.Collection; import java.util.List; import java.util.stream.Collectors; -import org.opentripplanner.framework.text.Table; -import org.opentripplanner.framework.text.TableBuilder; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.routing.util.DiffEntry; +import org.opentripplanner.utils.text.Table; +import org.opentripplanner.utils.text.TableBuilder; +import org.opentripplanner.utils.time.TimeUtils; /** * This class is responsible for creating a test report as a table. The Table is easy to read and diff --git a/application/src/test/java/org/opentripplanner/transit/speed_test/model/testcase/TestCaseDefinition.java b/application/src/test/java/org/opentripplanner/transit/speed_test/model/testcase/TestCaseDefinition.java index 4a99798b10e..604a4bd1743 100644 --- a/application/src/test/java/org/opentripplanner/transit/speed_test/model/testcase/TestCaseDefinition.java +++ b/application/src/test/java/org/opentripplanner/transit/speed_test/model/testcase/TestCaseDefinition.java @@ -2,10 +2,10 @@ import java.time.Duration; import org.opentripplanner.api.parameter.QualifiedModeSet; -import org.opentripplanner.framework.time.DurationUtils; -import org.opentripplanner.framework.time.TimeUtils; -import org.opentripplanner.framework.tostring.ValueObjectToStringBuilder; import org.opentripplanner.model.GenericLocation; +import org.opentripplanner.utils.time.DurationUtils; +import org.opentripplanner.utils.time.TimeUtils; +import org.opentripplanner.utils.tostring.ValueObjectToStringBuilder; public record TestCaseDefinition( String id, diff --git a/application/src/test/java/org/opentripplanner/transit/speed_test/model/testcase/io/AbstractCsvFile.java b/application/src/test/java/org/opentripplanner/transit/speed_test/model/testcase/io/AbstractCsvFile.java index c703476290e..fe5287b13c3 100644 --- a/application/src/test/java/org/opentripplanner/transit/speed_test/model/testcase/io/AbstractCsvFile.java +++ b/application/src/test/java/org/opentripplanner/transit/speed_test/model/testcase/io/AbstractCsvFile.java @@ -14,9 +14,9 @@ import java.util.function.Function; import java.util.regex.Pattern; import java.util.stream.Collectors; -import org.opentripplanner.framework.time.DurationUtils; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.transit.speed_test.model.testcase.TestCase; +import org.opentripplanner.utils.time.DurationUtils; +import org.opentripplanner.utils.time.TimeUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/application/src/test/java/org/opentripplanner/updater/trip/TimetableSnapshotSourceTest.java b/application/src/test/java/org/opentripplanner/updater/trip/TimetableSnapshotSourceTest.java index e817c6e18bb..8e3c793666a 100644 --- a/application/src/test/java/org/opentripplanner/updater/trip/TimetableSnapshotSourceTest.java +++ b/application/src/test/java/org/opentripplanner/updater/trip/TimetableSnapshotSourceTest.java @@ -24,7 +24,6 @@ import org.opentripplanner.ConstantsForTests; import org.opentripplanner.TestOtpModel; import org.opentripplanner._support.time.ZoneIds; -import org.opentripplanner.framework.time.ServiceDateUtils; import org.opentripplanner.model.Timetable; import org.opentripplanner.model.TimetableSnapshot; import org.opentripplanner.transit.model.framework.FeedScopedId; @@ -37,6 +36,7 @@ import org.opentripplanner.transit.service.TransitService; import org.opentripplanner.updater.GtfsRealtimeFuzzyTripMatcher; import org.opentripplanner.updater.TimetableSnapshotSourceParameters; +import org.opentripplanner.utils.time.ServiceDateUtils; public class TimetableSnapshotSourceTest { diff --git a/application/src/test/java/org/opentripplanner/updater/trip/TripInput.java b/application/src/test/java/org/opentripplanner/updater/trip/TripInput.java index e4d9309061a..eb4f3685659 100644 --- a/application/src/test/java/org/opentripplanner/updater/trip/TripInput.java +++ b/application/src/test/java/org/opentripplanner/updater/trip/TripInput.java @@ -2,9 +2,9 @@ import java.util.ArrayList; import java.util.List; -import org.opentripplanner.framework.time.TimeUtils; import org.opentripplanner.transit.model.network.Route; import org.opentripplanner.transit.model.site.RegularStop; +import org.opentripplanner.utils.time.TimeUtils; /** * A simple data structure that is used by the {@link RealtimeTestEnvironment} to create diff --git a/application/src/test/java/org/opentripplanner/updater/trip/TripUpdateBuilder.java b/application/src/test/java/org/opentripplanner/updater/trip/TripUpdateBuilder.java index 2960d92a9cd..e8218edfc1f 100644 --- a/application/src/test/java/org/opentripplanner/updater/trip/TripUpdateBuilder.java +++ b/application/src/test/java/org/opentripplanner/updater/trip/TripUpdateBuilder.java @@ -7,7 +7,7 @@ import java.time.LocalDate; import java.time.ZoneId; import java.time.ZonedDateTime; -import org.opentripplanner.framework.time.ServiceDateUtils; +import org.opentripplanner.utils.time.ServiceDateUtils; public class TripUpdateBuilder { diff --git a/utils/src/main/java/org/opentripplanner/utils/collection/CollectionUtils.java b/utils/src/main/java/org/opentripplanner/utils/collection/CollectionUtils.java index 27473dd1383..bb53ec11037 100644 --- a/utils/src/main/java/org/opentripplanner/utils/collection/CollectionUtils.java +++ b/utils/src/main/java/org/opentripplanner/utils/collection/CollectionUtils.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.collection; +package org.opentripplanner.utils.collection; import java.util.Collection; import java.util.Map; diff --git a/utils/src/main/java/org/opentripplanner/utils/collection/CollectionsView.java b/utils/src/main/java/org/opentripplanner/utils/collection/CollectionsView.java index 4ca6ae5f555..599846f9d86 100644 --- a/utils/src/main/java/org/opentripplanner/utils/collection/CollectionsView.java +++ b/utils/src/main/java/org/opentripplanner/utils/collection/CollectionsView.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.collection; +package org.opentripplanner.utils.collection; import java.io.Serializable; import java.util.AbstractCollection; diff --git a/utils/src/main/java/org/opentripplanner/utils/collection/CompositeComparator.java b/utils/src/main/java/org/opentripplanner/utils/collection/CompositeComparator.java index 286df07370a..0c2cf445504 100644 --- a/utils/src/main/java/org/opentripplanner/utils/collection/CompositeComparator.java +++ b/utils/src/main/java/org/opentripplanner/utils/collection/CompositeComparator.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.collection; +package org.opentripplanner.utils.collection; import java.util.Comparator; diff --git a/utils/src/main/java/org/opentripplanner/utils/collection/ListSection.java b/utils/src/main/java/org/opentripplanner/utils/collection/ListSection.java index d9878aa34b1..ce582f32e65 100644 --- a/utils/src/main/java/org/opentripplanner/utils/collection/ListSection.java +++ b/utils/src/main/java/org/opentripplanner/utils/collection/ListSection.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.collection; +package org.opentripplanner.utils.collection; /** * This enum is used to signal which part of a list an operation apply to. You may remove elements diff --git a/utils/src/main/java/org/opentripplanner/utils/collection/ListUtils.java b/utils/src/main/java/org/opentripplanner/utils/collection/ListUtils.java index 35b7e083695..c2f263d0044 100644 --- a/utils/src/main/java/org/opentripplanner/utils/collection/ListUtils.java +++ b/utils/src/main/java/org/opentripplanner/utils/collection/ListUtils.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.collection; +package org.opentripplanner.utils.collection; import java.util.ArrayList; import java.util.Arrays; diff --git a/utils/src/main/java/org/opentripplanner/utils/collection/MapUtils.java b/utils/src/main/java/org/opentripplanner/utils/collection/MapUtils.java index afd1e87aec2..0a67e01b9fb 100644 --- a/utils/src/main/java/org/opentripplanner/utils/collection/MapUtils.java +++ b/utils/src/main/java/org/opentripplanner/utils/collection/MapUtils.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.collection; +package org.opentripplanner.utils.collection; import java.util.Arrays; import java.util.Collection; diff --git a/utils/src/main/java/org/opentripplanner/utils/collection/SetUtils.java b/utils/src/main/java/org/opentripplanner/utils/collection/SetUtils.java index b8f773aab72..fec99c8b28c 100644 --- a/utils/src/main/java/org/opentripplanner/utils/collection/SetUtils.java +++ b/utils/src/main/java/org/opentripplanner/utils/collection/SetUtils.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.collection; +package org.opentripplanner.utils.collection; import java.util.Arrays; import java.util.Collection; diff --git a/utils/src/main/java/org/opentripplanner/utils/lang/ArrayUtils.java b/utils/src/main/java/org/opentripplanner/utils/lang/ArrayUtils.java index a3a67cb67cd..afd8e59ec0b 100644 --- a/utils/src/main/java/org/opentripplanner/utils/lang/ArrayUtils.java +++ b/utils/src/main/java/org/opentripplanner/utils/lang/ArrayUtils.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.lang; +package org.opentripplanner.utils.lang; import javax.annotation.Nullable; diff --git a/utils/src/main/java/org/opentripplanner/utils/lang/BitSetUtils.java b/utils/src/main/java/org/opentripplanner/utils/lang/BitSetUtils.java index 1f5bdb91fab..afb9654e56e 100644 --- a/utils/src/main/java/org/opentripplanner/utils/lang/BitSetUtils.java +++ b/utils/src/main/java/org/opentripplanner/utils/lang/BitSetUtils.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.lang; +package org.opentripplanner.utils.lang; /** * A compact bit set utility class. It rely on the client to store the bit set himself (either as a diff --git a/utils/src/main/java/org/opentripplanner/utils/lang/Box.java b/utils/src/main/java/org/opentripplanner/utils/lang/Box.java index ae54a3c5b7f..e7d32acdbe9 100644 --- a/utils/src/main/java/org/opentripplanner/utils/lang/Box.java +++ b/utils/src/main/java/org/opentripplanner/utils/lang/Box.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.lang; +package org.opentripplanner.utils.lang; import java.util.Objects; import javax.annotation.Nullable; diff --git a/utils/src/main/java/org/opentripplanner/utils/lang/DoubleUtils.java b/utils/src/main/java/org/opentripplanner/utils/lang/DoubleUtils.java index 0267e9e3b5d..a285ade8ad5 100644 --- a/utils/src/main/java/org/opentripplanner/utils/lang/DoubleUtils.java +++ b/utils/src/main/java/org/opentripplanner/utils/lang/DoubleUtils.java @@ -1,6 +1,6 @@ -package org.opentripplanner.framework.lang; +package org.opentripplanner.utils.lang; -import static org.opentripplanner.framework.lang.OtpNumberFormat.formatTwoDecimals; +import static org.opentripplanner.utils.lang.OtpNumberFormat.formatTwoDecimals; import java.math.BigDecimal; import java.math.RoundingMode; diff --git a/utils/src/main/java/org/opentripplanner/utils/lang/IntBox.java b/utils/src/main/java/org/opentripplanner/utils/lang/IntBox.java index 3e7a828a526..c564f6f8e25 100644 --- a/utils/src/main/java/org/opentripplanner/utils/lang/IntBox.java +++ b/utils/src/main/java/org/opentripplanner/utils/lang/IntBox.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.lang; +package org.opentripplanner.utils.lang; /** * An IntBox is a writable container for an int. The most common use-case for this class is to diff --git a/utils/src/main/java/org/opentripplanner/utils/lang/IntRange.java b/utils/src/main/java/org/opentripplanner/utils/lang/IntRange.java index c8ff5b45d46..88477cbce27 100644 --- a/utils/src/main/java/org/opentripplanner/utils/lang/IntRange.java +++ b/utils/src/main/java/org/opentripplanner/utils/lang/IntRange.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.lang; +package org.opentripplanner.utils.lang; import java.util.Objects; import java.util.Optional; diff --git a/utils/src/main/java/org/opentripplanner/utils/lang/IntUtils.java b/utils/src/main/java/org/opentripplanner/utils/lang/IntUtils.java index de4904dcd7c..31dbd9fa72b 100644 --- a/utils/src/main/java/org/opentripplanner/utils/lang/IntUtils.java +++ b/utils/src/main/java/org/opentripplanner/utils/lang/IntUtils.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.lang; +package org.opentripplanner.utils.lang; import java.util.ArrayList; import java.util.Arrays; diff --git a/utils/src/main/java/org/opentripplanner/utils/lang/MemEfficientArrayBuilder.java b/utils/src/main/java/org/opentripplanner/utils/lang/MemEfficientArrayBuilder.java index 7bf36dd5b86..740cfa2e60c 100644 --- a/utils/src/main/java/org/opentripplanner/utils/lang/MemEfficientArrayBuilder.java +++ b/utils/src/main/java/org/opentripplanner/utils/lang/MemEfficientArrayBuilder.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.lang; +package org.opentripplanner.utils.lang; import java.util.Arrays; import java.util.Objects; diff --git a/utils/src/main/java/org/opentripplanner/utils/lang/ObjectUtils.java b/utils/src/main/java/org/opentripplanner/utils/lang/ObjectUtils.java index a3f18748987..da619cdeb79 100644 --- a/utils/src/main/java/org/opentripplanner/utils/lang/ObjectUtils.java +++ b/utils/src/main/java/org/opentripplanner/utils/lang/ObjectUtils.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.lang; +package org.opentripplanner.utils.lang; import java.util.function.Function; import java.util.function.Supplier; diff --git a/utils/src/main/java/org/opentripplanner/utils/lang/OtpNumberFormat.java b/utils/src/main/java/org/opentripplanner/utils/lang/OtpNumberFormat.java index 1ff2aca37a3..3dd1e0d76e7 100644 --- a/utils/src/main/java/org/opentripplanner/utils/lang/OtpNumberFormat.java +++ b/utils/src/main/java/org/opentripplanner/utils/lang/OtpNumberFormat.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.lang; +package org.opentripplanner.utils.lang; import java.math.BigInteger; import java.text.DecimalFormat; diff --git a/utils/src/main/java/org/opentripplanner/utils/lang/Sandbox.java b/utils/src/main/java/org/opentripplanner/utils/lang/Sandbox.java index 67c9644fc0f..5b4d83e7772 100644 --- a/utils/src/main/java/org/opentripplanner/utils/lang/Sandbox.java +++ b/utils/src/main/java/org/opentripplanner/utils/lang/Sandbox.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.lang; +package org.opentripplanner.utils.lang; import static java.lang.annotation.ElementType.CONSTRUCTOR; import static java.lang.annotation.ElementType.FIELD; diff --git a/utils/src/main/java/org/opentripplanner/utils/lang/StringUtils.java b/utils/src/main/java/org/opentripplanner/utils/lang/StringUtils.java index 5d18981e0e3..72eb2638c13 100644 --- a/utils/src/main/java/org/opentripplanner/utils/lang/StringUtils.java +++ b/utils/src/main/java/org/opentripplanner/utils/lang/StringUtils.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.lang; +package org.opentripplanner.utils.lang; import java.util.regex.Pattern; diff --git a/utils/src/main/java/org/opentripplanner/utils/logging/ProgressTracker.java b/utils/src/main/java/org/opentripplanner/utils/logging/ProgressTracker.java index 4be70e2abdf..4922186bfc6 100644 --- a/utils/src/main/java/org/opentripplanner/utils/logging/ProgressTracker.java +++ b/utils/src/main/java/org/opentripplanner/utils/logging/ProgressTracker.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.logging; +package org.opentripplanner.utils.logging; import java.io.InputStream; import java.io.OutputStream; @@ -7,8 +7,8 @@ import java.time.Instant; import java.util.concurrent.atomic.AtomicLong; import java.util.function.Consumer; -import org.opentripplanner.framework.text.FileSizeToTextConverter; -import org.opentripplanner.framework.time.DurationUtils; +import org.opentripplanner.utils.text.FileSizeToTextConverter; +import org.opentripplanner.utils.time.DurationUtils; /** * The progress tracker notify the caller based a time interval. diff --git a/utils/src/main/java/org/opentripplanner/utils/logging/ProgressTrackerInputStream.java b/utils/src/main/java/org/opentripplanner/utils/logging/ProgressTrackerInputStream.java index 1e5a5386275..6e3b71bfe66 100644 --- a/utils/src/main/java/org/opentripplanner/utils/logging/ProgressTrackerInputStream.java +++ b/utils/src/main/java/org/opentripplanner/utils/logging/ProgressTrackerInputStream.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.logging; +package org.opentripplanner.utils.logging; import java.io.IOException; import java.io.InputStream; diff --git a/utils/src/main/java/org/opentripplanner/utils/logging/ProgressTrackerOutputStream.java b/utils/src/main/java/org/opentripplanner/utils/logging/ProgressTrackerOutputStream.java index 38095634bdd..5f4583b8ed7 100644 --- a/utils/src/main/java/org/opentripplanner/utils/logging/ProgressTrackerOutputStream.java +++ b/utils/src/main/java/org/opentripplanner/utils/logging/ProgressTrackerOutputStream.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.logging; +package org.opentripplanner.utils.logging; import java.io.IOException; import java.io.OutputStream; diff --git a/utils/src/main/java/org/opentripplanner/utils/logging/Throttle.java b/utils/src/main/java/org/opentripplanner/utils/logging/Throttle.java index ed8a2c1bef4..393bef0c19a 100644 --- a/utils/src/main/java/org/opentripplanner/utils/logging/Throttle.java +++ b/utils/src/main/java/org/opentripplanner/utils/logging/Throttle.java @@ -1,7 +1,7 @@ -package org.opentripplanner.framework.logging; +package org.opentripplanner.utils.logging; import java.time.Duration; -import org.opentripplanner.framework.time.TimeUtils; +import org.opentripplanner.utils.time.TimeUtils; /** * This class can be used to throttle (logging) events. diff --git a/utils/src/main/java/org/opentripplanner/utils/text/CharacterEscapeFormatter.java b/utils/src/main/java/org/opentripplanner/utils/text/CharacterEscapeFormatter.java index 2bd5bf14b71..46faba6e806 100644 --- a/utils/src/main/java/org/opentripplanner/utils/text/CharacterEscapeFormatter.java +++ b/utils/src/main/java/org/opentripplanner/utils/text/CharacterEscapeFormatter.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.text; +package org.opentripplanner.utils.text; /** * This class is used to escape characters in a string, removing a special character from diff --git a/utils/src/main/java/org/opentripplanner/utils/text/FileSizeToTextConverter.java b/utils/src/main/java/org/opentripplanner/utils/text/FileSizeToTextConverter.java index e110d626480..41b04fd3194 100644 --- a/utils/src/main/java/org/opentripplanner/utils/text/FileSizeToTextConverter.java +++ b/utils/src/main/java/org/opentripplanner/utils/text/FileSizeToTextConverter.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.text; +package org.opentripplanner.utils.text; import java.util.Locale; diff --git a/utils/src/main/java/org/opentripplanner/utils/text/HexString.java b/utils/src/main/java/org/opentripplanner/utils/text/HexString.java index e85a139b624..16d5c56c58b 100644 --- a/utils/src/main/java/org/opentripplanner/utils/text/HexString.java +++ b/utils/src/main/java/org/opentripplanner/utils/text/HexString.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.text; +package org.opentripplanner.utils.text; /** * Converts a byte array to its hexadecimal representation diff --git a/utils/src/main/java/org/opentripplanner/utils/text/MarkdownFormatter.java b/utils/src/main/java/org/opentripplanner/utils/text/MarkdownFormatter.java index 6fdb495a0d5..95e54a1bb3f 100644 --- a/utils/src/main/java/org/opentripplanner/utils/text/MarkdownFormatter.java +++ b/utils/src/main/java/org/opentripplanner/utils/text/MarkdownFormatter.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.text; +package org.opentripplanner.utils.text; import javax.annotation.Nullable; diff --git a/utils/src/main/java/org/opentripplanner/utils/text/Table.java b/utils/src/main/java/org/opentripplanner/utils/text/Table.java index 940868b82e2..bf13c23bcf5 100644 --- a/utils/src/main/java/org/opentripplanner/utils/text/Table.java +++ b/utils/src/main/java/org/opentripplanner/utils/text/Table.java @@ -1,11 +1,11 @@ -package org.opentripplanner.framework.text; +package org.opentripplanner.utils.text; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.List; -import org.opentripplanner.framework.lang.ObjectUtils; -import org.opentripplanner.framework.lang.StringUtils; +import org.opentripplanner.utils.lang.ObjectUtils; +import org.opentripplanner.utils.lang.StringUtils; /** * This class is responsible for creating a pretty table that can be printed to a terminal window. diff --git a/utils/src/main/java/org/opentripplanner/utils/text/TableBuilder.java b/utils/src/main/java/org/opentripplanner/utils/text/TableBuilder.java index 12e80fd62a8..e573cce6c37 100644 --- a/utils/src/main/java/org/opentripplanner/utils/text/TableBuilder.java +++ b/utils/src/main/java/org/opentripplanner/utils/text/TableBuilder.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.text; +package org.opentripplanner.utils.text; import java.util.ArrayList; import java.util.Arrays; diff --git a/utils/src/main/java/org/opentripplanner/utils/text/TableRowFormatter.java b/utils/src/main/java/org/opentripplanner/utils/text/TableRowFormatter.java index 3e7e3c727f9..9db03403a0a 100644 --- a/utils/src/main/java/org/opentripplanner/utils/text/TableRowFormatter.java +++ b/utils/src/main/java/org/opentripplanner/utils/text/TableRowFormatter.java @@ -1,9 +1,9 @@ -package org.opentripplanner.framework.text; +package org.opentripplanner.utils.text; import java.util.List; import java.util.function.Function; -import org.opentripplanner.framework.lang.ObjectUtils; -import org.opentripplanner.framework.lang.StringUtils; +import org.opentripplanner.utils.lang.ObjectUtils; +import org.opentripplanner.utils.lang.StringUtils; class TableRowFormatter { diff --git a/utils/src/main/java/org/opentripplanner/utils/time/CountdownTimer.java b/utils/src/main/java/org/opentripplanner/utils/time/CountdownTimer.java index 5d6d89147a8..674e512c535 100644 --- a/utils/src/main/java/org/opentripplanner/utils/time/CountdownTimer.java +++ b/utils/src/main/java/org/opentripplanner/utils/time/CountdownTimer.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.time; +package org.opentripplanner.utils.time; import java.time.Duration; import java.util.function.LongSupplier; diff --git a/utils/src/main/java/org/opentripplanner/utils/time/DateUtils.java b/utils/src/main/java/org/opentripplanner/utils/time/DateUtils.java index 36f62fb0448..a72098e43ab 100644 --- a/utils/src/main/java/org/opentripplanner/utils/time/DateUtils.java +++ b/utils/src/main/java/org/opentripplanner/utils/time/DateUtils.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.time; +package org.opentripplanner.utils.time; import java.time.Duration; import java.time.Instant; diff --git a/utils/src/main/java/org/opentripplanner/utils/time/DurationUtils.java b/utils/src/main/java/org/opentripplanner/utils/time/DurationUtils.java index 362fe17410e..d73faecee03 100644 --- a/utils/src/main/java/org/opentripplanner/utils/time/DurationUtils.java +++ b/utils/src/main/java/org/opentripplanner/utils/time/DurationUtils.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.time; +package org.opentripplanner.utils.time; import static java.util.Locale.ROOT; diff --git a/utils/src/main/java/org/opentripplanner/utils/time/LocalDateUtils.java b/utils/src/main/java/org/opentripplanner/utils/time/LocalDateUtils.java index dd11065bb12..6b5bf1f8f2f 100644 --- a/utils/src/main/java/org/opentripplanner/utils/time/LocalDateUtils.java +++ b/utils/src/main/java/org/opentripplanner/utils/time/LocalDateUtils.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.time; +package org.opentripplanner.utils.time; import java.time.LocalDate; import java.time.Period; diff --git a/utils/src/main/java/org/opentripplanner/utils/time/OffsetDateTimeParser.java b/utils/src/main/java/org/opentripplanner/utils/time/OffsetDateTimeParser.java index 8b40697977a..1bf33c2959f 100644 --- a/utils/src/main/java/org/opentripplanner/utils/time/OffsetDateTimeParser.java +++ b/utils/src/main/java/org/opentripplanner/utils/time/OffsetDateTimeParser.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.time; +package org.opentripplanner.utils.time; import java.text.ParseException; import java.time.OffsetDateTime; diff --git a/utils/src/main/java/org/opentripplanner/utils/time/RelativeTime.java b/utils/src/main/java/org/opentripplanner/utils/time/RelativeTime.java index b01486f8d7f..b4b13a7c68b 100644 --- a/utils/src/main/java/org/opentripplanner/utils/time/RelativeTime.java +++ b/utils/src/main/java/org/opentripplanner/utils/time/RelativeTime.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.time; +package org.opentripplanner.utils.time; import java.time.LocalDate; import java.time.LocalTime; diff --git a/utils/src/main/java/org/opentripplanner/utils/time/ServiceDateUtils.java b/utils/src/main/java/org/opentripplanner/utils/time/ServiceDateUtils.java index a2652015155..e8243ec6355 100644 --- a/utils/src/main/java/org/opentripplanner/utils/time/ServiceDateUtils.java +++ b/utils/src/main/java/org/opentripplanner/utils/time/ServiceDateUtils.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.time; +package org.opentripplanner.utils.time; import java.text.ParseException; import java.time.Duration; diff --git a/utils/src/main/java/org/opentripplanner/utils/time/TimeUtils.java b/utils/src/main/java/org/opentripplanner/utils/time/TimeUtils.java index f2d2cf5de41..2c1bde17f1b 100644 --- a/utils/src/main/java/org/opentripplanner/utils/time/TimeUtils.java +++ b/utils/src/main/java/org/opentripplanner/utils/time/TimeUtils.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.time; +package org.opentripplanner.utils.time; import java.security.SecureRandom; import java.time.Duration; diff --git a/utils/src/main/java/org/opentripplanner/utils/tostring/MultiLineToStringBuilder.java b/utils/src/main/java/org/opentripplanner/utils/tostring/MultiLineToStringBuilder.java index 32f5762843a..a3d794aef63 100644 --- a/utils/src/main/java/org/opentripplanner/utils/tostring/MultiLineToStringBuilder.java +++ b/utils/src/main/java/org/opentripplanner/utils/tostring/MultiLineToStringBuilder.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.tostring; +package org.opentripplanner.utils.tostring; import java.time.Duration; import java.util.ArrayList; @@ -8,7 +8,7 @@ import java.util.function.Function; import java.util.function.Predicate; import java.util.stream.Collectors; -import org.opentripplanner.framework.time.DurationUtils; +import org.opentripplanner.utils.time.DurationUtils; /** * When debug logging it is much more readable if the logging is nicely formatted with line-breaks. diff --git a/utils/src/main/java/org/opentripplanner/utils/tostring/ToStringBuilder.java b/utils/src/main/java/org/opentripplanner/utils/tostring/ToStringBuilder.java index f600a2a31bc..de40951ff75 100644 --- a/utils/src/main/java/org/opentripplanner/utils/tostring/ToStringBuilder.java +++ b/utils/src/main/java/org/opentripplanner/utils/tostring/ToStringBuilder.java @@ -1,7 +1,7 @@ -package org.opentripplanner.framework.tostring; +package org.opentripplanner.utils.tostring; import static java.lang.Boolean.TRUE; -import static org.opentripplanner.framework.time.DurationUtils.durationToStr; +import static org.opentripplanner.utils.time.DurationUtils.durationToStr; import java.time.Duration; import java.time.Instant; @@ -16,10 +16,10 @@ import java.util.function.Supplier; import java.util.stream.Collectors; import javax.annotation.Nullable; -import org.opentripplanner.framework.lang.ObjectUtils; -import org.opentripplanner.framework.lang.OtpNumberFormat; -import org.opentripplanner.framework.time.DurationUtils; -import org.opentripplanner.framework.time.TimeUtils; +import org.opentripplanner.utils.lang.ObjectUtils; +import org.opentripplanner.utils.lang.OtpNumberFormat; +import org.opentripplanner.utils.time.DurationUtils; +import org.opentripplanner.utils.time.TimeUtils; /** * This toString builder which add elements to a compact string of the form: diff --git a/utils/src/main/java/org/opentripplanner/utils/tostring/ValueObjectToStringBuilder.java b/utils/src/main/java/org/opentripplanner/utils/tostring/ValueObjectToStringBuilder.java index 14584a8dd4a..e80323ee0fb 100644 --- a/utils/src/main/java/org/opentripplanner/utils/tostring/ValueObjectToStringBuilder.java +++ b/utils/src/main/java/org/opentripplanner/utils/tostring/ValueObjectToStringBuilder.java @@ -1,11 +1,11 @@ -package org.opentripplanner.framework.tostring; +package org.opentripplanner.utils.tostring; import java.time.Duration; import java.time.Instant; import java.util.function.Function; -import org.opentripplanner.framework.lang.OtpNumberFormat; -import org.opentripplanner.framework.time.DurationUtils; -import org.opentripplanner.framework.time.TimeUtils; +import org.opentripplanner.utils.lang.OtpNumberFormat; +import org.opentripplanner.utils.time.DurationUtils; +import org.opentripplanner.utils.time.TimeUtils; /** * Use this to-string-builder to build value objects. A [ValueObject](http://wiki.c2.com/?ValueObject) diff --git a/utils/src/test/java/org/opentripplanner/utils/collection/CollectionUtilsTest.java b/utils/src/test/java/org/opentripplanner/utils/collection/CollectionUtilsTest.java index 9cfe118f984..a79f91e3464 100644 --- a/utils/src/test/java/org/opentripplanner/utils/collection/CollectionUtilsTest.java +++ b/utils/src/test/java/org/opentripplanner/utils/collection/CollectionUtilsTest.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.collection; +package org.opentripplanner.utils.collection; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; diff --git a/utils/src/test/java/org/opentripplanner/utils/collection/CollectionsViewTest.java b/utils/src/test/java/org/opentripplanner/utils/collection/CollectionsViewTest.java index 4196ff98e08..191540f3876 100644 --- a/utils/src/test/java/org/opentripplanner/utils/collection/CollectionsViewTest.java +++ b/utils/src/test/java/org/opentripplanner/utils/collection/CollectionsViewTest.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.collection; +package org.opentripplanner.utils.collection; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; diff --git a/utils/src/test/java/org/opentripplanner/utils/collection/CompositeComparatorTest.java b/utils/src/test/java/org/opentripplanner/utils/collection/CompositeComparatorTest.java index 5329683d336..03dbb7d1c71 100644 --- a/utils/src/test/java/org/opentripplanner/utils/collection/CompositeComparatorTest.java +++ b/utils/src/test/java/org/opentripplanner/utils/collection/CompositeComparatorTest.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.collection; +package org.opentripplanner.utils.collection; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/utils/src/test/java/org/opentripplanner/utils/collection/ListSectionTest.java b/utils/src/test/java/org/opentripplanner/utils/collection/ListSectionTest.java index 199804e4881..01ce5a2d336 100644 --- a/utils/src/test/java/org/opentripplanner/utils/collection/ListSectionTest.java +++ b/utils/src/test/java/org/opentripplanner/utils/collection/ListSectionTest.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.collection; +package org.opentripplanner.utils.collection; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; diff --git a/utils/src/test/java/org/opentripplanner/utils/collection/ListUtilsTest.java b/utils/src/test/java/org/opentripplanner/utils/collection/ListUtilsTest.java index 33dce1f5574..602182a64b4 100644 --- a/utils/src/test/java/org/opentripplanner/utils/collection/ListUtilsTest.java +++ b/utils/src/test/java/org/opentripplanner/utils/collection/ListUtilsTest.java @@ -1,9 +1,9 @@ -package org.opentripplanner.framework.collection; +package org.opentripplanner.utils.collection; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; -import static org.opentripplanner.framework.collection.ListUtils.first; -import static org.opentripplanner.framework.collection.ListUtils.last; +import static org.opentripplanner.utils.collection.ListUtils.first; +import static org.opentripplanner.utils.collection.ListUtils.last; import java.util.List; import org.junit.jupiter.api.Test; diff --git a/utils/src/test/java/org/opentripplanner/utils/collection/MapUtilsTest.java b/utils/src/test/java/org/opentripplanner/utils/collection/MapUtilsTest.java index 047a8e61d6b..100e56fec03 100644 --- a/utils/src/test/java/org/opentripplanner/utils/collection/MapUtilsTest.java +++ b/utils/src/test/java/org/opentripplanner/utils/collection/MapUtilsTest.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.collection; +package org.opentripplanner.utils.collection; import static java.util.Collections.singleton; import static java.util.Collections.singletonList; @@ -6,7 +6,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.opentripplanner.framework.collection.MapUtils.mapToList; +import static org.opentripplanner.utils.collection.MapUtils.mapToList; import java.util.Collections; import java.util.Map; diff --git a/utils/src/test/java/org/opentripplanner/utils/collection/SetUtilsTest.java b/utils/src/test/java/org/opentripplanner/utils/collection/SetUtilsTest.java index 8e55e27e79b..e1c8d84eca3 100644 --- a/utils/src/test/java/org/opentripplanner/utils/collection/SetUtilsTest.java +++ b/utils/src/test/java/org/opentripplanner/utils/collection/SetUtilsTest.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.collection; +package org.opentripplanner.utils.collection; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/utils/src/test/java/org/opentripplanner/utils/lang/ArrayUtilsTest.java b/utils/src/test/java/org/opentripplanner/utils/lang/ArrayUtilsTest.java index 8933555e75c..9d512af5770 100644 --- a/utils/src/test/java/org/opentripplanner/utils/lang/ArrayUtilsTest.java +++ b/utils/src/test/java/org/opentripplanner/utils/lang/ArrayUtilsTest.java @@ -1,8 +1,8 @@ -package org.opentripplanner.framework.lang; +package org.opentripplanner.utils.lang; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.opentripplanner.framework.lang.ArrayUtils.hasContent; +import static org.opentripplanner.utils.lang.ArrayUtils.hasContent; import org.junit.jupiter.api.Test; diff --git a/utils/src/test/java/org/opentripplanner/utils/lang/BitSetUtilsTest.java b/utils/src/test/java/org/opentripplanner/utils/lang/BitSetUtilsTest.java index 83da400f69c..6327da849b4 100644 --- a/utils/src/test/java/org/opentripplanner/utils/lang/BitSetUtilsTest.java +++ b/utils/src/test/java/org/opentripplanner/utils/lang/BitSetUtilsTest.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.lang; +package org.opentripplanner.utils.lang; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/utils/src/test/java/org/opentripplanner/utils/lang/BoxTest.java b/utils/src/test/java/org/opentripplanner/utils/lang/BoxTest.java index 7e072fd2f5a..b9f9218fe07 100644 --- a/utils/src/test/java/org/opentripplanner/utils/lang/BoxTest.java +++ b/utils/src/test/java/org/opentripplanner/utils/lang/BoxTest.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.lang; +package org.opentripplanner.utils.lang; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; diff --git a/utils/src/test/java/org/opentripplanner/utils/lang/DoubleUtilsTest.java b/utils/src/test/java/org/opentripplanner/utils/lang/DoubleUtilsTest.java index cb3b0e8b1d6..415b5e939b9 100644 --- a/utils/src/test/java/org/opentripplanner/utils/lang/DoubleUtilsTest.java +++ b/utils/src/test/java/org/opentripplanner/utils/lang/DoubleUtilsTest.java @@ -1,15 +1,15 @@ -package org.opentripplanner.framework.lang; +package org.opentripplanner.utils.lang; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.opentripplanner.framework.lang.DoubleUtils.requireInRange; -import static org.opentripplanner.framework.lang.DoubleUtils.roundTo1Decimal; -import static org.opentripplanner.framework.lang.DoubleUtils.roundTo2Decimals; -import static org.opentripplanner.framework.lang.DoubleUtils.roundTo3Decimals; -import static org.opentripplanner.framework.lang.DoubleUtils.roundTo4Decimals; -import static org.opentripplanner.framework.lang.DoubleUtils.roundToZeroDecimals; +import static org.opentripplanner.utils.lang.DoubleUtils.requireInRange; +import static org.opentripplanner.utils.lang.DoubleUtils.roundTo1Decimal; +import static org.opentripplanner.utils.lang.DoubleUtils.roundTo2Decimals; +import static org.opentripplanner.utils.lang.DoubleUtils.roundTo3Decimals; +import static org.opentripplanner.utils.lang.DoubleUtils.roundTo4Decimals; +import static org.opentripplanner.utils.lang.DoubleUtils.roundToZeroDecimals; import org.junit.jupiter.api.Test; diff --git a/utils/src/test/java/org/opentripplanner/utils/lang/IntBoxTest.java b/utils/src/test/java/org/opentripplanner/utils/lang/IntBoxTest.java index d2151b4bea7..1dea3cb7d79 100644 --- a/utils/src/test/java/org/opentripplanner/utils/lang/IntBoxTest.java +++ b/utils/src/test/java/org/opentripplanner/utils/lang/IntBoxTest.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.lang; +package org.opentripplanner.utils.lang; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; diff --git a/utils/src/test/java/org/opentripplanner/utils/lang/IntRangeTest.java b/utils/src/test/java/org/opentripplanner/utils/lang/IntRangeTest.java index da6300b3953..f568cd5df36 100644 --- a/utils/src/test/java/org/opentripplanner/utils/lang/IntRangeTest.java +++ b/utils/src/test/java/org/opentripplanner/utils/lang/IntRangeTest.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.lang; +package org.opentripplanner.utils.lang; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; diff --git a/utils/src/test/java/org/opentripplanner/utils/lang/IntUtilsTest.java b/utils/src/test/java/org/opentripplanner/utils/lang/IntUtilsTest.java index 3d5c92c9258..99b32f47f0a 100644 --- a/utils/src/test/java/org/opentripplanner/utils/lang/IntUtilsTest.java +++ b/utils/src/test/java/org/opentripplanner/utils/lang/IntUtilsTest.java @@ -1,18 +1,18 @@ -package org.opentripplanner.framework.lang; +package org.opentripplanner.utils.lang; import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.opentripplanner.framework.lang.IntUtils.concat; -import static org.opentripplanner.framework.lang.IntUtils.intArray; -import static org.opentripplanner.framework.lang.IntUtils.intArrayToString; -import static org.opentripplanner.framework.lang.IntUtils.intToString; -import static org.opentripplanner.framework.lang.IntUtils.requireInRange; -import static org.opentripplanner.framework.lang.IntUtils.requireNotNegative; -import static org.opentripplanner.framework.lang.IntUtils.requireNullOrNotNegative; -import static org.opentripplanner.framework.lang.IntUtils.shiftArray; -import static org.opentripplanner.framework.lang.IntUtils.standardDeviation; +import static org.opentripplanner.utils.lang.IntUtils.concat; +import static org.opentripplanner.utils.lang.IntUtils.intArray; +import static org.opentripplanner.utils.lang.IntUtils.intArrayToString; +import static org.opentripplanner.utils.lang.IntUtils.intToString; +import static org.opentripplanner.utils.lang.IntUtils.requireInRange; +import static org.opentripplanner.utils.lang.IntUtils.requireNotNegative; +import static org.opentripplanner.utils.lang.IntUtils.requireNullOrNotNegative; +import static org.opentripplanner.utils.lang.IntUtils.shiftArray; +import static org.opentripplanner.utils.lang.IntUtils.standardDeviation; import java.util.List; import org.junit.jupiter.api.Test; diff --git a/utils/src/test/java/org/opentripplanner/utils/lang/MemEfficientArrayBuilderTest.java b/utils/src/test/java/org/opentripplanner/utils/lang/MemEfficientArrayBuilderTest.java index 16468868fe7..99297b29f1d 100644 --- a/utils/src/test/java/org/opentripplanner/utils/lang/MemEfficientArrayBuilderTest.java +++ b/utils/src/test/java/org/opentripplanner/utils/lang/MemEfficientArrayBuilderTest.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.lang; +package org.opentripplanner.utils.lang; import static java.time.DayOfWeek.MONDAY; import static java.time.DayOfWeek.SATURDAY; diff --git a/utils/src/test/java/org/opentripplanner/utils/lang/ObjectUtilsTest.java b/utils/src/test/java/org/opentripplanner/utils/lang/ObjectUtilsTest.java index 274fb3e8700..3f6283543fc 100644 --- a/utils/src/test/java/org/opentripplanner/utils/lang/ObjectUtilsTest.java +++ b/utils/src/test/java/org/opentripplanner/utils/lang/ObjectUtilsTest.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.lang; +package org.opentripplanner.utils.lang; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; diff --git a/utils/src/test/java/org/opentripplanner/utils/lang/OtpNumberFormatTest.java b/utils/src/test/java/org/opentripplanner/utils/lang/OtpNumberFormatTest.java index af5d28af94b..b8cfe684692 100644 --- a/utils/src/test/java/org/opentripplanner/utils/lang/OtpNumberFormatTest.java +++ b/utils/src/test/java/org/opentripplanner/utils/lang/OtpNumberFormatTest.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.lang; +package org.opentripplanner.utils.lang; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/utils/src/test/java/org/opentripplanner/utils/lang/StringUtilsTest.java b/utils/src/test/java/org/opentripplanner/utils/lang/StringUtilsTest.java index 0e67344b2bb..7e8f0a6217b 100644 --- a/utils/src/test/java/org/opentripplanner/utils/lang/StringUtilsTest.java +++ b/utils/src/test/java/org/opentripplanner/utils/lang/StringUtilsTest.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.lang; +package org.opentripplanner.utils.lang; import static java.lang.Boolean.FALSE; import static java.lang.Boolean.TRUE; diff --git a/utils/src/test/java/org/opentripplanner/utils/logging/ProgressTrackerTest.java b/utils/src/test/java/org/opentripplanner/utils/logging/ProgressTrackerTest.java index fbbc7b9a7a6..c297aac136f 100644 --- a/utils/src/test/java/org/opentripplanner/utils/logging/ProgressTrackerTest.java +++ b/utils/src/test/java/org/opentripplanner/utils/logging/ProgressTrackerTest.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.logging; +package org.opentripplanner.utils.logging; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; diff --git a/utils/src/test/java/org/opentripplanner/utils/logging/ThrottleTest.java b/utils/src/test/java/org/opentripplanner/utils/logging/ThrottleTest.java index c9155992daa..eec907588c6 100644 --- a/utils/src/test/java/org/opentripplanner/utils/logging/ThrottleTest.java +++ b/utils/src/test/java/org/opentripplanner/utils/logging/ThrottleTest.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.logging; +package org.opentripplanner.utils.logging; import java.time.Duration; import java.util.ArrayList; diff --git a/utils/src/test/java/org/opentripplanner/utils/text/CharacterEscapeFormatterTest.java b/utils/src/test/java/org/opentripplanner/utils/text/CharacterEscapeFormatterTest.java index b33b06babb6..15dc7139f30 100644 --- a/utils/src/test/java/org/opentripplanner/utils/text/CharacterEscapeFormatterTest.java +++ b/utils/src/test/java/org/opentripplanner/utils/text/CharacterEscapeFormatterTest.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.text; +package org.opentripplanner.utils.text; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; diff --git a/utils/src/test/java/org/opentripplanner/utils/text/FileSizeToTextConverterTest.java b/utils/src/test/java/org/opentripplanner/utils/text/FileSizeToTextConverterTest.java index 0d91792423b..b860ff3f09d 100644 --- a/utils/src/test/java/org/opentripplanner/utils/text/FileSizeToTextConverterTest.java +++ b/utils/src/test/java/org/opentripplanner/utils/text/FileSizeToTextConverterTest.java @@ -1,7 +1,7 @@ -package org.opentripplanner.framework.text; +package org.opentripplanner.utils.text; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.opentripplanner.framework.text.FileSizeToTextConverter.fileSizeToString; +import static org.opentripplanner.utils.text.FileSizeToTextConverter.fileSizeToString; import org.junit.jupiter.api.Test; diff --git a/utils/src/test/java/org/opentripplanner/utils/text/HexStringTest.java b/utils/src/test/java/org/opentripplanner/utils/text/HexStringTest.java index 2a565857155..7efc4e3fa61 100644 --- a/utils/src/test/java/org/opentripplanner/utils/text/HexStringTest.java +++ b/utils/src/test/java/org/opentripplanner/utils/text/HexStringTest.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.text; +package org.opentripplanner.utils.text; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/utils/src/test/java/org/opentripplanner/utils/text/MarkdownFormatterTest.java b/utils/src/test/java/org/opentripplanner/utils/text/MarkdownFormatterTest.java index b31f7fd8a26..602d9e3b6c5 100644 --- a/utils/src/test/java/org/opentripplanner/utils/text/MarkdownFormatterTest.java +++ b/utils/src/test/java/org/opentripplanner/utils/text/MarkdownFormatterTest.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.text; +package org.opentripplanner.utils.text; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/utils/src/test/java/org/opentripplanner/utils/text/TableTest.java b/utils/src/test/java/org/opentripplanner/utils/text/TableTest.java index f79a766c80c..98915faebb1 100644 --- a/utils/src/test/java/org/opentripplanner/utils/text/TableTest.java +++ b/utils/src/test/java/org/opentripplanner/utils/text/TableTest.java @@ -1,10 +1,10 @@ -package org.opentripplanner.framework.text; +package org.opentripplanner.utils.text; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.opentripplanner.framework.text.Table.Align.Center; -import static org.opentripplanner.framework.text.Table.Align.Left; -import static org.opentripplanner.framework.text.Table.Align.Right; +import static org.opentripplanner.utils.text.Table.Align.Center; +import static org.opentripplanner.utils.text.Table.Align.Left; +import static org.opentripplanner.utils.text.Table.Align.Right; import org.junit.jupiter.api.Test; diff --git a/utils/src/test/java/org/opentripplanner/utils/time/CountdownTimerTest.java b/utils/src/test/java/org/opentripplanner/utils/time/CountdownTimerTest.java index 4d5bdd6fe1d..a30be79cbf9 100644 --- a/utils/src/test/java/org/opentripplanner/utils/time/CountdownTimerTest.java +++ b/utils/src/test/java/org/opentripplanner/utils/time/CountdownTimerTest.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.time; +package org.opentripplanner.utils.time; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/utils/src/test/java/org/opentripplanner/utils/time/DateUtilsTest.java b/utils/src/test/java/org/opentripplanner/utils/time/DateUtilsTest.java index 6b2e493b735..ac153b9a2ba 100644 --- a/utils/src/test/java/org/opentripplanner/utils/time/DateUtilsTest.java +++ b/utils/src/test/java/org/opentripplanner/utils/time/DateUtilsTest.java @@ -1,7 +1,7 @@ -package org.opentripplanner.framework.time; +package org.opentripplanner.utils.time; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.opentripplanner.framework.time.DateUtils.secToHHMM; +import static org.opentripplanner.utils.time.DateUtils.secToHHMM; import java.time.LocalDate; import java.time.ZoneId; diff --git a/utils/src/test/java/org/opentripplanner/utils/time/DurationUtilsTest.java b/utils/src/test/java/org/opentripplanner/utils/time/DurationUtilsTest.java index de6ac046310..ef2e0f50901 100644 --- a/utils/src/test/java/org/opentripplanner/utils/time/DurationUtilsTest.java +++ b/utils/src/test/java/org/opentripplanner/utils/time/DurationUtilsTest.java @@ -1,13 +1,13 @@ -package org.opentripplanner.framework.time; +package org.opentripplanner.utils.time; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.params.provider.Arguments.of; -import static org.opentripplanner.framework.time.DurationUtils.requireNonNegative; -import static org.opentripplanner.framework.time.DurationUtils.requireNonNegativeMax2days; -import static org.opentripplanner.framework.time.DurationUtils.requireNonNegativeMax2hours; -import static org.opentripplanner.framework.time.DurationUtils.requireNonNegativeMax30minutes; -import static org.opentripplanner.framework.time.DurationUtils.toIntMilliseconds; +import static org.opentripplanner.utils.time.DurationUtils.requireNonNegative; +import static org.opentripplanner.utils.time.DurationUtils.requireNonNegativeMax2days; +import static org.opentripplanner.utils.time.DurationUtils.requireNonNegativeMax2hours; +import static org.opentripplanner.utils.time.DurationUtils.requireNonNegativeMax30minutes; +import static org.opentripplanner.utils.time.DurationUtils.toIntMilliseconds; import java.time.Duration; import java.time.format.DateTimeParseException; diff --git a/utils/src/test/java/org/opentripplanner/utils/time/LocalDateUtilsTest.java b/utils/src/test/java/org/opentripplanner/utils/time/LocalDateUtilsTest.java index fa6a25ab3d7..4a0ae7e37d9 100644 --- a/utils/src/test/java/org/opentripplanner/utils/time/LocalDateUtilsTest.java +++ b/utils/src/test/java/org/opentripplanner/utils/time/LocalDateUtilsTest.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.time; +package org.opentripplanner.utils.time; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/utils/src/test/java/org/opentripplanner/utils/time/OffsetDateTimeParserTest.java b/utils/src/test/java/org/opentripplanner/utils/time/OffsetDateTimeParserTest.java index d8944b9a5f0..a114cc96788 100644 --- a/utils/src/test/java/org/opentripplanner/utils/time/OffsetDateTimeParserTest.java +++ b/utils/src/test/java/org/opentripplanner/utils/time/OffsetDateTimeParserTest.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.time; +package org.opentripplanner.utils.time; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/utils/src/test/java/org/opentripplanner/utils/time/ServiceDateUtilsTest.java b/utils/src/test/java/org/opentripplanner/utils/time/ServiceDateUtilsTest.java index 92a67df9110..028b53b064a 100644 --- a/utils/src/test/java/org/opentripplanner/utils/time/ServiceDateUtilsTest.java +++ b/utils/src/test/java/org/opentripplanner/utils/time/ServiceDateUtilsTest.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.time; +package org.opentripplanner.utils.time; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; @@ -6,7 +6,7 @@ import static org.junit.jupiter.api.Assertions.assertSame; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.opentripplanner.framework.time.ServiceDateUtils.asStartOfService; +import static org.opentripplanner.utils.time.ServiceDateUtils.asStartOfService; import java.text.ParseException; import java.time.Duration; diff --git a/utils/src/test/java/org/opentripplanner/utils/time/TimeUtilsTest.java b/utils/src/test/java/org/opentripplanner/utils/time/TimeUtilsTest.java index 936102f3496..d5c0e519742 100644 --- a/utils/src/test/java/org/opentripplanner/utils/time/TimeUtilsTest.java +++ b/utils/src/test/java/org/opentripplanner/utils/time/TimeUtilsTest.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.time; +package org.opentripplanner.utils.time; import static java.time.ZoneOffset.UTC; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/utils/src/test/java/org/opentripplanner/utils/time/ZoneIds.java b/utils/src/test/java/org/opentripplanner/utils/time/ZoneIds.java index e42dc718790..0e3244dcd36 100644 --- a/utils/src/test/java/org/opentripplanner/utils/time/ZoneIds.java +++ b/utils/src/test/java/org/opentripplanner/utils/time/ZoneIds.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.time; +package org.opentripplanner.utils.time; import java.time.ZoneId; diff --git a/utils/src/test/java/org/opentripplanner/utils/tostring/MultiLineToStringBuilderTest.java b/utils/src/test/java/org/opentripplanner/utils/tostring/MultiLineToStringBuilderTest.java index 495a8649cef..55b43517e18 100644 --- a/utils/src/test/java/org/opentripplanner/utils/tostring/MultiLineToStringBuilderTest.java +++ b/utils/src/test/java/org/opentripplanner/utils/tostring/MultiLineToStringBuilderTest.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.tostring; +package org.opentripplanner.utils.tostring; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/utils/src/test/java/org/opentripplanner/utils/tostring/ToStringBuilderTest.java b/utils/src/test/java/org/opentripplanner/utils/tostring/ToStringBuilderTest.java index 59d1eea4d0b..477f48e7c63 100644 --- a/utils/src/test/java/org/opentripplanner/utils/tostring/ToStringBuilderTest.java +++ b/utils/src/test/java/org/opentripplanner/utils/tostring/ToStringBuilderTest.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.tostring; +package org.opentripplanner.utils.tostring; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -13,8 +13,8 @@ import java.util.Objects; import java.util.function.Function; import org.junit.jupiter.api.Test; -import org.opentripplanner.framework.time.TimeUtils; -import org.opentripplanner.framework.time.ZoneIds; +import org.opentripplanner.utils.time.TimeUtils; +import org.opentripplanner.utils.time.ZoneIds; public class ToStringBuilderTest { diff --git a/utils/src/test/java/org/opentripplanner/utils/tostring/ValueObjectToStringBuilderTest.java b/utils/src/test/java/org/opentripplanner/utils/tostring/ValueObjectToStringBuilderTest.java index a59a0bf9b90..01a9beac141 100644 --- a/utils/src/test/java/org/opentripplanner/utils/tostring/ValueObjectToStringBuilderTest.java +++ b/utils/src/test/java/org/opentripplanner/utils/tostring/ValueObjectToStringBuilderTest.java @@ -1,4 +1,4 @@ -package org.opentripplanner.framework.tostring; +package org.opentripplanner.utils.tostring; import static org.junit.jupiter.api.Assertions.assertEquals; From 031168ead5c2b8b123e1df04619ce3cead4c4ad0 Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Tue, 29 Oct 2024 23:06:06 +0100 Subject: [PATCH 088/110] refactor: Fix broken architecture tests. --- .../OtpArchitectureModules.java | 18 +++++++--- .../framework/FrameworkArchitectureTest.java | 36 +++---------------- 2 files changed, 18 insertions(+), 36 deletions(-) diff --git a/application/src/test/java/org/opentripplanner/OtpArchitectureModules.java b/application/src/test/java/org/opentripplanner/OtpArchitectureModules.java index 72520acaa1c..8d6fc431f50 100644 --- a/application/src/test/java/org/opentripplanner/OtpArchitectureModules.java +++ b/application/src/test/java/org/opentripplanner/OtpArchitectureModules.java @@ -18,6 +18,9 @@ public interface OtpArchitectureModules { /* OTP Modules */ Package OTP_ROOT = Package.of("org.opentripplanner"); + + Package UTILS_PACKAGE = OTP_ROOT.subPackage("utils"); + Package DATASTORE = OTP_ROOT.subPackage("datastore"); Package FRAMEWORK = OTP_ROOT.subPackage("framework"); Module GEO_UTILS = Module.of(JTS_GEOM, FRAMEWORK.subPackage("geometry")); @@ -37,15 +40,20 @@ public interface OtpArchitectureModules { * This is a bag of TRUE util classes - no dependencies to other OTP classes or frameworks * (except true utilities like slf4j). */ + Module OTP_UTILS = Module.of( + UTILS_PACKAGE.subPackage("collection"), + UTILS_PACKAGE.subPackage("lang"), + UTILS_PACKAGE.subPackage("logging"), + UTILS_PACKAGE.subPackage("text"), + UTILS_PACKAGE.subPackage("time"), + UTILS_PACKAGE.subPackage("tostring") + ); + Module FRAMEWORK_UTILS = Module.of( + OTP_UTILS, FRAMEWORK.subPackage("application"), FRAMEWORK.subPackage("error"), FRAMEWORK.subPackage("i18n"), - FRAMEWORK.subPackage("lang"), - FRAMEWORK.subPackage("logging"), - FRAMEWORK.subPackage("text"), - FRAMEWORK.subPackage("time"), - FRAMEWORK.subPackage("tostring"), FRAMEWORK.subPackage("concurrent"), FRAMEWORK.subPackage("doc") ); diff --git a/application/src/test/java/org/opentripplanner/framework/FrameworkArchitectureTest.java b/application/src/test/java/org/opentripplanner/framework/FrameworkArchitectureTest.java index 9e44dd05dda..1bfc576d822 100644 --- a/application/src/test/java/org/opentripplanner/framework/FrameworkArchitectureTest.java +++ b/application/src/test/java/org/opentripplanner/framework/FrameworkArchitectureTest.java @@ -6,6 +6,7 @@ import static org.opentripplanner.OtpArchitectureModules.GNU_TROVE; import static org.opentripplanner.OtpArchitectureModules.JTS_GEOM; import static org.opentripplanner.OtpArchitectureModules.OPEN_GIS; +import static org.opentripplanner.OtpArchitectureModules.OTP_UTILS; import org.junit.jupiter.api.Test; import org.opentripplanner._support.arch.Module; @@ -27,16 +28,13 @@ public class FrameworkArchitectureTest { private static final Package GEOMETRY = FRAMEWORK.subPackage("geometry"); private static final Package I18N = FRAMEWORK.subPackage("i18n"); private static final Package IO = FRAMEWORK.subPackage("io"); - private static final Package LANG = FRAMEWORK.subPackage("lang"); private static final Package LOGGING = FRAMEWORK.subPackage("logging"); private static final Package RESOURCES = FRAMEWORK.subPackage("resources"); - private static final Package TEXT = FRAMEWORK.subPackage("text"); private static final Package TIME = FRAMEWORK.subPackage("time"); - private static final Package TO_STRING = FRAMEWORK.subPackage("tostring"); @Test void enforceApplicationPackageDependencies() { - APPLICATION.dependsOn(LANG).verify(); + APPLICATION.dependsOn(OTP_UTILS).verify(); } @Test @@ -52,16 +50,7 @@ void enforceFunctionalPackageDependencies() { @Test void enforceGeometryPackageDependencies() { GEOMETRY - .dependsOn( - GEO_JSON, - GEO_TOOLS, - GNU_TROVE, - JTS_GEOM, - OPEN_GIS, - LANG, - TO_STRING, - GUAVA_COLLECTIONS - ) + .dependsOn(GEO_JSON, GEO_TOOLS, GNU_TROVE, JTS_GEOM, OPEN_GIS, GUAVA_COLLECTIONS, OTP_UTILS) .verify(); } @@ -75,14 +64,9 @@ void enforceIoPackageDependencies() { IO.dependsOn(APACHE_HTTP, XML_MODULES).verify(); } - @Test - void enforceLangPackageDependencies() { - LANG.verify(); - } - @Test void enforceLoggingPackageDependencies() { - LOGGING.dependsOn(TEXT, TIME).verify(); + LOGGING.dependsOn(OTP_UTILS).verify(); } @Test @@ -90,18 +74,8 @@ void enforceResourcesPackageDependencies() { RESOURCES.verify(); } - @Test - void enforceTextPackageDependencies() { - TEXT.dependsOn(LANG).verify(); - } - @Test void enforceTimePackageDependencies() { - TIME.dependsOn(LOGGING).verify(); - } - - @Test - void enforceToStingPackageDependencies() { - TO_STRING.dependsOn(LANG, TIME).verify(); + TIME.dependsOn(OTP_UTILS).verify(); } } From 9890d0f30596ac3a9ec5c7db9a023a132ae35c6e Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Wed, 30 Oct 2024 00:44:22 +0100 Subject: [PATCH 089/110] code cleanup: Remove dependency on slf4j in otp-utils. --- utils/pom.xml | 6 --- .../opentripplanner/utils/time/DateUtils.java | 38 +----------------- .../utils/time/DateUtilsTest.java | 39 ------------------- 3 files changed, 2 insertions(+), 81 deletions(-) diff --git a/utils/pom.xml b/utils/pom.xml index 1cace007d00..7a223488dd0 100644 --- a/utils/pom.xml +++ b/utils/pom.xml @@ -19,12 +19,6 @@ jsr305 - - - org.slf4j - slf4j-api - - diff --git a/utils/src/main/java/org/opentripplanner/utils/time/DateUtils.java b/utils/src/main/java/org/opentripplanner/utils/time/DateUtils.java index a72098e43ab..e773b4e89ea 100644 --- a/utils/src/main/java/org/opentripplanner/utils/time/DateUtils.java +++ b/utils/src/main/java/org/opentripplanner/utils/time/DateUtils.java @@ -11,16 +11,12 @@ import java.time.format.DateTimeParseException; import java.util.List; import javax.annotation.Nullable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; /** * @author Frank Purcell (p u r c e l l f @ t r i m e t . o r g) October 20, 2009 */ public class DateUtils { - private static final Logger LOG = LoggerFactory.getLogger(DateUtils.class); - private static final int SANITY_CHECK_CUTOFF_YEAR = 1000; // NOTE: don't change the order of these strings...the simplest should be on the @@ -53,9 +49,6 @@ public class DateUtils { */ @Nullable public static ZonedDateTime toZonedDateTime(String date, String time, ZoneId tz) { - //LOG.debug("JVM default timezone is {}", TimeZone.getDefault()); - LOG.debug("Parsing date {} and time {}", date, time); - LOG.debug("using timezone {}", tz); ZonedDateTime retVal = ZonedDateTime.ofInstant(Instant.now(), tz); if (date != null) { LocalDate localDate = parseDate(date); @@ -80,7 +73,6 @@ public static ZonedDateTime toZonedDateTime(String date, String time, ZoneId tz) retVal = LocalDateTime.of(retVal.toLocalDate(), localTime).atZone(tz); } } - LOG.debug("resulting date is {}", retVal); return retVal; } @@ -138,30 +130,6 @@ public static int getIntegerFromString(String input) { } } - /** - * Converts the given time in seconds to a String in the format h:mm. - * - * @param seconds the time in seconds. - * @return a String representing the time in the format h:mm - */ - public static String secToHHMM(int seconds) { - int min; - String sign = ""; - - if (seconds >= 0) { - min = seconds / 60; - sign = ""; - } else { - min = -seconds / 60; - sign = "-"; - } - - int mm = min % 60; - int hh = min / 60; - - return String.format("%s%d:%02d", sign, hh, mm); - } - public static String trim(String str) { String retVal = str; try { @@ -227,11 +195,9 @@ public static LocalTime parseTime(String time) { if (hms.length > 2) { sec = Integer.parseInt(trim(hms[2])); } - return LocalTime.of(hour, min, sec); - } catch (Exception ignore) { - LOG.info("Time '{}' didn't parse", time); - return null; + } catch (Exception e) { + throw new RuntimeException("Could not parse time: " + time, e); } } } diff --git a/utils/src/test/java/org/opentripplanner/utils/time/DateUtilsTest.java b/utils/src/test/java/org/opentripplanner/utils/time/DateUtilsTest.java index ac153b9a2ba..75621b8fadb 100644 --- a/utils/src/test/java/org/opentripplanner/utils/time/DateUtilsTest.java +++ b/utils/src/test/java/org/opentripplanner/utils/time/DateUtilsTest.java @@ -1,7 +1,6 @@ package org.opentripplanner.utils.time; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.opentripplanner.utils.time.DateUtils.secToHHMM; import java.time.LocalDate; import java.time.ZoneId; @@ -10,24 +9,6 @@ public class DateUtilsTest { - // Create some time constants: T_(_)? - private static final int T00_00 = 0; - private static final int T00_00_01 = 1; - private static final int T00_00_59 = 59; - private static final int T00_01 = 60; - private static final int T00_05 = 300; - private static final int T08_07 = (8 * 60 + 7) * 60; - private static final int T08_47 = (8 * 60 + 47) * 60; - private static final int T35_00 = 35 * 3600; - - // Create some negative time constants: N_(_)? - private static final int N00_00_01 = -1; - private static final int N00_00_59 = -59; - private static final int N00_05 = -300; - private static final int N08_00 = -8 * 3600; - private static final int N08_07 = -(8 * 60 + 7) * 60; - private static final int N08_47 = -(8 * 60 + 47) * 60; - public static final ZoneId UTC = ZoneIds.UTC; @Test @@ -40,24 +21,4 @@ public final void testToDate() { assertEquals(LocalDate.now(UTC).toString(), date.toLocalDate().toString()); assertEquals(0, date.toEpochSecond() % TimeUtils.ONE_DAY_SECONDS); } - - @Test - public final void testSecToHHMM() { - assertEquals("0:00", secToHHMM(T00_00), "Handle zero"); - assertEquals("0:00", secToHHMM(T00_00_01), "Skip seconds(1 sec)"); - assertEquals("0:00", secToHHMM(T00_00_59), "Skip seconds(59 sec), round down"); - assertEquals("0:01", secToHHMM(T00_01), "1 minute with leading zero"); - assertEquals("0:05", secToHHMM(T00_05), "5 minutes"); - assertEquals("8:07", secToHHMM(T08_07), "Hour and min with leading zero on minute"); - assertEquals("8:47", secToHHMM(T08_47), "8 hours and 47 minutes"); - assertEquals("35:00", secToHHMM(T35_00), "allow ServiceTime beyond 24 hours"); - - // Negative times - assertEquals("-0:00", secToHHMM(N00_00_01), "1 sec - round to minus zero"); - assertEquals("-0:00", secToHHMM(N00_00_59), "59 sec - round down with minus sign"); - assertEquals("-0:05", secToHHMM(N00_05), "minus 5 min"); - assertEquals("-8:00", secToHHMM(N08_00)); - assertEquals("-8:07", secToHHMM(N08_07)); - assertEquals("-8:47", secToHHMM(N08_47)); - } } From b5ceab872d29f5d90de030dc83f355fcfaf0994d Mon Sep 17 00:00:00 2001 From: Michael Tsang Date: Wed, 30 Oct 2024 17:16:48 +0000 Subject: [PATCH 090/110] add failing test for #6102 --- .../request/TripPatternForDatesTest.java | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 application/src/test/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/TripPatternForDatesTest.java diff --git a/application/src/test/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/TripPatternForDatesTest.java b/application/src/test/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/TripPatternForDatesTest.java new file mode 100644 index 00000000000..9189a5b932a --- /dev/null +++ b/application/src/test/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/TripPatternForDatesTest.java @@ -0,0 +1,119 @@ +package org.opentripplanner.routing.algorithm.raptoradapter.transit.request; + +import static org.junit.jupiter.api.Assertions.*; + +import java.time.LocalDate; +import java.util.BitSet; +import java.util.List; +import org.junit.jupiter.api.Test; +import org.opentripplanner.model.Frequency; +import org.opentripplanner.model.StopTime; +import org.opentripplanner.raptor.api.model.SearchDirection; +import org.opentripplanner.routing.algorithm.raptoradapter.transit.TripPatternForDate; +import org.opentripplanner.transit.model._data.TimetableRepositoryForTest; +import org.opentripplanner.transit.model.framework.Deduplicator; +import org.opentripplanner.transit.model.network.Route; +import org.opentripplanner.transit.model.network.RoutingTripPattern; +import org.opentripplanner.transit.model.network.StopPattern; +import org.opentripplanner.transit.model.network.TripPattern; +import org.opentripplanner.transit.model.timetable.FrequencyEntry; +import org.opentripplanner.transit.model.timetable.TripTimes; +import org.opentripplanner.transit.model.timetable.TripTimesFactory; + +class TripPatternForDatesTest { + + private static final int FREQUENCY_START = 7 * 60 * 60; + private static final int FREQUENCY_END = 23 * 60 * 60; + private static final int HEADWAY = 300; + private static final Route ROUTE = TimetableRepositoryForTest.route("1").build(); + private static final LocalDate SERVICE_DATE = LocalDate.of(2024, 11, 1); + + @Test + void forwardSearchInRange() { + var result = getTestSubjectWithExactFrequency() + .createCustomizedTripSearch(SearchDirection.FORWARD) + .search(FREQUENCY_END - HEADWAY, 0); + assertTrue(result.time() >= FREQUENCY_END - HEADWAY); + assertTrue(result.time() < FREQUENCY_END); + } + + @Test + void forwardSearchOutOfRange() { + var result = getTestSubjectWithExactFrequency() + .createCustomizedTripSearch(SearchDirection.FORWARD) + .search(FREQUENCY_END, 0); + assertTrue(result.empty()); + } + + @Test + void reverseSearchInRange() { + var result = getTestSubjectWithExactFrequency() + .createCustomizedTripSearch(SearchDirection.REVERSE) + .search(FREQUENCY_START, 0); + assertEquals(FREQUENCY_START, result.time()); + } + + @Test + void reverseSearchOutOfRange() { + var result = getTestSubjectWithExactFrequency() + .createCustomizedTripSearch(SearchDirection.REVERSE) + .search(FREQUENCY_START - 1, 0); + assertTrue(result.empty()); + } + + private static TripPatternForDates getTestSubjectWithExactFrequency() { + var testModel = TimetableRepositoryForTest.of(); + var stop1 = testModel.stop("FEED:STOP1", 0, 0).build(); + var stop2 = testModel.stop("FEED:STOP2", 0, 0).build(); + + var stopTime1 = new StopTime(); + stopTime1.setStop(stop1); + stopTime1.setArrivalTime(0); + stopTime1.setDepartureTime(0); + stopTime1.setStopSequence(0); + var stopTime2 = new StopTime(); + stopTime2.setStop(stop2); + stopTime2.setArrivalTime(300); + stopTime2.setDepartureTime(300); + stopTime2.setStopSequence(1); + StopPattern stopPattern = new StopPattern(List.of(stopTime1, stopTime2)); + RoutingTripPattern tripPattern = TripPattern + .of(TimetableRepositoryForTest.id("P1")) + .withRoute(ROUTE) + .withStopPattern(stopPattern) + .build() + .getRoutingTripPattern(); + + final TripTimes tripTimes = TripTimesFactory.tripTimes( + TimetableRepositoryForTest.trip("1").withRoute(ROUTE).build(), + List.of(stopTime1, stopTime2), + new Deduplicator() + ); + + var frequency = new Frequency(); + frequency.setStartTime(FREQUENCY_START); + frequency.setEndTime(FREQUENCY_END); + frequency.setHeadwaySecs(HEADWAY); + frequency.setExactTimes(1); + + var boardingAndAlightingPossible = new BitSet(2); + boardingAndAlightingPossible.set(0); + boardingAndAlightingPossible.set(1); + + return new TripPatternForDates( + tripPattern, + new TripPatternForDate[] { + new TripPatternForDate( + tripPattern, + List.of(tripTimes), + List.of(new FrequencyEntry(frequency, tripTimes)), + SERVICE_DATE + ), + }, + new int[] { 0 }, + boardingAndAlightingPossible, + boardingAndAlightingPossible, + 0 + ); + } +} From d93be2538ca1fafe30d18024de5323e7a584d3d7 Mon Sep 17 00:00:00 2001 From: Michael Tsang Date: Thu, 31 Oct 2024 10:24:13 +0000 Subject: [PATCH 091/110] minimal fix for #6102 --- .../transit/frequency/TripFrequencyAlightSearch.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/frequency/TripFrequencyAlightSearch.java b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/frequency/TripFrequencyAlightSearch.java index 2f020e22cf5..ff97fd9bdaa 100644 --- a/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/frequency/TripFrequencyAlightSearch.java +++ b/application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/frequency/TripFrequencyAlightSearch.java @@ -60,6 +60,6 @@ public RaptorBoardOrAlightEvent search( } } } - return null; + return RaptorBoardOrAlightEvent.empty(earliestBoardTime); } } From 719ec93c36510af186ab7dcd15924e82358a90fd Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Thu, 31 Oct 2024 15:11:27 +0100 Subject: [PATCH 092/110] Revert "Allow bike walking through bicycle no thru traffic areas" --- .../street/model/edge/StreetEdge.java | 15 ---- .../street/integration/BikeWalkingTest.java | 69 ------------------- 2 files changed, 84 deletions(-) diff --git a/application/src/main/java/org/opentripplanner/street/model/edge/StreetEdge.java b/application/src/main/java/org/opentripplanner/street/model/edge/StreetEdge.java index 505d2a95a3a..92244fe2af2 100644 --- a/application/src/main/java/org/opentripplanner/street/model/edge/StreetEdge.java +++ b/application/src/main/java/org/opentripplanner/street/model/edge/StreetEdge.java @@ -381,21 +381,6 @@ else if (s0.currentMode() == TraverseMode.BICYCLE) { State state = editor != null ? editor.makeState() : null; - // Add an explicit bike-walking state for no-thru-traffic edges, so that dismounting and walking - // is an option to avoid the restriction - if ( - s0.getBackMode() == TraverseMode.BICYCLE && - canTraverse(TraverseMode.BICYCLE) && - isBicycleNoThruTraffic() && - !s0.hasEnteredNoThruTrafficArea() - ) { - var bikeWalk = doTraverse(s0, TraverseMode.WALK, true); - if (bikeWalk != null) { - State forkState = bikeWalk.makeState(); - return State.ofNullable(forkState, state); - } - } - // we are transitioning into a no-drop-off zone therefore we add a second state for dropping // off the vehicle and walking if (state != null && !fromv.rentalDropOffBanned(s0) && tov.rentalDropOffBanned(s0)) { diff --git a/application/src/test/java/org/opentripplanner/street/integration/BikeWalkingTest.java b/application/src/test/java/org/opentripplanner/street/integration/BikeWalkingTest.java index 1d4ec2f3f79..41ec677b3bb 100644 --- a/application/src/test/java/org/opentripplanner/street/integration/BikeWalkingTest.java +++ b/application/src/test/java/org/opentripplanner/street/integration/BikeWalkingTest.java @@ -295,75 +295,6 @@ public void testElevatorBiking() { ); } - @Test - public void testBicycleBicycleNoThruTrafficStart() { - CD.setBicycleNoThruTraffic(true); - - assertPath( - C, - F, - StreetMode.BIKE, - List.of( - "null - 0 / 0.0 - null", - "BICYCLE - 5 / 10.0 - CD street", - "BICYCLE - 5 / 10.0 - DE street", - "BICYCLE - 5 / 10.0 - EF street" - ), - List.of( - "null - 0 / 0.0 - null", - "BICYCLE - 5 / 10.0 - CD street", - "BICYCLE - 5 / 10.0 - DE street", - "BICYCLE - 5 / 10.0 - EF street" - ) - ); - } - - @Test - public void testBicycleBicycleNoThruTrafficMiddle() { - DE.setBicycleNoThruTraffic(true); - - assertPath( - C, - F, - StreetMode.BIKE, - List.of( - "null - 0 / 0.0 - null", - "BICYCLE - 5 / 10.0 - CD street", - "🚲WALK - 120 / 1100.0 - DE street", - "BICYCLE - 105 / 1010.0 - EF street" - ), - List.of( - "null - 0 / 0.0 - null", - "BICYCLE - 105 / 1010.0 - CD street", - "🚲WALK - 120 / 1100.0 - DE street", - "BICYCLE - 5 / 10.0 - EF street" - ) - ); - } - - @Test - public void testBicycleBicycleNoThruTrafficEnd() { - EF.setBicycleNoThruTraffic(true); - - assertPath( - C, - F, - StreetMode.BIKE, - List.of( - "null - 0 / 0.0 - null", - "BICYCLE - 5 / 10.0 - CD street", - "BICYCLE - 5 / 10.0 - DE street", - "BICYCLE - 5 / 10.0 - EF street" - ), - List.of( - "null - 0 / 0.0 - null", - "BICYCLE - 5 / 10.0 - CD street", - "BICYCLE - 5 / 10.0 - DE street", - "BICYCLE - 5 / 10.0 - EF street" - ) - ); - } - @BeforeEach protected void setUp() throws Exception { // Generate a very simple graph From 6e1b813caf87a37be43d999b7a6d5d2f6b522159 Mon Sep 17 00:00:00 2001 From: OTP Changelog Bot Date: Thu, 31 Oct 2024 15:19:40 +0000 Subject: [PATCH 093/110] Add changelog entry for #6119 [ci skip] --- doc/user/Changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/user/Changelog.md b/doc/user/Changelog.md index 4ed08a6fafe..38fd7fa12e1 100644 --- a/doc/user/Changelog.md +++ b/doc/user/Changelog.md @@ -26,6 +26,7 @@ based on merged pull requests. Search GitHub issues and pull requests for smalle - Disable protocol upgrades for the HTTP client by default. [#6194](https://github.com/opentripplanner/OpenTripPlanner/pull/6194) - Fix max search-window when paging [#6189](https://github.com/opentripplanner/OpenTripPlanner/pull/6189) - Add car ferry functionality [#5966](https://github.com/opentripplanner/OpenTripPlanner/pull/5966) +- Make indoor=area and indoor=corridor routable for UK OSM tag mapper [#6119](https://github.com/opentripplanner/OpenTripPlanner/pull/6119) [](AUTOMATIC_CHANGELOG_PLACEHOLDER_DO_NOT_REMOVE) ## 2.6.0 (2024-09-18) From c97579db3363841506a62e60adfb27891fd3b818 Mon Sep 17 00:00:00 2001 From: OTP Changelog Bot Date: Fri, 1 Nov 2024 08:40:24 +0000 Subject: [PATCH 094/110] Add changelog entry for #6214 [ci skip] --- doc/user/Changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/user/Changelog.md b/doc/user/Changelog.md index 38fd7fa12e1..ff9e4617fe7 100644 --- a/doc/user/Changelog.md +++ b/doc/user/Changelog.md @@ -27,6 +27,7 @@ based on merged pull requests. Search GitHub issues and pull requests for smalle - Fix max search-window when paging [#6189](https://github.com/opentripplanner/OpenTripPlanner/pull/6189) - Add car ferry functionality [#5966](https://github.com/opentripplanner/OpenTripPlanner/pull/5966) - Make indoor=area and indoor=corridor routable for UK OSM tag mapper [#6119](https://github.com/opentripplanner/OpenTripPlanner/pull/6119) +- Revert [#6214](https://github.com/opentripplanner/OpenTripPlanner/pull/6214) [](AUTOMATIC_CHANGELOG_PLACEHOLDER_DO_NOT_REMOVE) ## 2.6.0 (2024-09-18) From 8abf67dad7ad971775415e15a03f0ef034491ca8 Mon Sep 17 00:00:00 2001 From: OTP Changelog Bot Date: Fri, 1 Nov 2024 10:03:33 +0000 Subject: [PATCH 095/110] Add changelog entry for #6183 [ci skip] --- doc/user/Changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/user/Changelog.md b/doc/user/Changelog.md index ff9e4617fe7..acd9af48136 100644 --- a/doc/user/Changelog.md +++ b/doc/user/Changelog.md @@ -28,6 +28,7 @@ based on merged pull requests. Search GitHub issues and pull requests for smalle - Add car ferry functionality [#5966](https://github.com/opentripplanner/OpenTripPlanner/pull/5966) - Make indoor=area and indoor=corridor routable for UK OSM tag mapper [#6119](https://github.com/opentripplanner/OpenTripPlanner/pull/6119) - Revert [#6214](https://github.com/opentripplanner/OpenTripPlanner/pull/6214) +- Remove reading agency and route brandingUrl from GTFS data [#6183](https://github.com/opentripplanner/OpenTripPlanner/pull/6183) [](AUTOMATIC_CHANGELOG_PLACEHOLDER_DO_NOT_REMOVE) ## 2.6.0 (2024-09-18) From f2e759ce3b811e6f4bbac00ad8f738cc3b26a318 Mon Sep 17 00:00:00 2001 From: OTP Serialization Version Bot Date: Fri, 1 Nov 2024 10:03:56 +0000 Subject: [PATCH 096/110] Bump serialization version id for #6183 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9b19d252bd9..f840a971ea2 100644 --- a/pom.xml +++ b/pom.xml @@ -58,7 +58,7 @@ - 168 + 169 32.0 2.52 From 94e07bcd76033d7b13afdfaed7ffaf7928ec3fa6 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Sat, 2 Nov 2024 09:39:23 +0100 Subject: [PATCH 097/110] Replace matchPackagePrefixes with wildcard matchPackageNames [ci skip] --- renovate.json5 | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/renovate.json5 b/renovate.json5 index 3514f3d9aff..4ca7db1444a 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -58,10 +58,8 @@ "me.fabriciorby:maven-surefire-junit5-tree-reporter", "com.google.truth:truth", "org.jacoco:jacoco-maven-plugin", // coverage plugin - "org.apache.commons:commons-compress" // only used by tests - ], - "matchPackagePrefixes": [ - "org.junit.jupiter:", + "org.apache.commons:commons-compress", // only used by tests + "org.junit.jupiter:{/,}**" ], "automerge": true, "schedule": "on the 17th day of the month" @@ -95,8 +93,8 @@ { // https://github.com/graphql-java-kickstart/renovate-config/blob/main/default.json "description": "GraphQL Java (ignoring snapshot builds)", - "matchPackagePrefixes": [ - "com.graphql-java:" + "matchPackageNames": [ + "com.graphql-java:{/,}**" ], "allowedVersions": "/^[0-9]+\\.[0-9]+(\\.[0-9]+)?$/" }, @@ -119,8 +117,8 @@ }, { "description": "in order to keep review burden low, don't update these quite so frequently", - "matchPackagePrefixes": [ - "org.apache.lucene:", + "matchPackageNames": [ + "org.apache.lucene:{/,}**", ], "extends": [ "schedule:quarterly" @@ -141,16 +139,16 @@ { "description": "Automerge logging dependencies in a single PR", "groupName": "logging dependencies", - "matchPackagePrefixes": [ - "org.slf4j:", - "ch.qos.logback:" + "matchPackageNames": [ + "org.slf4j:{/,}**", + "ch.qos.logback:{/,}**" ], "automerge": true, "schedule": "on the 4th day of the month" }, { "description": "give some projects time to publish a changelog before opening the PR", - "matchPackagePrefixes": [ + "matchPackageNames": [ "com.google.dagger:", "com.fasterxml.jackson" ], @@ -158,8 +156,8 @@ }, { "description": "Geotools takes a while to publish a changelog and since it pulls in JTS it can change the serialization of the graph", - "matchPackagePrefixes": [ - "org.geotools:" + "matchPackageNames": [ + "org.geotools:{/,}**" ], "minimumReleaseAge": "1 week", "labels": ["skip changelog", "bump serialization id"] From b134db108dfec595aa4f47be6fba8865d885d759 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 3 Nov 2024 18:51:26 +0000 Subject: [PATCH 098/110] Update Debug UI dependencies (non-major) --- client/package-lock.json | 777 +++++++++------------------------------ client/package.json | 18 +- 2 files changed, 185 insertions(+), 610 deletions(-) diff --git a/client/package-lock.json b/client/package-lock.json index c66bb81c6fd..e71b8f6d6c6 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -12,7 +12,7 @@ "@js-temporal/polyfill": "0.4.4", "bootstrap": "5.3.3", "graphql": "16.9.0", - "graphql-request": "7.1.0", + "graphql-request": "7.1.2", "maplibre-gl": "4.7.1", "react": "18.3.1", "react-bootstrap": "2.10.5", @@ -25,24 +25,24 @@ "@graphql-codegen/introspection": "4.0.3", "@parcel/watcher": "2.4.1", "@testing-library/react": "16.0.1", - "@types/react": "18.3.11", + "@types/react": "18.3.12", "@types/react-dom": "18.3.1", "@typescript-eslint/eslint-plugin": "7.18.0", "@typescript-eslint/parser": "7.18.0", - "@vitejs/plugin-react": "4.3.2", - "@vitest/coverage-v8": "2.1.3", + "@vitejs/plugin-react": "4.3.3", + "@vitest/coverage-v8": "2.1.4", "eslint": "8.57.1", "eslint-config-prettier": "9.1.0", "eslint-plugin-import": "2.31.0", - "eslint-plugin-jsx-a11y": "6.10.0", - "eslint-plugin-react": "7.37.1", + "eslint-plugin-jsx-a11y": "6.10.2", + "eslint-plugin-react": "7.37.2", "eslint-plugin-react-hooks": "5.0.0", - "eslint-plugin-react-refresh": "0.4.12", + "eslint-plugin-react-refresh": "0.4.14", "jsdom": "25.0.1", "prettier": "3.3.3", "typescript": "5.6.3", - "vite": "5.4.9", - "vitest": "2.1.3" + "vite": "5.4.10", + "vitest": "2.1.4" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -1163,120 +1163,6 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, - "node_modules/@dprint/darwin-arm64": { - "version": "0.46.3", - "resolved": "https://registry.npmjs.org/@dprint/darwin-arm64/-/darwin-arm64-0.46.3.tgz", - "integrity": "sha512-1ycDpGvclGHF3UG5V6peymPDg6ouNTqM6BjhVELQ6zwr+X98AMhq/1slgO8hwHtPcaS5qhTAS+PkzOmBJRegow==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "peer": true - }, - "node_modules/@dprint/darwin-x64": { - "version": "0.46.3", - "resolved": "https://registry.npmjs.org/@dprint/darwin-x64/-/darwin-x64-0.46.3.tgz", - "integrity": "sha512-v5IpLmrY836Q5hJAxZuX097ZNQvoZgO6JKO4bK4l6XDhhHAw2XTIUr41+FM5r36ENxyASMk0NpHjhcHtih3o0g==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "peer": true - }, - "node_modules/@dprint/formatter": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@dprint/formatter/-/formatter-0.3.0.tgz", - "integrity": "sha512-N9fxCxbaBOrDkteSOzaCqwWjso5iAe+WJPsHC021JfHNj2ThInPNEF13ORDKta3llq5D1TlclODCvOvipH7bWQ==", - "license": "MIT", - "optional": true, - "peer": true - }, - "node_modules/@dprint/linux-arm64-glibc": { - "version": "0.46.3", - "resolved": "https://registry.npmjs.org/@dprint/linux-arm64-glibc/-/linux-arm64-glibc-0.46.3.tgz", - "integrity": "sha512-9P13g1vgV8RfQH2qBGa8YAfaOeWA42RIhj7lmWRpkDFtwau96reMKwnBBn8bHUnc5e6bSsbPUOMb/X1KMUKz/g==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "peer": true - }, - "node_modules/@dprint/linux-arm64-musl": { - "version": "0.46.3", - "resolved": "https://registry.npmjs.org/@dprint/linux-arm64-musl/-/linux-arm64-musl-0.46.3.tgz", - "integrity": "sha512-AAcdcMSZ6DEIoY9E0xQHjkZP+THP7EWsQge4TWzglSIjzn31YltglHAGYFcLB4CTJYpF0NsFDNFktzgkO+s0og==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "peer": true - }, - "node_modules/@dprint/linux-x64-glibc": { - "version": "0.46.3", - "resolved": "https://registry.npmjs.org/@dprint/linux-x64-glibc/-/linux-x64-glibc-0.46.3.tgz", - "integrity": "sha512-c5cQ3G1rC64nBZ8Pd2LGWwzkEk4D7Ax9NrBbwYmNPvs6mFbGlJPC1+RD95x2WwIrIlMIciLG+Kxmt25PzBphmg==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "peer": true - }, - "node_modules/@dprint/linux-x64-musl": { - "version": "0.46.3", - "resolved": "https://registry.npmjs.org/@dprint/linux-x64-musl/-/linux-x64-musl-0.46.3.tgz", - "integrity": "sha512-ONtk2QtLcV0TqWOCOqzUFQixgk3JC+vnJLB5L6tQwT7BX5LzeircfE/1f4dg459iqejNC9MBXZkHnXqabvWSow==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "peer": true - }, - "node_modules/@dprint/typescript": { - "version": "0.91.1", - "resolved": "https://registry.npmjs.org/@dprint/typescript/-/typescript-0.91.1.tgz", - "integrity": "sha512-BX3TneRLf3OuO/3tsxbseHqWbpCPOOb2vOm9OlKgSYIKqOsCHpz5kWx5iDuGrNwxWWMKife/1ccz87I5tBLaNA==", - "license": "MIT", - "optional": true, - "peer": true - }, - "node_modules/@dprint/win32-x64": { - "version": "0.46.3", - "resolved": "https://registry.npmjs.org/@dprint/win32-x64/-/win32-x64-0.46.3.tgz", - "integrity": "sha512-xvj4DSEilf0gGdT7CqnwNEgfWNuWqT6eIBxHDEUbmcn1vZ7IwirtqRq/nm3lmYtQaJ4EbtMQZvACHZwxC7G96w==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "peer": true - }, "node_modules/@esbuild/aix-ppc64": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", @@ -2980,85 +2866,6 @@ "gl-style-validate": "dist/gl-style-validate.mjs" } }, - "node_modules/@molt/command": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/@molt/command/-/command-0.9.0.tgz", - "integrity": "sha512-1JI8dAlpqlZoXyKWVQggX7geFNPxBpocHIXQCsnxDjKy+3WX4SGyZVJXuLlqRRrX7FmQCuuMAfx642ovXmPA9g==", - "license": "MIT", - "dependencies": { - "@molt/types": "0.2.0", - "alge": "0.8.1", - "chalk": "^5.3.0", - "lodash.camelcase": "^4.3.0", - "lodash.snakecase": "^4.1.1", - "readline-sync": "^1.4.10", - "string-length": "^6.0.0", - "strip-ansi": "^7.1.0", - "ts-toolbelt": "^9.6.0", - "type-fest": "^4.3.1", - "zod": "^3.22.2" - } - }, - "node_modules/@molt/command/node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/@molt/command/node_modules/chalk": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", - "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", - "license": "MIT", - "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/@molt/command/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "node_modules/@molt/command/node_modules/type-fest": { - "version": "4.18.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.18.2.tgz", - "integrity": "sha512-+suCYpfJLAe4OXS6+PPXjW3urOS4IoP9waSiLuXfLgqZODKw/aWwASvzqE886wA0kQgGy0mIWyhd87VpqIy6Xg==", - "license": "(MIT OR CC0-1.0)", - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@molt/types": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@molt/types/-/types-0.2.0.tgz", - "integrity": "sha512-p6ChnEZDGjg9PYPec9BK6Yp5/DdSrYQvXTBAtgrnqX6N36cZy37ql1c8Tc5LclfIYBNG7EZp8NBcRTYJwyi84g==", - "license": "MIT", - "dependencies": { - "ts-toolbelt": "^9.6.0" - } - }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -3862,9 +3669,9 @@ "integrity": "sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==" }, "node_modules/@types/react": { - "version": "18.3.11", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.11.tgz", - "integrity": "sha512-r6QZ069rFTjrEYgFdOck1gK7FLVsgJE7tTz0pQBczlBNUhBNk0MQH4UbnFSwjpQLMkLzgqvBBa+qGpLje16eTQ==", + "version": "18.3.12", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.12.tgz", + "integrity": "sha512-D2wOSq/d6Agt28q7rSI3jhU7G6aiuzljDGZ2hTZHIkrTLUI+AF3WMeKkEZ9nN2fkBAlcktT6vcZjDFiIhMYEQw==", "license": "MIT", "dependencies": { "@types/prop-types": "*", @@ -4124,9 +3931,9 @@ "dev": true }, "node_modules/@vitejs/plugin-react": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.3.2.tgz", - "integrity": "sha512-hieu+o05v4glEBucTcKMK3dlES0OeJlD9YVOAPraVMOInBCwzumaIFiUjr4bHK7NPgnAHgiskUoceKercrN8vg==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.3.3.tgz", + "integrity": "sha512-NooDe9GpHGqNns1i8XDERg0Vsg5SSYRhRxxyTGogUdkdNt47jal+fbuYi+Yfq6pzRCKXyoPcWisfxE6RIM3GKA==", "dev": true, "license": "MIT", "dependencies": { @@ -4144,21 +3951,21 @@ } }, "node_modules/@vitest/coverage-v8": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-2.1.3.tgz", - "integrity": "sha512-2OJ3c7UPoFSmBZwqD2VEkUw6A/tzPF0LmW0ZZhhB8PFxuc+9IBG/FaSM+RLEenc7ljzFvGN+G0nGQoZnh7sy2A==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-2.1.4.tgz", + "integrity": "sha512-FPKQuJfR6VTfcNMcGpqInmtJuVXFSCd9HQltYncfR01AzXhLucMEtQ5SinPdZxsT5x/5BK7I5qFJ5/ApGCmyTQ==", "dev": true, "license": "MIT", "dependencies": { "@ampproject/remapping": "^2.3.0", "@bcoe/v8-coverage": "^0.2.3", - "debug": "^4.3.6", + "debug": "^4.3.7", "istanbul-lib-coverage": "^3.2.2", "istanbul-lib-report": "^3.0.1", "istanbul-lib-source-maps": "^5.0.6", "istanbul-reports": "^3.1.7", - "magic-string": "^0.30.11", - "magicast": "^0.3.4", + "magic-string": "^0.30.12", + "magicast": "^0.3.5", "std-env": "^3.7.0", "test-exclude": "^7.0.1", "tinyrainbow": "^1.2.0" @@ -4167,8 +3974,8 @@ "url": "https://opencollective.com/vitest" }, "peerDependencies": { - "@vitest/browser": "2.1.3", - "vitest": "2.1.3" + "@vitest/browser": "2.1.4", + "vitest": "2.1.4" }, "peerDependenciesMeta": { "@vitest/browser": { @@ -4177,15 +3984,15 @@ } }, "node_modules/@vitest/expect": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.3.tgz", - "integrity": "sha512-SNBoPubeCJhZ48agjXruCI57DvxcsivVDdWz+SSsmjTT4QN/DfHk3zB/xKsJqMs26bLZ/pNRLnCf0j679i0uWQ==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.4.tgz", + "integrity": "sha512-DOETT0Oh1avie/D/o2sgMHGrzYUFFo3zqESB2Hn70z6QB1HrS2IQ9z5DfyTqU8sg4Bpu13zZe9V4+UTNQlUeQA==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/spy": "2.1.3", - "@vitest/utils": "2.1.3", - "chai": "^5.1.1", + "@vitest/spy": "2.1.4", + "@vitest/utils": "2.1.4", + "chai": "^5.1.2", "tinyrainbow": "^1.2.0" }, "funding": { @@ -4193,22 +4000,21 @@ } }, "node_modules/@vitest/mocker": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.3.tgz", - "integrity": "sha512-eSpdY/eJDuOvuTA3ASzCjdithHa+GIF1L4PqtEELl6Qa3XafdMLBpBlZCIUCX2J+Q6sNmjmxtosAG62fK4BlqQ==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.4.tgz", + "integrity": "sha512-Ky/O1Lc0QBbutJdW0rqLeFNbuLEyS+mIPiNdlVlp2/yhJ0SbyYqObS5IHdhferJud8MbbwMnexg4jordE5cCoQ==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/spy": "2.1.3", + "@vitest/spy": "2.1.4", "estree-walker": "^3.0.3", - "magic-string": "^0.30.11" + "magic-string": "^0.30.12" }, "funding": { "url": "https://opencollective.com/vitest" }, "peerDependencies": { - "@vitest/spy": "2.1.3", - "msw": "^2.3.5", + "msw": "^2.4.9", "vite": "^5.0.0" }, "peerDependenciesMeta": { @@ -4221,9 +4027,9 @@ } }, "node_modules/@vitest/pretty-format": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.3.tgz", - "integrity": "sha512-XH1XdtoLZCpqV59KRbPrIhFCOO0hErxrQCMcvnQete3Vibb9UeIOX02uFPfVn3Z9ZXsq78etlfyhnkmIZSzIwQ==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.4.tgz", + "integrity": "sha512-L95zIAkEuTDbUX1IsjRl+vyBSLh3PwLLgKpghl37aCK9Jvw0iP+wKwIFhfjdUtA2myLgjrG6VU6JCFLv8q/3Ww==", "dev": true, "license": "MIT", "dependencies": { @@ -4234,13 +4040,13 @@ } }, "node_modules/@vitest/runner": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.3.tgz", - "integrity": "sha512-JGzpWqmFJ4fq5ZKHtVO3Xuy1iF2rHGV4d/pdzgkYHm1+gOzNZtqjvyiaDGJytRyMU54qkxpNzCx+PErzJ1/JqQ==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.4.tgz", + "integrity": "sha512-sKRautINI9XICAMl2bjxQM8VfCMTB0EbsBc/EDFA57V6UQevEKY/TOPOF5nzcvCALltiLfXWbq4MaAwWx/YxIA==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/utils": "2.1.3", + "@vitest/utils": "2.1.4", "pathe": "^1.1.2" }, "funding": { @@ -4248,14 +4054,14 @@ } }, "node_modules/@vitest/snapshot": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.3.tgz", - "integrity": "sha512-qWC2mWc7VAXmjAkEKxrScWHWFyCQx/cmiZtuGqMi+WwqQJ2iURsVY4ZfAK6dVo6K2smKRU6l3BPwqEBvhnpQGg==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.4.tgz", + "integrity": "sha512-3Kab14fn/5QZRog5BPj6Rs8dc4B+mim27XaKWFWHWA87R56AKjHTGcBFKpvZKDzC4u5Wd0w/qKsUIio3KzWW4Q==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "2.1.3", - "magic-string": "^0.30.11", + "@vitest/pretty-format": "2.1.4", + "magic-string": "^0.30.12", "pathe": "^1.1.2" }, "funding": { @@ -4263,27 +4069,27 @@ } }, "node_modules/@vitest/spy": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.3.tgz", - "integrity": "sha512-Nb2UzbcUswzeSP7JksMDaqsI43Sj5+Kry6ry6jQJT4b5gAK+NS9NED6mDb8FlMRCX8m5guaHCDZmqYMMWRy5nQ==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.4.tgz", + "integrity": "sha512-4JOxa+UAizJgpZfaCPKK2smq9d8mmjZVPMt2kOsg/R8QkoRzydHH1qHxIYNvr1zlEaFj4SXiaaJWxq/LPLKaLg==", "dev": true, "license": "MIT", "dependencies": { - "tinyspy": "^3.0.0" + "tinyspy": "^3.0.2" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/utils": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.3.tgz", - "integrity": "sha512-xpiVfDSg1RrYT0tX6czgerkpcKFmFOF/gCr30+Mve5V2kewCy4Prn1/NDMSRwaSmT7PRaOF83wu+bEtsY1wrvA==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.4.tgz", + "integrity": "sha512-MXDnZn0Awl2S86PSNIim5PWXgIAx8CIkzu35mBdSApUip6RFOGXBCf3YFyeEu8n1IHk4bWD46DeYFu9mQlFIRg==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "2.1.3", - "loupe": "^3.1.1", + "@vitest/pretty-format": "2.1.4", + "loupe": "^3.1.2", "tinyrainbow": "^1.2.0" }, "funding": { @@ -4389,18 +4195,6 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/alge": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/alge/-/alge-0.8.1.tgz", - "integrity": "sha512-kiV9nTt+XIauAXsowVygDxMZLplZxDWt0W8plE/nB32/V2ziM/P/TxDbSVK7FYIUt2Xo16h3/htDh199LNPCKQ==", - "license": "MIT", - "dependencies": { - "lodash.ismatch": "^4.4.0", - "remeda": "^1.0.0", - "ts-toolbelt": "^9.6.0", - "zod": "^3.17.3" - } - }, "node_modules/ansi-escapes": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", @@ -5021,9 +4815,9 @@ } }, "node_modules/chai": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.1.tgz", - "integrity": "sha512-pT1ZgP8rPNqUgieVaEY+ryQr6Q4HXNg8Ei9UnLUrjN4IA7dvQC5JB+/kxVcPNDHyBcc/26CXPkbNzq3qwrOEKA==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.2.tgz", + "integrity": "sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw==", "dev": true, "license": "MIT", "dependencies": { @@ -5482,39 +5276,6 @@ "node": ">=6" } }, - "node_modules/deep-equal": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.3.tgz", - "integrity": "sha512-ZIwpnevOurS8bpT4192sqAowWM76JDKSHYzMLty3BZGSswgq6pBaH3DhCSW5xVAZICZyKdOBPjwww5wfgT/6PA==", - "dev": true, - "license": "MIT", - "dependencies": { - "array-buffer-byte-length": "^1.0.0", - "call-bind": "^1.0.5", - "es-get-iterator": "^1.1.3", - "get-intrinsic": "^1.2.2", - "is-arguments": "^1.1.1", - "is-array-buffer": "^3.0.2", - "is-date-object": "^1.0.5", - "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.2", - "isarray": "^2.0.5", - "object-is": "^1.1.5", - "object-keys": "^1.1.1", - "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.5.1", - "side-channel": "^1.0.4", - "which-boxed-primitive": "^1.0.2", - "which-collection": "^1.0.1", - "which-typed-array": "^1.1.13" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -5676,27 +5437,6 @@ "url": "https://dotenvx.com" } }, - "node_modules/dprint": { - "version": "0.46.3", - "resolved": "https://registry.npmjs.org/dprint/-/dprint-0.46.3.tgz", - "integrity": "sha512-ACEd7B7sO/uvPvV/nsHbtkIeMqeD2a8XGO1DokROtKDUmI5WbuflGZOwyjFCYwy4rkX6FXoYBzGdEQ6um7BjCA==", - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "peer": true, - "bin": { - "dprint": "bin.js" - }, - "optionalDependencies": { - "@dprint/darwin-arm64": "0.46.3", - "@dprint/darwin-x64": "0.46.3", - "@dprint/linux-arm64-glibc": "0.46.3", - "@dprint/linux-arm64-musl": "0.46.3", - "@dprint/linux-x64-glibc": "0.46.3", - "@dprint/linux-x64-musl": "0.46.3", - "@dprint/win32-x64": "0.46.3" - } - }, "node_modules/dset": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/dset/-/dset-3.1.3.tgz", @@ -5835,31 +5575,10 @@ "node": ">= 0.4" } }, - "node_modules/es-get-iterator": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.3.tgz", - "integrity": "sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.3", - "has-symbols": "^1.0.3", - "is-arguments": "^1.1.1", - "is-map": "^2.0.2", - "is-set": "^2.0.2", - "is-string": "^1.0.7", - "isarray": "^2.0.5", - "stop-iteration-iterator": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/es-iterator-helpers": { - "version": "1.0.19", - "resolved": "https://registry.npmjs.org/es-iterator-helpers/-/es-iterator-helpers-1.0.19.tgz", - "integrity": "sha512-zoMwbCcH5hwUkKJkT8kDIBZSz9I6mVG//+lDCinLCGov4+r7NIy0ld8o03M0cJxl2spVf6ESYVS6/gpIfq1FFw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es-iterator-helpers/-/es-iterator-helpers-1.1.0.tgz", + "integrity": "sha512-/SurEfycdyssORP/E+bj4sEu1CWw4EmLDsHynHwSXQ7utgbrMRWW195pTrCjFgFCddf/UkYm3oqKPRq5i8bJbw==", "dev": true, "license": "MIT", "dependencies": { @@ -5870,12 +5589,12 @@ "es-set-tostringtag": "^2.0.3", "function-bind": "^1.1.2", "get-intrinsic": "^1.2.4", - "globalthis": "^1.0.3", + "globalthis": "^1.0.4", "has-property-descriptors": "^1.0.2", "has-proto": "^1.0.3", "has-symbols": "^1.0.3", "internal-slot": "^1.0.7", - "iterator.prototype": "^1.1.2", + "iterator.prototype": "^1.1.3", "safe-array-concat": "^1.1.2" }, "engines": { @@ -6192,13 +5911,13 @@ } }, "node_modules/eslint-plugin-jsx-a11y": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.10.0.tgz", - "integrity": "sha512-ySOHvXX8eSN6zz8Bywacm7CvGNhUtdjvqfQDVe6020TUK34Cywkw7m0KsCCk1Qtm9G1FayfTN1/7mMYnYO2Bhg==", + "version": "6.10.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.10.2.tgz", + "integrity": "sha512-scB3nz4WmG75pV8+3eRUQOHZlNSUhFNq37xnpgRkCCELU3XMvXAxLk1eqWWyE22Ki4Q01Fnsw9BA3cJHDPgn2Q==", "dev": true, "license": "MIT", "dependencies": { - "aria-query": "~5.1.3", + "aria-query": "^5.3.2", "array-includes": "^3.1.8", "array.prototype.flatmap": "^1.3.2", "ast-types-flow": "^0.0.8", @@ -6206,14 +5925,13 @@ "axobject-query": "^4.1.0", "damerau-levenshtein": "^1.0.8", "emoji-regex": "^9.2.2", - "es-iterator-helpers": "^1.0.19", "hasown": "^2.0.2", "jsx-ast-utils": "^3.3.5", "language-tags": "^1.0.9", "minimatch": "^3.1.2", "object.fromentries": "^2.0.8", "safe-regex-test": "^1.0.3", - "string.prototype.includes": "^2.0.0" + "string.prototype.includes": "^2.0.1" }, "engines": { "node": ">=4.0" @@ -6223,13 +5941,13 @@ } }, "node_modules/eslint-plugin-jsx-a11y/node_modules/aria-query": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.1.3.tgz", - "integrity": "sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.2.tgz", + "integrity": "sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==", "dev": true, "license": "Apache-2.0", - "dependencies": { - "deep-equal": "^2.0.5" + "engines": { + "node": ">= 0.4" } }, "node_modules/eslint-plugin-jsx-a11y/node_modules/brace-expansion": { @@ -6257,9 +5975,9 @@ } }, "node_modules/eslint-plugin-react": { - "version": "7.37.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.37.1.tgz", - "integrity": "sha512-xwTnwDqzbDRA8uJ7BMxPs/EXRB3i8ZfnOIp8BsxEQkT0nHPp+WWceqGgo6rKb9ctNi8GJLDT4Go5HAWELa/WMg==", + "version": "7.37.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.37.2.tgz", + "integrity": "sha512-EsTAnj9fLVr/GZleBLFbj/sSuXeWmp1eXIN60ceYnZveqEaUCyW4X+Vh4WTdUhCkW4xutXYqTXCUSyqD4rB75w==", "dev": true, "license": "MIT", "dependencies": { @@ -6268,7 +5986,7 @@ "array.prototype.flatmap": "^1.3.2", "array.prototype.tosorted": "^1.1.4", "doctrine": "^2.1.0", - "es-iterator-helpers": "^1.0.19", + "es-iterator-helpers": "^1.1.0", "estraverse": "^5.3.0", "hasown": "^2.0.2", "jsx-ast-utils": "^2.4.1 || ^3.0.0", @@ -6303,9 +6021,9 @@ } }, "node_modules/eslint-plugin-react-refresh": { - "version": "0.4.12", - "resolved": "https://registry.npmjs.org/eslint-plugin-react-refresh/-/eslint-plugin-react-refresh-0.4.12.tgz", - "integrity": "sha512-9neVjoGv20FwYtCP6CB1dzR1vr57ZDNOXst21wd2xJ/cTlM2xLq0GWVlSNTdMn/4BtP6cHYBMCSp1wFBJ9jBsg==", + "version": "0.4.14", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-refresh/-/eslint-plugin-react-refresh-0.4.14.tgz", + "integrity": "sha512-aXvzCTK7ZBv1e7fahFuR3Z/fyQQSIQ711yPgYRj+Oj64tyTgO4iQIDmYXDBqvSWQ/FA4OSCsXOStlF+noU0/NA==", "dev": true, "license": "MIT", "peerDependencies": { @@ -6517,6 +6235,16 @@ "node": ">=0.10.0" } }, + "node_modules/expect-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.1.0.tgz", + "integrity": "sha512-bFi65yM+xZgk+u/KRIpekdSYkTB5W1pEf0Lt8Q8Msh7b+eQ7LXVtIB1Bkm4fvclDEL1b2CZkMhv2mOeF8tMdkA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/extend-shallow": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", @@ -6873,16 +6601,6 @@ "node": "6.* || 8.* || >= 10.*" } }, - "node_modules/get-func-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", - "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": "*" - } - }, "node_modules/get-intrinsic": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", @@ -7045,12 +6763,14 @@ } }, "node_modules/globalthis": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", - "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", "dev": true, + "license": "MIT", "dependencies": { - "define-properties": "^1.1.3" + "define-properties": "^1.2.1", + "gopd": "^1.0.1" }, "engines": { "node": ">= 0.4" @@ -7149,34 +6869,15 @@ } }, "node_modules/graphql-request": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/graphql-request/-/graphql-request-7.1.0.tgz", - "integrity": "sha512-Ouu/lYVFhARS1aXeZoVJWnGT6grFJXTLwXJuK4mUGGRo0EUk1JkyYp43mdGmRgUVezpRm6V5Sq3t8jBDQcajng==", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/graphql-request/-/graphql-request-7.1.2.tgz", + "integrity": "sha512-+XE3iuC55C2di5ZUrB4pjgwe+nIQBuXVIK9J98wrVwojzDW3GMdSBZfxUk8l4j9TieIpjpggclxhNEU9ebGF8w==", "license": "MIT", "dependencies": { - "@graphql-typed-document-node/core": "^3.2.0", - "@molt/command": "^0.9.0", - "zod": "^3.23.8" - }, - "bin": { - "graffle": "build/cli/generate.js" + "@graphql-typed-document-node/core": "^3.2.0" }, "peerDependencies": { - "@dprint/formatter": "^0.3.0", - "@dprint/typescript": "^0.91.1", - "dprint": "^0.46.2", "graphql": "14 - 16" - }, - "peerDependenciesMeta": { - "@dprint/formatter": { - "optional": true - }, - "@dprint/typescript": { - "optional": true - }, - "dprint": { - "optional": true - } } }, "node_modules/graphql-tag": { @@ -7532,23 +7233,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-arguments": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", - "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-array-buffer": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", @@ -7576,6 +7260,7 @@ "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.0.0.tgz", "integrity": "sha512-Y1JXKrfykRJGdlDwdKlLpLyMIiWqWvuSd17TvZk68PLAOGOoF4Xyav1z0Xhoi+gCYjZVeC5SI+hYFOfvXmGRCA==", "dev": true, + "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -7694,6 +7379,7 @@ "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.0.2.tgz", "integrity": "sha512-0by5vtUJs8iFQb5TYUHHPudOR+qXYIMKtiUzvLIZITZUjknFmziyBJuLhVRc+Ds0dREFlskDNJKYIdIzu/9pfw==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.2" }, @@ -7715,6 +7401,7 @@ "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", "dev": true, + "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -8092,16 +7779,20 @@ } }, "node_modules/iterator.prototype": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/iterator.prototype/-/iterator.prototype-1.1.2.tgz", - "integrity": "sha512-DR33HMMr8EzwuRL8Y9D3u2BMj8+RqSE850jfGu59kS7tbmPLzGkZmVSfyCFSDxuZiEY6Rzt3T2NA/qU+NwVj1w==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/iterator.prototype/-/iterator.prototype-1.1.3.tgz", + "integrity": "sha512-FW5iMbeQ6rBGm/oKgzq2aW4KvAGpxPzYES8N4g4xNXUKpL1mclMvOe+76AcLDTvD+Ze+sOpVhgdAQEKF4L9iGQ==", "dev": true, + "license": "MIT", "dependencies": { "define-properties": "^1.2.1", "get-intrinsic": "^1.2.1", "has-symbols": "^1.0.3", "reflect.getprototypeof": "^1.0.4", "set-function-name": "^2.0.1" + }, + "engines": { + "node": ">= 0.4" } }, "node_modules/jackspeak": { @@ -8434,30 +8125,12 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, - "node_modules/lodash.camelcase": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", - "license": "MIT" - }, - "node_modules/lodash.ismatch": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz", - "integrity": "sha512-fPMfXjGQEV9Xsq/8MTSgUf255gawYRbjwMyDbcvDhXgV7enSZA0hynz6vMPnpAb5iONEzBHBPsT+0zes5Z301g==", - "license": "MIT" - }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, - "node_modules/lodash.snakecase": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", - "integrity": "sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==", - "license": "MIT" - }, "node_modules/lodash.sortby": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", @@ -8527,14 +8200,11 @@ } }, "node_modules/loupe": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.1.tgz", - "integrity": "sha512-edNu/8D5MKVfGVFRhFf8aAxiTM6Wumfz5XsaatSxlD3w4R1d/WEKUTydCdPGbl9K7QG/Ca3GnDV2sIKIpXRQcw==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.2.tgz", + "integrity": "sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==", "dev": true, - "license": "MIT", - "dependencies": { - "get-func-name": "^2.0.1" - } + "license": "MIT" }, "node_modules/lower-case": { "version": "2.0.2", @@ -8574,9 +8244,9 @@ } }, "node_modules/magic-string": { - "version": "0.30.11", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.11.tgz", - "integrity": "sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A==", + "version": "0.30.12", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.12.tgz", + "integrity": "sha512-Ea8I3sQMVXr8JhN4z+H/d8zwo+tYDgHE9+5G4Wnrwhs0gaK9fXTKx0Tw5Xwsd/bCPTTZNRAdpyzvoeORe9LYpw==", "dev": true, "license": "MIT", "dependencies": { @@ -8584,14 +8254,14 @@ } }, "node_modules/magicast": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.3.4.tgz", - "integrity": "sha512-TyDF/Pn36bBji9rWKHlZe+PZb6Mx5V8IHCSxk7X4aljM4e/vyDvZZYwHewdVaqiA0nb3ghfHU/6AUpDxWoER2Q==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.3.5.tgz", + "integrity": "sha512-L0WhttDl+2BOsybvEOLK7fW3UA0OQ0IQ2d6Zl2x/a6vVRs3bAY0ECOSHHeL5jD+SbOpOCUEi0y1DgHEn9Qn1AQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/parser": "^7.24.4", - "@babel/types": "^7.24.0", + "@babel/parser": "^7.25.4", + "@babel/types": "^7.25.4", "source-map-js": "^1.2.0" } }, @@ -8960,23 +8630,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/object-is": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.6.tgz", - "integrity": "sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", @@ -9739,20 +9392,12 @@ "node": ">= 6" } }, - "node_modules/readline-sync": { - "version": "1.4.10", - "resolved": "https://registry.npmjs.org/readline-sync/-/readline-sync-1.4.10.tgz", - "integrity": "sha512-gNva8/6UAe8QYepIQH/jQ2qn91Qj0B9sYjMBBs3QOB8F2CXcKgLxQaJRP76sWVRQt+QU+8fAkCbCvjjMFu7Ycw==", - "license": "MIT", - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/reflect.getprototypeof": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.6.tgz", "integrity": "sha512-fmfw4XgoDke3kdI6h4xcUz1dG8uaiv5q9gcEwLS4Pnth2kxT+GZ7YehS1JTMGBQmtV7Y4GFGbs2re2NqhdozUg==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", @@ -9803,12 +9448,6 @@ "invariant": "^2.2.4" } }, - "node_modules/remeda": { - "version": "1.61.0", - "resolved": "https://registry.npmjs.org/remeda/-/remeda-1.61.0.tgz", - "integrity": "sha512-caKfSz9rDeSKBQQnlJnVW3mbVdFgxgGWQKq1XlFokqjf+hQD5gxutLGTTY2A/x24UxVyJe9gH5fAkFI63ULw4A==", - "license": "MIT" - }, "node_modules/remedial": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/remedial/-/remedial-1.0.8.tgz", @@ -10373,19 +10012,6 @@ "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==", "dev": true }, - "node_modules/stop-iteration-iterator": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz", - "integrity": "sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "internal-slot": "^1.0.4" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/streamsearch": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", @@ -10410,48 +10036,6 @@ "integrity": "sha512-78lwMoCcn0nNu8LszbP1UA7g55OeE4v7rCeWnM5B453rnNr4aq+5it3FEYtZrSEiMvHZOZ9Jlqb0OD0M2VInqg==", "dev": true }, - "node_modules/string-length": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/string-length/-/string-length-6.0.0.tgz", - "integrity": "sha512-1U361pxZHEQ+FeSjzqRpV+cu2vTzYeWeafXFLykiFlv4Vc0n3njgU8HrMbyik5uwm77naWMuVG8fhEF+Ovb1Kg==", - "license": "MIT", - "dependencies": { - "strip-ansi": "^7.1.0" - }, - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/string-length/node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/string-length/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -10496,14 +10080,18 @@ "dev": true }, "node_modules/string.prototype.includes": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/string.prototype.includes/-/string.prototype.includes-2.0.0.tgz", - "integrity": "sha512-E34CkBgyeqNDcrbU76cDjL5JLcVrtSdYq0MEh/B10r17pRP4ciHLwTgnuLV8Ay6cgEMLkcBkFCKyFZ43YldYzg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.includes/-/string.prototype.includes-2.0.1.tgz", + "integrity": "sha512-o7+c9bW6zpAdJHTtujeePODAhkuicdAryFsfVKwA+wGw89wJ4GTY484WTucM9hLtDEOpOvI+aHnzqnC5lHp4Rg==", "dev": true, "license": "MIT", "dependencies": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.3" + }, + "engines": { + "node": ">= 0.4" } }, "node_modules/string.prototype.matchall": { @@ -10742,16 +10330,16 @@ "license": "MIT" }, "node_modules/tinyexec": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.0.tgz", - "integrity": "sha512-tVGE0mVJPGb0chKhqmsoosjsS+qUnJVGJpZgsHYQcGoPlG3B51R3PouqTgEGH2Dc9jjFyOqOpix6ZHNMXp1FZg==", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.1.tgz", + "integrity": "sha512-WiCJLEECkO18gwqIp6+hJg0//p23HXp4S+gGtAKu3mI2F2/sXC4FvHvXvB0zJVVaTPhx1/tOwdbRsa1sOBIKqQ==", "dev": true, "license": "MIT" }, "node_modules/tinypool": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.0.0.tgz", - "integrity": "sha512-KIKExllK7jp3uvrNtvRBYBWBOAXSX8ZvoaD8T+7KB/QHIuoJW3Pmr60zucywjAlMb5TeXUkcs/MWeWLu0qvuAQ==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.0.1.tgz", + "integrity": "sha512-URZYihUbRPcGv95En+sz6MfghfIc2OJ1sv/RmhWZLouPY0/8Vo80viwPvg3dlaS9fuq7fQMEfgRRK7BBZThBEA==", "dev": true, "license": "MIT", "engines": { @@ -10898,12 +10486,6 @@ "integrity": "sha512-PGcnJoTBnVGy6yYNFxWVNkdcAuAMstvutN9MgDJIV6L0oG8fB+ZNNy1T+wJzah8RPGor1mZuPQkVfXNDpy9eHA==", "dev": true }, - "node_modules/ts-toolbelt": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/ts-toolbelt/-/ts-toolbelt-9.6.0.tgz", - "integrity": "sha512-nsZd8ZeNUzukXPlJmTBwUAuABDe/9qtVDelJeT/qW0ow3ZS3BsQJtNkan1802aM9Uf68/Y8ljw86Hu0h5IUW3w==", - "license": "Apache-2.0" - }, "node_modules/tsconfig-paths": { "version": "3.15.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", @@ -11240,9 +10822,9 @@ } }, "node_modules/vite": { - "version": "5.4.9", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.9.tgz", - "integrity": "sha512-20OVpJHh0PAM0oSOELa5GaZNWeDjcAvQjGXy2Uyr+Tp+/D2/Hdz6NLgpJLsarPTA2QJ6v8mX2P1ZfbsSKvdMkg==", + "version": "5.4.10", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.10.tgz", + "integrity": "sha512-1hvaPshuPUtxeQ0hsVH3Mud0ZanOLwVTneA1EgbAM5LhaZEqyPWGRQ7BtaMvUrTDeEaC8pxtj6a6jku3x4z6SQ==", "dev": true, "license": "MIT", "dependencies": { @@ -11300,14 +10882,14 @@ } }, "node_modules/vite-node": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.3.tgz", - "integrity": "sha512-I1JadzO+xYX887S39Do+paRePCKoiDrWRRjp9kkG5he0t7RXNvPAJPCQSJqbGN4uCrFFeS3Kj3sLqY8NMYBEdA==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.4.tgz", + "integrity": "sha512-kqa9v+oi4HwkG6g8ufRnb5AeplcRw8jUF6/7/Qz1qRQOXHImG8YnLbB+LLszENwFnoBl9xIf9nVdCFzNd7GQEg==", "dev": true, "license": "MIT", "dependencies": { "cac": "^6.7.14", - "debug": "^4.3.6", + "debug": "^4.3.7", "pathe": "^1.1.2", "vite": "^5.0.0" }, @@ -11322,30 +10904,31 @@ } }, "node_modules/vitest": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.3.tgz", - "integrity": "sha512-Zrxbg/WiIvUP2uEzelDNTXmEMJXuzJ1kCpbDvaKByFA9MNeO95V+7r/3ti0qzJzrxdyuUw5VduN7k+D3VmVOSA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/expect": "2.1.3", - "@vitest/mocker": "2.1.3", - "@vitest/pretty-format": "^2.1.3", - "@vitest/runner": "2.1.3", - "@vitest/snapshot": "2.1.3", - "@vitest/spy": "2.1.3", - "@vitest/utils": "2.1.3", - "chai": "^5.1.1", - "debug": "^4.3.6", - "magic-string": "^0.30.11", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.4.tgz", + "integrity": "sha512-eDjxbVAJw1UJJCHr5xr/xM86Zx+YxIEXGAR+bmnEID7z9qWfoxpHw0zdobz+TQAFOLT+nEXz3+gx6nUJ7RgmlQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/expect": "2.1.4", + "@vitest/mocker": "2.1.4", + "@vitest/pretty-format": "^2.1.4", + "@vitest/runner": "2.1.4", + "@vitest/snapshot": "2.1.4", + "@vitest/spy": "2.1.4", + "@vitest/utils": "2.1.4", + "chai": "^5.1.2", + "debug": "^4.3.7", + "expect-type": "^1.1.0", + "magic-string": "^0.30.12", "pathe": "^1.1.2", "std-env": "^3.7.0", "tinybench": "^2.9.0", - "tinyexec": "^0.3.0", - "tinypool": "^1.0.0", + "tinyexec": "^0.3.1", + "tinypool": "^1.0.1", "tinyrainbow": "^1.2.0", "vite": "^5.0.0", - "vite-node": "2.1.3", + "vite-node": "2.1.4", "why-is-node-running": "^2.3.0" }, "bin": { @@ -11360,8 +10943,8 @@ "peerDependencies": { "@edge-runtime/vm": "*", "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "2.1.3", - "@vitest/ui": "2.1.3", + "@vitest/browser": "2.1.4", + "@vitest/ui": "2.1.4", "happy-dom": "*", "jsdom": "*" }, @@ -11512,13 +11095,14 @@ } }, "node_modules/which-builtin-type": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.1.3.tgz", - "integrity": "sha512-YmjsSMDBYsM1CaFiayOVT06+KJeXf0o5M/CAd4o1lTadFAtacTUM49zoYxr/oroopFDfhvN6iEcBxUyc3gvKmw==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.1.4.tgz", + "integrity": "sha512-bppkmBSsHFmIMSl8BO9TbsyzsvGjVoppt8xUiGzwiu/bhDCGxnpOKCxgqj6GuyHE0mINMDecBFPlOm2hzY084w==", "dev": true, + "license": "MIT", "dependencies": { - "function.prototype.name": "^1.1.5", - "has-tostringtag": "^1.0.0", + "function.prototype.name": "^1.1.6", + "has-tostringtag": "^1.0.2", "is-async-function": "^2.0.0", "is-date-object": "^1.0.5", "is-finalizationregistry": "^1.0.2", @@ -11527,8 +11111,8 @@ "is-weakref": "^1.0.2", "isarray": "^2.0.5", "which-boxed-primitive": "^1.0.2", - "which-collection": "^1.0.1", - "which-typed-array": "^1.1.9" + "which-collection": "^1.0.2", + "which-typed-array": "^1.1.15" }, "engines": { "node": ">= 0.4" @@ -11744,15 +11328,6 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } - }, - "node_modules/zod": { - "version": "3.23.8", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz", - "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } } } } diff --git a/client/package.json b/client/package.json index 8f133b3d4b0..56ff4cecb5f 100644 --- a/client/package.json +++ b/client/package.json @@ -21,7 +21,7 @@ "@js-temporal/polyfill": "0.4.4", "bootstrap": "5.3.3", "graphql": "16.9.0", - "graphql-request": "7.1.0", + "graphql-request": "7.1.2", "maplibre-gl": "4.7.1", "react": "18.3.1", "react-bootstrap": "2.10.5", @@ -34,23 +34,23 @@ "@graphql-codegen/introspection": "4.0.3", "@parcel/watcher": "2.4.1", "@testing-library/react": "16.0.1", - "@types/react": "18.3.11", + "@types/react": "18.3.12", "@types/react-dom": "18.3.1", "@typescript-eslint/eslint-plugin": "7.18.0", "@typescript-eslint/parser": "7.18.0", - "@vitejs/plugin-react": "4.3.2", - "@vitest/coverage-v8": "2.1.3", + "@vitejs/plugin-react": "4.3.3", + "@vitest/coverage-v8": "2.1.4", "eslint": "8.57.1", "eslint-config-prettier": "9.1.0", "eslint-plugin-import": "2.31.0", - "eslint-plugin-jsx-a11y": "6.10.0", - "eslint-plugin-react": "7.37.1", + "eslint-plugin-jsx-a11y": "6.10.2", + "eslint-plugin-react": "7.37.2", "eslint-plugin-react-hooks": "5.0.0", - "eslint-plugin-react-refresh": "0.4.12", + "eslint-plugin-react-refresh": "0.4.14", "jsdom": "25.0.1", "prettier": "3.3.3", "typescript": "5.6.3", - "vite": "5.4.9", - "vitest": "2.1.3" + "vite": "5.4.10", + "vitest": "2.1.4" } } From d88b9c701acf57d1555006378dff62939caa5ae9 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Sun, 3 Nov 2024 21:07:52 +0100 Subject: [PATCH 099/110] Fix command for pruning container images [ci skip] --- .github/workflows/prune-container-images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/prune-container-images.yml b/.github/workflows/prune-container-images.yml index 54c450cea90..c1653701c3b 100644 --- a/.github/workflows/prune-container-images.yml +++ b/.github/workflows/prune-container-images.yml @@ -18,5 +18,5 @@ jobs: run: | # remove all snapshot container images that have not been pulled for over a year # --keep-semver makes sure that any image with a x.y.z version scheme is unaffected by this - pip install prune-container-repo==0.0.4 --break-system-packages + pip install prune-container-repo==0.0.4 prune-container-repo -u ${CONTAINER_REGISTRY_USER} -r ${CONTAINER_REPO} --days=365 --keep-semver --activate From ec3f9cbf1282b5ec029a865538a88ae1eaf2300f Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Sun, 3 Nov 2024 21:34:54 +0100 Subject: [PATCH 100/110] Fix container build after conversion to multi-module build, relates to #6217 --- .github/workflows/cibuild.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cibuild.yml b/.github/workflows/cibuild.yml index e778fe25679..66162ed6b3a 100644 --- a/.github/workflows/cibuild.yml +++ b/.github/workflows/cibuild.yml @@ -235,4 +235,6 @@ jobs: echo "Maven version ${version_with_snapshot} contains SNAPSHOT, adding date to container image tag" fi - mvn --batch-mode -P prettierSkip compile com.google.cloud.tools:jib-maven-plugin:build -Djib.to.tags=latest,$image_version + MAVEN_SKIP_ARGS="-P prettierSkip -Dmaven.test.skip=true -Dmaven.source.skip=true" + + mvn --batch-mode $MAVEN_SKIP_ARGS package com.google.cloud.tools:jib-maven-plugin:build -Djib.to.tags=latest,$image_version From 0c7d45fb4de6ca4b4e6fbd97ded0419b5bc6ea1b Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Sun, 3 Nov 2024 21:42:56 +0100 Subject: [PATCH 101/110] Remove unneeded eslint-disable-line --- client/src/hooks/useServerInfo.ts | 2 +- client/src/hooks/useTripQuery.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/hooks/useServerInfo.ts b/client/src/hooks/useServerInfo.ts index 117c1357360..30107f336a5 100644 --- a/client/src/hooks/useServerInfo.ts +++ b/client/src/hooks/useServerInfo.ts @@ -1,6 +1,6 @@ import { useEffect, useState } from 'react'; import { graphql } from '../gql'; -import { request } from 'graphql-request'; // eslint-disable-line import/no-unresolved +import { request } from 'graphql-request'; import { QueryType } from '../gql/graphql.ts'; import { getApiUrl } from '../util/getApiUrl.ts'; diff --git a/client/src/hooks/useTripQuery.ts b/client/src/hooks/useTripQuery.ts index 5ff6fc80a1f..515cfae290a 100644 --- a/client/src/hooks/useTripQuery.ts +++ b/client/src/hooks/useTripQuery.ts @@ -1,5 +1,5 @@ import { useCallback, useEffect, useState } from 'react'; -import { request } from 'graphql-request'; // eslint-disable-line import/no-unresolved +import { request } from 'graphql-request'; import { QueryType, TripQueryVariables } from '../gql/graphql.ts'; import { getApiUrl } from '../util/getApiUrl.ts'; import { query } from '../static/query/tripQuery.tsx'; From ce9118c879e215cf2f0d510c198acbab15a332d1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 4 Nov 2024 01:32:55 +0000 Subject: [PATCH 102/110] Update dependency ch.qos.logback:logback-classic to v1.5.12 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d2655cbdcb6..2468ced4658 100644 --- a/pom.xml +++ b/pom.xml @@ -67,7 +67,7 @@ 5.11.2 1.13.5 5.6.0 - 1.5.8 + 1.5.12 9.12.0 2.0.16 2.0.15 From 98b0cc5cdd9c9ca0658bd2d551d3e45c5bac2d08 Mon Sep 17 00:00:00 2001 From: OTP Changelog Bot Date: Mon, 4 Nov 2024 07:18:01 +0000 Subject: [PATCH 103/110] Add changelog entry for #6211 [ci skip] --- doc/user/Changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/user/Changelog.md b/doc/user/Changelog.md index acd9af48136..b1064503a68 100644 --- a/doc/user/Changelog.md +++ b/doc/user/Changelog.md @@ -29,6 +29,7 @@ based on merged pull requests. Search GitHub issues and pull requests for smalle - Make indoor=area and indoor=corridor routable for UK OSM tag mapper [#6119](https://github.com/opentripplanner/OpenTripPlanner/pull/6119) - Revert [#6214](https://github.com/opentripplanner/OpenTripPlanner/pull/6214) - Remove reading agency and route brandingUrl from GTFS data [#6183](https://github.com/opentripplanner/OpenTripPlanner/pull/6183) +- Fix NullPointerException when searching backwards with a frequency-based trip [#6211](https://github.com/opentripplanner/OpenTripPlanner/pull/6211) [](AUTOMATIC_CHANGELOG_PLACEHOLDER_DO_NOT_REMOVE) ## 2.6.0 (2024-09-18) From 15727f57c376be3e63f4414bfefa85086d6f141e Mon Sep 17 00:00:00 2001 From: OTP Bot Date: Mon, 4 Nov 2024 11:24:29 +0000 Subject: [PATCH 104/110] Upgrade debug client to version 2024/11/2024-11-04T11:23 --- application/src/client/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/src/client/index.html b/application/src/client/index.html index caeb0a726dd..d43beb177ee 100644 --- a/application/src/client/index.html +++ b/application/src/client/index.html @@ -5,8 +5,8 @@ OTP Debug Client - - + +

From 7a3099bde1488e43512d611f3c3a5603d05b82e0 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Mon, 4 Nov 2024 12:48:19 +0100 Subject: [PATCH 105/110] Fix @graphql/client-preset --- client/codegen.ts | 3 + client/package-lock.json | 235 +++++++++------------------------------ client/package.json | 2 +- renovate.json5 | 6 +- 4 files changed, 55 insertions(+), 191 deletions(-) diff --git a/client/codegen.ts b/client/codegen.ts index 60299a21a97..a8ad1e40c49 100644 --- a/client/codegen.ts +++ b/client/codegen.ts @@ -9,6 +9,9 @@ const config: CodegenConfig = { preset: 'client', plugins: [], }, + 'src/gql/types.generated.ts': { + plugins: ['typescript'], + }, }, }; diff --git a/client/package-lock.json b/client/package-lock.json index e71b8f6d6c6..a438e9403fd 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -21,7 +21,7 @@ }, "devDependencies": { "@graphql-codegen/cli": "5.0.3", - "@graphql-codegen/client-preset": "4.3.3", + "@graphql-codegen/client-preset": "4.5.0", "@graphql-codegen/introspection": "4.0.3", "@parcel/watcher": "2.4.1", "@testing-library/react": "16.0.1", @@ -1741,22 +1741,22 @@ } } }, - "node_modules/@graphql-codegen/cli/node_modules/@graphql-codegen/client-preset": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@graphql-codegen/client-preset/-/client-preset-4.4.0.tgz", - "integrity": "sha512-Q0NHFK7KXLhEaRC/k82ge0dHDfeHJEvvDeV0vV3+oSurHNa/lpxQtbK2BqknZe+JDfZ1YOOvYT93XsAkYD+SQg==", + "node_modules/@graphql-codegen/client-preset": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/@graphql-codegen/client-preset/-/client-preset-4.5.0.tgz", + "integrity": "sha512-0fFGSjpDhB7Jp6v+FQWDIeNJhL8VEiy3zeazyus3mGUELPaRQsoos2NczkDWnyMjSB1NHn4GrI53DB4TXkTAog==", "dev": true, "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.20.2", "@babel/template": "^7.20.7", "@graphql-codegen/add": "^5.0.3", - "@graphql-codegen/gql-tag-operations": "4.0.10", - "@graphql-codegen/plugin-helpers": "^5.0.4", - "@graphql-codegen/typed-document-node": "^5.0.10", - "@graphql-codegen/typescript": "^4.1.0", - "@graphql-codegen/typescript-operations": "^4.3.0", - "@graphql-codegen/visitor-plugin-common": "^5.4.0", + "@graphql-codegen/gql-tag-operations": "4.0.11", + "@graphql-codegen/plugin-helpers": "^5.1.0", + "@graphql-codegen/typed-document-node": "^5.0.11", + "@graphql-codegen/typescript": "^4.1.1", + "@graphql-codegen/typescript-operations": "^4.3.1", + "@graphql-codegen/visitor-plugin-common": "^5.5.0", "@graphql-tools/documents": "^1.0.0", "@graphql-tools/utils": "^10.0.0", "@graphql-typed-document-node/core": "3.2.0", @@ -1769,76 +1769,6 @@ "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0" } }, - "node_modules/@graphql-codegen/cli/node_modules/@graphql-codegen/gql-tag-operations": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/@graphql-codegen/gql-tag-operations/-/gql-tag-operations-4.0.10.tgz", - "integrity": "sha512-WsBEVL3XQdBboFJJL5WxrUjkuo3B7Sa51R9NbT7PKBe0HCNstoouGZIvQJRUubttFCqTTyoFtNsoRSKB+rsRug==", - "dev": true, - "license": "MIT", - "dependencies": { - "@graphql-codegen/plugin-helpers": "^5.0.4", - "@graphql-codegen/visitor-plugin-common": "5.4.0", - "@graphql-tools/utils": "^10.0.0", - "auto-bind": "~4.0.0", - "tslib": "~2.6.0" - }, - "engines": { - "node": ">=16" - }, - "peerDependencies": { - "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0" - } - }, - "node_modules/@graphql-codegen/cli/node_modules/@graphql-codegen/visitor-plugin-common": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-5.4.0.tgz", - "integrity": "sha512-tL7hOrO+4MiNfDiHewhRQCiH9GTAh0M9Y/BZxYGGEdnrfGgqK5pCxtjq7EY/L19VGIyU7hhzYTQ0r1HzEbB4Jw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@graphql-codegen/plugin-helpers": "^5.0.4", - "@graphql-tools/optimize": "^2.0.0", - "@graphql-tools/relay-operation-optimizer": "^7.0.0", - "@graphql-tools/utils": "^10.0.0", - "auto-bind": "~4.0.0", - "change-case-all": "1.0.15", - "dependency-graph": "^0.11.0", - "graphql-tag": "^2.11.0", - "parse-filepath": "^1.0.2", - "tslib": "~2.6.0" - }, - "engines": { - "node": ">=16" - }, - "peerDependencies": { - "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0" - } - }, - "node_modules/@graphql-codegen/client-preset": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/@graphql-codegen/client-preset/-/client-preset-4.3.3.tgz", - "integrity": "sha512-IrDsSVe8bkKtxgVfKPHzjL9tYlv7KEpA59R4gZLqx/t2WIJncW1i0OMvoz9tgoZsFEs8OKKgXZbnwPZ/Qf1kEw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/template": "^7.20.7", - "@graphql-codegen/add": "^5.0.3", - "@graphql-codegen/gql-tag-operations": "4.0.9", - "@graphql-codegen/plugin-helpers": "^5.0.4", - "@graphql-codegen/typed-document-node": "^5.0.9", - "@graphql-codegen/typescript": "^4.0.9", - "@graphql-codegen/typescript-operations": "^4.2.3", - "@graphql-codegen/visitor-plugin-common": "^5.3.1", - "@graphql-tools/documents": "^1.0.0", - "@graphql-tools/utils": "^10.0.0", - "@graphql-typed-document-node/core": "3.2.0", - "tslib": "~2.6.0" - }, - "peerDependencies": { - "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0" - } - }, "node_modules/@graphql-codegen/core": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/@graphql-codegen/core/-/core-4.0.2.tgz", @@ -1855,18 +1785,21 @@ } }, "node_modules/@graphql-codegen/gql-tag-operations": { - "version": "4.0.9", - "resolved": "https://registry.npmjs.org/@graphql-codegen/gql-tag-operations/-/gql-tag-operations-4.0.9.tgz", - "integrity": "sha512-lVgu1HClel896HqZAEjynatlU6eJrYOw+rh05DPgM150xvmb7Gz5TnRHA2vfwlDNIXDaToAIpz5RFfkjjnYM1Q==", + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/@graphql-codegen/gql-tag-operations/-/gql-tag-operations-4.0.11.tgz", + "integrity": "sha512-EUQuBsYB5RtNlzBb/O0nJvbWC8HvPRWwVTHRf0ElOoQlJfRgfDom2GWmEM5hXa2afzMqB7AWxOH24ibOqiYnMQ==", "dev": true, "license": "MIT", "dependencies": { - "@graphql-codegen/plugin-helpers": "^5.0.4", - "@graphql-codegen/visitor-plugin-common": "5.3.1", + "@graphql-codegen/plugin-helpers": "^5.1.0", + "@graphql-codegen/visitor-plugin-common": "5.5.0", "@graphql-tools/utils": "^10.0.0", "auto-bind": "~4.0.0", "tslib": "~2.6.0" }, + "engines": { + "node": ">=16" + }, "peerDependencies": { "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0" } @@ -1886,9 +1819,9 @@ } }, "node_modules/@graphql-codegen/plugin-helpers": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/@graphql-codegen/plugin-helpers/-/plugin-helpers-5.0.4.tgz", - "integrity": "sha512-MOIuHFNWUnFnqVmiXtrI+4UziMTYrcquljaI5f/T/Bc7oO7sXcfkAvgkNWEEi9xWreYwvuer3VHCuPI/lAFWbw==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@graphql-codegen/plugin-helpers/-/plugin-helpers-5.1.0.tgz", + "integrity": "sha512-Y7cwEAkprbTKzVIe436TIw4w03jorsMruvCvu0HJkavaKMQbWY+lQ1RIuROgszDbxAyM35twB5/sUvYG5oW+yg==", "dev": true, "license": "MIT", "dependencies": { @@ -1899,15 +1832,19 @@ "lodash": "~4.17.0", "tslib": "~2.6.0" }, + "engines": { + "node": ">=16" + }, "peerDependencies": { "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0" } }, "node_modules/@graphql-codegen/schema-ast": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@graphql-codegen/schema-ast/-/schema-ast-4.0.2.tgz", - "integrity": "sha512-5mVAOQQK3Oz7EtMl/l3vOQdc2aYClUzVDHHkMvZlunc+KlGgl81j8TLa+X7ANIllqU4fUEsQU3lJmk4hXP6K7Q==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@graphql-codegen/schema-ast/-/schema-ast-4.1.0.tgz", + "integrity": "sha512-kZVn0z+th9SvqxfKYgztA6PM7mhnSZaj4fiuBWvMTqA+QqQ9BBed6Pz41KuD/jr0gJtnlr2A4++/0VlpVbCTmQ==", "dev": true, + "license": "MIT", "dependencies": { "@graphql-codegen/plugin-helpers": "^5.0.3", "@graphql-tools/utils": "^10.0.0", @@ -1918,14 +1855,14 @@ } }, "node_modules/@graphql-codegen/typed-document-node": { - "version": "5.0.10", - "resolved": "https://registry.npmjs.org/@graphql-codegen/typed-document-node/-/typed-document-node-5.0.10.tgz", - "integrity": "sha512-YPDUNs6x0muoVWlbY2yEs0lGxFHMTszlGDh6klT/5rqiTDTZg3zz8Wd1ZTihkcH8+V6T0AT9qDWwcx9fcS2tvQ==", + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/@graphql-codegen/typed-document-node/-/typed-document-node-5.0.11.tgz", + "integrity": "sha512-btENKrSIUZ5UllS8sFhVZ+Y91VL0knK9gHxW/6/WzaCTxBQ+wOk07vQNeoWlvMrkl0QeUsGt6YvSo0SoPtsKdA==", "dev": true, "license": "MIT", "dependencies": { - "@graphql-codegen/plugin-helpers": "^5.0.4", - "@graphql-codegen/visitor-plugin-common": "5.4.0", + "@graphql-codegen/plugin-helpers": "^5.1.0", + "@graphql-codegen/visitor-plugin-common": "5.5.0", "auto-bind": "~4.0.0", "change-case-all": "1.0.15", "tslib": "~2.6.0" @@ -1937,41 +1874,16 @@ "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0" } }, - "node_modules/@graphql-codegen/typed-document-node/node_modules/@graphql-codegen/visitor-plugin-common": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-5.4.0.tgz", - "integrity": "sha512-tL7hOrO+4MiNfDiHewhRQCiH9GTAh0M9Y/BZxYGGEdnrfGgqK5pCxtjq7EY/L19VGIyU7hhzYTQ0r1HzEbB4Jw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@graphql-codegen/plugin-helpers": "^5.0.4", - "@graphql-tools/optimize": "^2.0.0", - "@graphql-tools/relay-operation-optimizer": "^7.0.0", - "@graphql-tools/utils": "^10.0.0", - "auto-bind": "~4.0.0", - "change-case-all": "1.0.15", - "dependency-graph": "^0.11.0", - "graphql-tag": "^2.11.0", - "parse-filepath": "^1.0.2", - "tslib": "~2.6.0" - }, - "engines": { - "node": ">=16" - }, - "peerDependencies": { - "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0" - } - }, "node_modules/@graphql-codegen/typescript": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@graphql-codegen/typescript/-/typescript-4.1.0.tgz", - "integrity": "sha512-/fS53Nh6U6c58GTOxqfyKTLQfQv36P8II/vPw/fg0cdcWbALhRPls69P8vXUWjrElmLKzCrdusBWPp/r+AKUBQ==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@graphql-codegen/typescript/-/typescript-4.1.1.tgz", + "integrity": "sha512-+o5LOT71K9hdO4lDVnRGkkET5RdlKvxlQGug8dZgRGrhE2/xoPBsKfLhg9AoJGYMauNZxKj3blABQxHOKEku6Q==", "dev": true, "license": "MIT", "dependencies": { - "@graphql-codegen/plugin-helpers": "^5.0.4", + "@graphql-codegen/plugin-helpers": "^5.1.0", "@graphql-codegen/schema-ast": "^4.0.2", - "@graphql-codegen/visitor-plugin-common": "5.4.0", + "@graphql-codegen/visitor-plugin-common": "5.5.0", "auto-bind": "~4.0.0", "tslib": "~2.6.0" }, @@ -1983,15 +1895,15 @@ } }, "node_modules/@graphql-codegen/typescript-operations": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@graphql-codegen/typescript-operations/-/typescript-operations-4.3.0.tgz", - "integrity": "sha512-ZORwMy8OgsiYd9EZUhTMd4/g5LvTFpx6Fh6dNN0cxFkqSc6KhjX0vhzWsyK8N9+ILaHSutT8UTrLMdJi35HzDQ==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@graphql-codegen/typescript-operations/-/typescript-operations-4.3.1.tgz", + "integrity": "sha512-yW5Iia6IK1VKiPm3oeukYMQN5pEBLwRlG8ZzQA9beeLQ8PskKyz6mjar6U7dJ2hc8pv/qT4R8kcJOQ2RloniAQ==", "dev": true, "license": "MIT", "dependencies": { - "@graphql-codegen/plugin-helpers": "^5.0.4", - "@graphql-codegen/typescript": "^4.1.0", - "@graphql-codegen/visitor-plugin-common": "5.4.0", + "@graphql-codegen/plugin-helpers": "^5.1.0", + "@graphql-codegen/typescript": "^4.1.1", + "@graphql-codegen/visitor-plugin-common": "5.5.0", "auto-bind": "~4.0.0", "tslib": "~2.6.0" }, @@ -2002,39 +1914,14 @@ "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0" } }, - "node_modules/@graphql-codegen/typescript-operations/node_modules/@graphql-codegen/visitor-plugin-common": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-5.4.0.tgz", - "integrity": "sha512-tL7hOrO+4MiNfDiHewhRQCiH9GTAh0M9Y/BZxYGGEdnrfGgqK5pCxtjq7EY/L19VGIyU7hhzYTQ0r1HzEbB4Jw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@graphql-codegen/plugin-helpers": "^5.0.4", - "@graphql-tools/optimize": "^2.0.0", - "@graphql-tools/relay-operation-optimizer": "^7.0.0", - "@graphql-tools/utils": "^10.0.0", - "auto-bind": "~4.0.0", - "change-case-all": "1.0.15", - "dependency-graph": "^0.11.0", - "graphql-tag": "^2.11.0", - "parse-filepath": "^1.0.2", - "tslib": "~2.6.0" - }, - "engines": { - "node": ">=16" - }, - "peerDependencies": { - "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0" - } - }, - "node_modules/@graphql-codegen/typescript/node_modules/@graphql-codegen/visitor-plugin-common": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-5.4.0.tgz", - "integrity": "sha512-tL7hOrO+4MiNfDiHewhRQCiH9GTAh0M9Y/BZxYGGEdnrfGgqK5pCxtjq7EY/L19VGIyU7hhzYTQ0r1HzEbB4Jw==", + "node_modules/@graphql-codegen/visitor-plugin-common": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-5.5.0.tgz", + "integrity": "sha512-FSkxe/o4qKbpK+ipIT/jxZLYH0+3+XdIrJWsKlCW9wwJMF9mEJLJtzZNcxHSjz7+Eny6SUElAT2dqZ5XByxkog==", "dev": true, "license": "MIT", "dependencies": { - "@graphql-codegen/plugin-helpers": "^5.0.4", + "@graphql-codegen/plugin-helpers": "^5.1.0", "@graphql-tools/optimize": "^2.0.0", "@graphql-tools/relay-operation-optimizer": "^7.0.0", "@graphql-tools/utils": "^10.0.0", @@ -2052,28 +1939,6 @@ "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0" } }, - "node_modules/@graphql-codegen/visitor-plugin-common": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-5.3.1.tgz", - "integrity": "sha512-MktoBdNZhSmugiDjmFl1z6rEUUaqyxtFJYWnDilE7onkPgyw//O0M+TuPBJPBWdyV6J2ond0Hdqtq+rkghgSIQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@graphql-codegen/plugin-helpers": "^5.0.4", - "@graphql-tools/optimize": "^2.0.0", - "@graphql-tools/relay-operation-optimizer": "^7.0.0", - "@graphql-tools/utils": "^10.0.0", - "auto-bind": "~4.0.0", - "change-case-all": "1.0.15", - "dependency-graph": "^0.11.0", - "graphql-tag": "^2.11.0", - "parse-filepath": "^1.0.2", - "tslib": "~2.6.0" - }, - "peerDependencies": { - "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0" - } - }, "node_modules/@graphql-tools/apollo-engine-loader": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/@graphql-tools/apollo-engine-loader/-/apollo-engine-loader-8.0.1.tgz", diff --git a/client/package.json b/client/package.json index 56ff4cecb5f..9753fae9777 100644 --- a/client/package.json +++ b/client/package.json @@ -30,7 +30,7 @@ }, "devDependencies": { "@graphql-codegen/cli": "5.0.3", - "@graphql-codegen/client-preset": "4.3.3", + "@graphql-codegen/client-preset": "4.5.0", "@graphql-codegen/introspection": "4.0.3", "@parcel/watcher": "2.4.1", "@testing-library/react": "16.0.1", diff --git a/renovate.json5 b/renovate.json5 index 4ca7db1444a..b46a098392a 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -26,11 +26,7 @@ "com.azure.resourcemanager:azure-resourcemanager-servicebus", "com.azure:azure-core", "com.azure:azure-messaging-servicebus", - "com.azure:azure-identity", - // there is a breaking change in this package which is breaking our workflow, that cannot - // be reverted: https://github.com/dotansimha/graphql-code-generator/issues/10167 - // once that is resolved, we can remove this line - "@graphql-codegen/client-preset" + "com.azure:azure-identity" ], "enabled": false }, From ade4c97e3550c0b84709c7e91d69f0a63402580c Mon Sep 17 00:00:00 2001 From: OTP Bot Date: Mon, 4 Nov 2024 12:49:48 +0000 Subject: [PATCH 106/110] Upgrade debug client to version 2024/11/2024-11-04T12:49 --- application/src/client/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/src/client/index.html b/application/src/client/index.html index d43beb177ee..b5df7bb65aa 100644 --- a/application/src/client/index.html +++ b/application/src/client/index.html @@ -5,8 +5,8 @@ OTP Debug Client - - + +
From 183117248598de09e43f62143fc849a8706bc32c Mon Sep 17 00:00:00 2001 From: Thomas Gran Date: Mon, 4 Nov 2024 14:22:29 +0100 Subject: [PATCH 107/110] refactor: Rename ToveUtils to TroveUtils --- .../collection/{ToveUtils.java => TroveUtils.java} | 2 +- .../graph_builder/module/osm/DisjointSet.java | 4 ++-- .../graph_builder/module/osm/OsmDatabase.java | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) rename application/src/main/java/org/opentripplanner/framework/collection/{ToveUtils.java => TroveUtils.java} (93%) diff --git a/application/src/main/java/org/opentripplanner/framework/collection/ToveUtils.java b/application/src/main/java/org/opentripplanner/framework/collection/TroveUtils.java similarity index 93% rename from application/src/main/java/org/opentripplanner/framework/collection/ToveUtils.java rename to application/src/main/java/org/opentripplanner/framework/collection/TroveUtils.java index 5958845e2b5..d3b59624eb9 100644 --- a/application/src/main/java/org/opentripplanner/framework/collection/ToveUtils.java +++ b/application/src/main/java/org/opentripplanner/framework/collection/TroveUtils.java @@ -4,7 +4,7 @@ import java.util.HashSet; import java.util.Set; -public class ToveUtils { +public class TroveUtils { public static void addToMapSet(TLongObjectMap> mapSet, long key, U value) { Set set = mapSet.get(key); diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/osm/DisjointSet.java b/application/src/main/java/org/opentripplanner/graph_builder/module/osm/DisjointSet.java index 369e5c20a14..d130a435eaf 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/osm/DisjointSet.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/osm/DisjointSet.java @@ -9,7 +9,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Set; -import org.opentripplanner.framework.collection.ToveUtils; +import org.opentripplanner.framework.collection.TroveUtils; /** Basic union-find data structure with path compression */ class DisjointSet { @@ -62,7 +62,7 @@ public boolean exists(T element) { public List> sets() { TLongObjectMap> out = new TLongObjectHashMap<>(); setMapping.forEachEntry((k, v) -> { - ToveUtils.addToMapSet(out, compact(v), k); + TroveUtils.addToMapSet(out, compact(v), k); return true; }); return new ArrayList<>(out.valueCollection()); diff --git a/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmDatabase.java b/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmDatabase.java index 382b206a053..0781b73f076 100644 --- a/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmDatabase.java +++ b/application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmDatabase.java @@ -24,7 +24,7 @@ import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.LineString; import org.locationtech.jts.geom.Point; -import org.opentripplanner.framework.collection.ToveUtils; +import org.opentripplanner.framework.collection.TroveUtils; import org.opentripplanner.framework.geometry.GeometryUtils; import org.opentripplanner.framework.geometry.HashGridSpatialIndex; import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore; @@ -267,7 +267,7 @@ public void addWay(OsmWay way) { way .getNodeRefs() .forEach(node -> { - ToveUtils.addToMapSet(areasForNode, node, way); + TroveUtils.addToMapSet(areasForNode, node, way); return true; }); } @@ -738,7 +738,7 @@ private void processMultipolygonRelations() { while (wayNodeIterator.hasNext()) { long nodeId = wayNodeIterator.next(); if (nodesById.containsKey(nodeId)) { - ToveUtils.addToMapSet(areasForNode, nodeId, way); + TroveUtils.addToMapSet(areasForNode, nodeId, way); } else { // this area is missing some nodes, perhaps because it is on // the edge of the region, so we will simply not route on it. From 507baeff62db323141dacc5c3bccebe8f0fa71cf Mon Sep 17 00:00:00 2001 From: OTP Serialization Version Bot Date: Mon, 4 Nov 2024 16:58:42 +0000 Subject: [PATCH 108/110] Bump serialization version id for #6209 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 12febbac795..284153b6486 100644 --- a/pom.xml +++ b/pom.xml @@ -58,7 +58,7 @@ - 169 + 170 32.0 2.52 From cb73bffbcf3f81374320e47770a31aa9f60aa89f Mon Sep 17 00:00:00 2001 From: Sam Kim <21956685+sam-k@users.noreply.github.com> Date: Mon, 4 Nov 2024 11:28:18 -0800 Subject: [PATCH 109/110] Applied reviewer comments --- doc/dev/decisionrecords/Codestyle.md | 10 +++++----- doc/dev/decisionrecords/NamingConventions.md | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/dev/decisionrecords/Codestyle.md b/doc/dev/decisionrecords/Codestyle.md index 170c592f437..22f57eacbda 100644 --- a/doc/dev/decisionrecords/Codestyle.md +++ b/doc/dev/decisionrecords/Codestyle.md @@ -10,9 +10,9 @@ run `prettier-maven-plugin`. A check is run in the CI build, which fails the bui merging a PR if the code style is incorrect. There are two ways to format the code before checking it in. You may run a normal build with -Maven—it takes a bit of time, but reformat the entire codebase. Only code you have changed should be -formatted, since the existing code is already formatted. The second way is to set up Prettier and -run it manually or hick it into your IDE, so it runs every time a file is changed. +Maven; it takes a bit of time, but it reformats the entire codebase. Only code you have changed +should be formatted, since the existing code is already formatted. The second way is to set up +Prettier and run it manually or hick it into your IDE, so it runs every time a file is changed. ### How to Run Prettier with Maven @@ -47,10 +47,10 @@ The check is run by the CI server and will fail the build if the code is incorre You should use the Prettier Maven plugin to reformat the code or run Prettier with Node (faster). -Prettier does _not_ format the doc and Markdown files—only Java code. So, for other files, you +Prettier does _not_ format the doc and Markdown files, only Java code. So, for other files you should use the _project_ code style. It is automatically imported when you first open the project. But, if you have set a custom code style in your settings (as we used until OTP v2.1), then you need -to change to the _Project_ code style. Open the `Preferences` from the menu and select _Editor > +to change to the _Project_ code style. Open the `Preferences` from the menu and select _Editor > Code Style_. Then select **Project** in the \_Scheme drop down. #### Run Prettier Maven Plugin as an External Tool in IntelliJ diff --git a/doc/dev/decisionrecords/NamingConventions.md b/doc/dev/decisionrecords/NamingConventions.md index 53c783950d9..16b37a799bf 100644 --- a/doc/dev/decisionrecords/NamingConventions.md +++ b/doc/dev/decisionrecords/NamingConventions.md @@ -2,7 +2,7 @@ In general, we use American English. We use the GTFS terminology inside OTP as the transit domain-specific language. In cases where GTFS does not provide an alternative, we use NeTEx. The -naming should follow the Java standard naming conventions. For example, a "real-time updater" class +naming should follow the Java standard naming conventions. For example, a "real-time updater" class is named `RealTimeUpdater`. If in doubt, check the Oxford Dictionary (American). ## Packages From 39c0aac969d71dc7d53272909827eda791716b0f Mon Sep 17 00:00:00 2001 From: OTP Changelog Bot Date: Tue, 5 Nov 2024 10:29:43 +0000 Subject: [PATCH 110/110] Add changelog entry for #6182 [ci skip] --- doc/user/Changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/user/Changelog.md b/doc/user/Changelog.md index b1064503a68..6f4b3f9d8b4 100644 --- a/doc/user/Changelog.md +++ b/doc/user/Changelog.md @@ -30,6 +30,7 @@ based on merged pull requests. Search GitHub issues and pull requests for smalle - Revert [#6214](https://github.com/opentripplanner/OpenTripPlanner/pull/6214) - Remove reading agency and route brandingUrl from GTFS data [#6183](https://github.com/opentripplanner/OpenTripPlanner/pull/6183) - Fix NullPointerException when searching backwards with a frequency-based trip [#6211](https://github.com/opentripplanner/OpenTripPlanner/pull/6211) +- Combine two multi-criteria searches in Raptor [#6182](https://github.com/opentripplanner/OpenTripPlanner/pull/6182) [](AUTOMATIC_CHANGELOG_PLACEHOLDER_DO_NOT_REMOVE) ## 2.6.0 (2024-09-18)