Fix NullPointerException in stop transfer priority cost vector generation - #5943
Merged
Merged
Conversation
t2gran
force-pushed
the
otp2_fix_npe_stop_tx_cost
branch
from
July 3, 2024 09:45
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. |
vpaturet
requested changes
Jul 3, 2024
vpaturet
left a comment
Contributor
There was a problem hiding this comment.
Looks good. A few typos.
t2gran
force-pushed
the
otp2_fix_npe_stop_tx_cost
branch
from
July 3, 2024 12:06
d2517ad to
0c914c4
Compare
vpaturet
approved these changes
Jul 3, 2024
leonardehrenfried
approved these changes
Jul 3, 2024
t2gran
pushed a commit
that referenced
this pull request
Jul 4, 2024
t2gran
pushed a commit
that referenced
this pull request
Jul 4, 2024
t2gran
added a commit
to entur/OpenTripPlanner-LegacyHSLFork
that referenced
this pull request
Jul 4, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
stopBoardAlightDuringTransferCostI 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
@Nullablein 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
StopTransferPriorityenums are changed. This may have an effect on the serialization.