Fix ClassCastException in Itinerary mapper#6455
Merged
Merged
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #6455 +/- ##
=============================================
+ Coverage 70.31% 70.45% +0.13%
- Complexity 18158 18202 +44
=============================================
Files 2058 2061 +3
Lines 76942 76934 -8
Branches 7773 7765 -8
=============================================
+ Hits 54101 54202 +101
+ Misses 20086 19961 -125
- Partials 2755 2771 +16 ☔ View full report in Codecov by Sentry. |
…ssEgress. The code did not work because the access/egress is can be wrapped inside Raptor.
t2gran
force-pushed
the
fix_npe_in_via_search
branch
from
February 12, 2025 08:49
b866b5e to
1386fc3
Compare
vpaturet
self-requested a review
February 13, 2025 14:35
…orAccessEgress.java Co-authored-by: Leonard Ehrenfried <mail@leonard.io>
vpaturet
requested changes
Feb 17, 2025
leonardehrenfried
approved these changes
Feb 18, 2025
vpaturet
approved these changes
Feb 20, 2025
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 Raptor instrument access and egress by decorating the instance passed in by the OTP application. The result path returned by raptor will include these instrumented paths. The itinerary mapper assume the all access and egress legs returned from Raptor are of the original type
RoutingAccessEgress- this fails:OpenTripPlanner/application/src/main/java/org/opentripplanner/routing/algorithm/mapping/RaptorPathToItineraryMapper.java
Line 195 in a9d43f6
OpenTripPlanner/application/src/main/java/org/opentripplanner/routing/algorithm/mapping/RaptorPathToItineraryMapper.java
Line 332 in a9d43f6
This PR fixes this.
Several test failed after I fixed the bug in the RaptorPathToItineraryMapper. The test are known to NOT use proper test data. Instead of using the OTP domain classes they uses the Raptor Test Mockups (copied over into the application when moving Raptor out). I went through the mocks and deleted all unused code - I wanted to reduse the amount of code I needed to fix. Then, I fixed the mockup to use the OTP Domain objects (DefaultAccessEgress) for access and egress. I did NOT swap out the timetable data, since fixing the access/egress was enough to make the test green again.
At Entur we have seen this in via vistit seach, but it is probably not limited to this.
Issue
🟥 There in no issue reported for this.
This query can be used to reproduce the error:
And this is one of the log events from the logs ():
Unit tests
✅ A few new unit tests are added, but no regression test for the mapper.
Documentation
🟥 Only code comments are updated.
Changelog
This is should be listed under minor bugfixes.
Bumping the serialization version id
🟥 Should not be needed. The
DefaultAccessEgressis changed, but I do not think it is serialized.