diff --git a/src/main/java/org/opentripplanner/routing/algorithm/mapping/PagingServiceFactory.java b/src/main/java/org/opentripplanner/routing/algorithm/mapping/PagingServiceFactory.java index 0e127a8b350..8b122e6cf24 100644 --- a/src/main/java/org/opentripplanner/routing/algorithm/mapping/PagingServiceFactory.java +++ b/src/main/java/org/opentripplanner/routing/algorithm/mapping/PagingServiceFactory.java @@ -39,9 +39,10 @@ public static PagingService createPagingService( } static Duration searchWindowOf(SearchParams searchParamsUsed) { - return searchParamsUsed == null || !searchParamsUsed.isSearchWindowSet() - ? null - : Duration.ofSeconds(searchParamsUsed.searchWindowInSeconds()); + if (searchParamsUsed == null || !searchParamsUsed.isSearchWindowSet()) { + return null; + } + return Duration.ofSeconds(searchParamsUsed.searchWindowInSeconds()); } static Instant edt(Instant transitSearchStartTime, SearchParams searchParamsUsed) { diff --git a/src/main/java/org/opentripplanner/routing/service/DefaultRoutingService.java b/src/main/java/org/opentripplanner/routing/service/DefaultRoutingService.java index 91398e13c73..320ffb2117d 100644 --- a/src/main/java/org/opentripplanner/routing/service/DefaultRoutingService.java +++ b/src/main/java/org/opentripplanner/routing/service/DefaultRoutingService.java @@ -59,9 +59,10 @@ public ViaRoutingResponse route(RouteViaRequest request) { private void logResponse(RoutingResponse response) { if (LOG.isDebugEnabled()) { + var m = response.getMetadata(); var text = MultiLineToStringBuilder .of("Response") - .addDuration("SearchWindowUsed", response.getMetadata().searchWindowUsed) + .addDuration("SearchWindowUsed", m == null ? null : m.searchWindowUsed) .add("NextPage", response.getNextPageCursor()) .add("PreviousPage", response.getPreviousPageCursor()) .addColNl(