Refactor: Migrate netflix-sel from joda-time to java.time#207
Open
h4xr wants to merge 1 commit intoNetflix:mainfrom
Open
Refactor: Migrate netflix-sel from joda-time to java.time#207h4xr wants to merge 1 commit intoNetflix:mainfrom
h4xr wants to merge 1 commit intoNetflix:mainfrom
Conversation
Resolves Netflix#61. Migrated all SEL types and utilities from org.joda.time.* to java.time.* (JSR-310). Ensured that all MethodHandles resolve to the new java.time compatible types while preserving the exact SEL expression signatures. Replaced DateTimeUtils test clock overrides with java.time.Clock injection. Removed jodaTimeDep from netflix-sel/build.gradle.
Author
|
@jun-he Can you please help with the review |
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.
Resolves #61
This PR completely removes the
joda-timedependency from thenetflix-selmodule and migrates the internal SEL AST wrappers and type logic to the nativejava.time(JSR-310) API.Specifically addressing the concerns raised in the issue:
SelJodaDateTimeandSelJodaDateTimeFormatterretain their original names, and allMethodHandlescontinue to expose the exact same string signatures (e.g.plusDays1,withTimeAtStartOfDay0). Users will not need to modify their existing SEL expressions; we simply rewrote the internal implementations to useZonedDateTime.SelClassLoader.javaby replacing theorg.joda.timezone provider caching with proactive caching ofjava.time.ZoneIdavailable IDs. Becausejava.timeis part of the JDK bootstrap classloader, it inherently avoids the third-party GC unloading risks previously associated with Joda-Time within the SEL sandbox.Other key changes:
DateTimewithZonedDateTimeinsideSelJodaDateTimeand related wrappers.ChronoFieldandIsoFields.DateTimeFormatterusages withjava.time.format.DateTimeFormatter, implementing strictparseDefaultinglogic to maintain backward compatibility with Joda-Time's lenient formatting/parsing patterns.java.time.Clock.jodaTimeDepfrombuild.gradle.Exploration and planning for this migration was assisted by Neuvem Decypher.