-
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 ClassCastException in Itinerary mapper #6455
Open
t2gran
wants to merge
8
commits into
opentripplanner:dev-2.x
Choose a base branch
from
entur:fix_npe_in_via_search
base: dev-2.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains 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
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #6455 +/- ##
=============================================
+ Coverage 70.31% 70.36% +0.04%
- Complexity 18158 18166 +8
=============================================
Files 2058 2058
Lines 76942 76923 -19
Branches 7773 7761 -12
=============================================
+ Hits 54101 54124 +23
+ Misses 20086 20044 -42
Partials 2755 2755 ☔ 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]>
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
DefaultAccessEgress
is changed, but I do not think it is serialized.