Skip to content

Commit db1f945

Browse files
committed
Change variable from int to Duration.
1 parent 3081871 commit db1f945

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

application/src/main/java/org/opentripplanner/model/plan/paging/cursor/PageCursorConstants.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package org.opentripplanner.model.plan.paging.cursor;
22

3+
import java.time.Duration;
4+
35
public class PageCursorConstants {
46

57
/**
@@ -9,5 +11,5 @@ public class PageCursorConstants {
911
* <p>
1012
* The value is set to 60 seconds because raptor operates in one minute increments.
1113
*/
12-
public static final int SEARCH_WINDOW_END_EXCLUSIVITY_TIME_ADDITION_SECONDS = 60;
14+
public static final Duration SEARCH_WINDOW_END_EXCLUSIVITY_TIME_ADDITION = Duration.ofSeconds(60);
1315
}

application/src/main/java/org/opentripplanner/model/plan/paging/cursor/PageCursorFactory.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ private void createPageCursors() {
140140
prevEdt = pageCursorInput
141141
.latestRemovedDeparture()
142142
.minus(newSearchWindow)
143-
.plusSeconds(PageCursorConstants.SEARCH_WINDOW_END_EXCLUSIVITY_TIME_ADDITION_SECONDS);
143+
.plus(PageCursorConstants.SEARCH_WINDOW_END_EXCLUSIVITY_TIME_ADDITION);
144144
nextEdt = edtAfterUsedSw();
145145
}
146146
}
@@ -173,8 +173,8 @@ private Instant edtBeforeNewSw() {
173173
private Instant edtAfterUsedSw() {
174174
Instant defaultEdt = currentEdt.plus(currentSearchWindow);
175175
if (firstSearchLatestItineraryDeparture != null) {
176-
Instant edtFromLatestItineraryDeparture = firstSearchLatestItineraryDeparture.plusSeconds(
177-
PageCursorConstants.SEARCH_WINDOW_END_EXCLUSIVITY_TIME_ADDITION_SECONDS
176+
Instant edtFromLatestItineraryDeparture = firstSearchLatestItineraryDeparture.plus(
177+
PageCursorConstants.SEARCH_WINDOW_END_EXCLUSIVITY_TIME_ADDITION
178178
);
179179
if (edtFromLatestItineraryDeparture.isBefore(defaultEdt)) {
180180
return edtFromLatestItineraryDeparture;

0 commit comments

Comments
 (0)