Refactor NearbyStop to have a stopId rather than a stop#7463
Refactor NearbyStop to have a stopId rather than a stop#7463optionsome wants to merge 5 commits intoopentripplanner:dev-2.xfrom
Conversation
...st/java/org/opentripplanner/graph_builder/module/nearbystops/StreetNearbyStopFinderTest.java
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #7463 +/- ##
=============================================
- Coverage 71.02% 70.99% -0.03%
+ Complexity 20995 20993 -2
=============================================
Files 2348 2348
Lines 87252 87276 +24
Branches 8640 8635 -5
=============================================
- Hits 61967 61961 -6
- Misses 22291 22320 +29
- Partials 2994 2995 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jessicaKoehnke
left a comment
There was a problem hiding this comment.
Nice! As a general question: Do we like using static methods, or do we rather want to have initialized components that could be injected by dagger and for example mocked in tests?
application/src/ext/java/org/opentripplanner/ext/transferanalyzer/DirectTransferAnalyzer.java
Outdated
Show resolved
Hide resolved
...va/org/opentripplanner/routing/algorithm/raptoradapter/router/street/AccessEgressRouter.java
Show resolved
Hide resolved
.../src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/router/TransitRouter.java
Outdated
Show resolved
Hide resolved
...st/java/org/opentripplanner/graph_builder/module/nearbystops/StreetNearbyStopFinderTest.java
Show resolved
Hide resolved
habrahamsson-skanetrafiken
left a comment
There was a problem hiding this comment.
This looks nice. Just one question
| // Skip the origin stop, loop transfers are not needed. | ||
| if (sd.stop == stop) { | ||
| var nearbyStop = repository.getStopLocation(sd.stopId); | ||
| if (nearbyStop == stop) { |
There was a problem hiding this comment.
Do you know if there's a reason that we use == here instead of equals?
There was a problem hiding this comment.
Stops are probably deduplicated so we shouldn't have two instances of the same stop. Although, I haven't confirmed this so not sure if I should add a comment that states that or not?
There was a problem hiding this comment.
I think we should just switch to .equals unless there's a reason not to. Just so people don't have to wonder. But you don't have to do that in this PR unless you want to
|
There is a conflict |
Summary
Goal of this pr is to get rid of stop dependency in the
NearbyStopclass. There is some related refactoring to achieve this.Issue
No issue
Unit tests
Updated
Documentation
No
Changelog
Skipped