Skip to content

Commit

Permalink
Make some collections in TransitModelIndex unmodifiable
Browse files Browse the repository at this point in the history
  • Loading branch information
habrahamsson-skanetrafiken committed Oct 10, 2024
1 parent 2b40570 commit f245442
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ public Collection<Route> getAllRoutes() {
currentSnapshot.listRealTimeAddedRoutes()
);
}
return Collections.unmodifiableCollection(transitModelIndex.getAllRoutes());
return transitModelIndex.getAllRoutes();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,15 @@ TripOnServiceDate getTripOnServiceDateForTripAndDay(TripIdAndServiceDate tripIdA
}

Collection<Route> getAllRoutes() {
return routeForId.values();
return Collections.unmodifiableCollection(routeForId.values());
}

TripPattern getPatternForTrip(Trip trip) {
return patternForTrip.get(trip);
}

Collection<TripPattern> getPatternsForRoute(Route route) {
return patternsForRoute.get(route);
return Collections.unmodifiableCollection(patternsForRoute.get(route));
}

Map<LocalDate, TIntSet> getServiceCodesRunningForDate() {
Expand Down

0 comments on commit f245442

Please sign in to comment.