Migrate from Joda Time to java.time API (MBA-72) #84
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.
Migrate from Joda Time to java.time API (MBA-72)
Summary
This PR implements a complete migration from the deprecated Joda Time library (2.10.13) to the modern java.time API across the entire codebase. The migration replaces
DateTimewithInstantthroughout all layers while maintaining identical functionality, UTC timezone behavior, ISO 8601 serialization format, and cursor-based pagination with millisecond precision.Key Changes:
joda-time:2.10.13from build.gradleDateTimeHandlerwithInstantTypeHandler(maintains UTC Calendar usage)ArticleandCommentto useInstantinstead ofDateTimeArticleDataandCommentDatatimestamp fields toInstantDateTimeCursorto usetoEpochMilli()/ofEpochMilli()for millisecond serializationDateTimeFormatter.ISO_INSTANT(produces identical ISO 8601 format)DateTimeFormatter.ISO_INSTANTInstant.now()and java.time APIsFiles Changed: 17 files total
Review & Testing Checklist for Human
2024-01-15T10:30:00.123Z(ISO 8601 with milliseconds and Z suffix)Notes
Migration Patterns Used:
DateTime→Instant(inherently UTC)new DateTime()→Instant.now()getMillis()→toEpochMilli()new DateTime(millis)→Instant.ofEpochMilli(millis).minusHours(1)→.minusSeconds(3600)ISODateTimeFormat.dateTime().withZoneUTC().print()→DateTimeFormatter.ISO_INSTANT.format()Why Instant over LocalDateTime:
Instantrepresents a point in time in UTC, matching the existing JodaDateTimeusage with UTC zone. This maintains the UTC-centric architecture without timezone conversion complexity.Cursor Compatibility: Both Joda's
getMillis()and java.time'stoEpochMilli()return epoch milliseconds, ensuring cursor backward compatibility.Link to Devin run: https://app.devin.ai/sessions/936112838b6444758d13944e58f39e4b
Requested by: Daniella Grimberg (@danigrim)
Ticket: MBA-72