-
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
Add support for DSJ in transit leg reference #5455
Add support for DSJ in transit leg reference #5455
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #5455 +/- ##
=============================================
+ Coverage 66.82% 66.88% +0.06%
- Complexity 15473 15517 +44
=============================================
Files 1798 1800 +2
Lines 69804 69906 +102
Branches 7359 7361 +2
=============================================
+ Hits 46646 46758 +112
+ Misses 20702 20692 -10
Partials 2456 2456
☔ View full report in Codecov by Sentry. |
073923e
to
3c3e59c
Compare
3c3e59c
to
07ec689
Compare
07ec689
to
ef5f54c
Compare
This implementation guarantees backward compatibility (newer versions of OTP can parse tokens generated by previous versions of OTP), but not forward compatibility (an older version of OTP would fail when attempting to deserialize a token generated by a newer version). This is due to the deserializer attempting to resolve the token version as a Java enum, which is missing in older versions of the class. The conclusion is that:
|
@@ -45,8 +52,8 @@ enum LegReferenceType { | |||
/** | |||
* Return the latest LegReferenceType version for a given leg reference class. | |||
*/ | |||
static LegReferenceType forClass(Class<? extends LegReference> legReferenceClass) { | |||
Optional<LegReferenceType> latestVersion = Arrays | |||
static Optional<LegReferenceType> forClass(Class<? extends LegReference> legReferenceClass) { |
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.
Nice.
Summary
As detailed in #5422, a transit leg reference should refer to a TripOnServiceDate id (i.e. dated service journey id) when one exists,
since a dated service journey provides a more stable id across deliveries of planned data.
The PR introduces also a builder for ScheduledTransitLeg and FrequencyTransitLeg.
Issue
Closes #5422
Unit tests
Added unit tests
Documentation
No