-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix NullPointerException in stop transfer priority cost vector generation #5943
Fix NullPointerException in stop transfer priority cost vector generation #5943
Conversation
src/main/java/org/opentripplanner/transit/service/StopModelIndex.java
Outdated
Show resolved
Hide resolved
3e0c482
to
b84f117
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #5943 +/- ##
=============================================
- Coverage 69.45% 69.45% -0.01%
- Complexity 17070 17071 +1
=============================================
Files 1937 1937
Lines 73692 73710 +18
Branches 7540 7544 +4
=============================================
+ Hits 51184 51192 +8
- Misses 19880 19885 +5
- Partials 2628 2633 +5 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. A few typos.
src/main/java/org/opentripplanner/transit/service/StopModelIndex.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opentripplanner/transit/service/StopModelIndex.java
Outdated
Show resolved
Hide resolved
d2517ad
to
0c914c4
Compare
Summary
In some cases (transit period filtering) stops can be dropped after they are created. This causes the stop-index(used in routing) to contain holes in it. This happens because the stop index is assigned to a stop when it is created. In this PR, I have gone over the code to make sure holes in the stop-index is handled correctly and no NPE is thrown.
Issue
After enabling
stopBoardAlightDuringTransferCost
I got NPE locally during testing of OTP. This fixes the NPE in TransitLayerMapper and cleans up the code a bit.Unit tests
🟥 I have not added any unit-tests for this. Instead I chose to improve logging and annotated with
@Nullable
in the appropriate place.Documentation
🟥 I have just updated the JaveDoc - if relevant.
Changelog
✅ This is a minor bug fix.
Bumping the serialization version id
✅ The order of the
StopTransferPriority
enums are changed. This may have an effect on the serialization.