-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix ClassCastException in Itinerary mapper #6455
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
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.
b866b5e to
1386fc3
Compare
raptor/src/main/java/org/opentripplanner/raptor/api/model/RaptorAccessEgress.java
Outdated
Show resolved
Hide resolved
…orAccessEgress.java Co-authored-by: Leonard Ehrenfried <[email protected]>
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.
Just a minor comment.
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.