Skip to content

Commit

Permalink
Merge pull request #5857 from Skanetrafiken/timetable-feedid-comparison
Browse files Browse the repository at this point in the history
Fix comparison of feedId
  • Loading branch information
habrahamsson-skanetrafiken authored May 23, 2024
2 parents e2868c6 + cef1fd5 commit 8d2f1c1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/org/opentripplanner/model/Timetable.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public TripTimes getTripTimes(Trip trip) {

public TripTimes getTripTimes(FeedScopedId tripId) {
for (TripTimes tt : tripTimes) {
if (tt.getTrip().getId() == tripId) {
if (tt.getTrip().getId().equals(tripId)) {
return tt;
}
}
Expand Down
6 changes: 6 additions & 0 deletions src/test/java/org/opentripplanner/model/TimetableTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ public static void setUp() throws Exception {
trip_1_1_index = timetable.getTripIndex(new FeedScopedId(feedId, TRIP_ID));
}

@Test
public void getGetTripTimes() {
var tt = timetable.getTripTimes(new FeedScopedId(feedId, TRIP_ID));
assertNotNull(tt);
}

@Test
public void tripNotFoundInPattern() {
// non-existing trip
Expand Down

0 comments on commit 8d2f1c1

Please sign in to comment.