Repository navigation
[DDB Mapper V2] Make Joda-Time an optional dependency - #7518
Merged
alextwoods merged 2 commits intoNov 9, 2026
Merged
Conversation
Joda-Time was a required dependency for every mapper user. It is now optional and needed only for org.joda.time.DateTime attributes and @DynamoDBTypeConvertedTimestamp. - MapperDateUtils formats and parses ISO-8601 dates with java.time instead of Joda-Time. Output is byte-for-byte the same as the v1 mapper's, including the fixed three-digit milliseconds, so stored Date and Calendar values and their key ordering are unchanged. Parsing accepts the same inputs as before. One difference: strings outside the range of Date now throw IllegalArgumentException, where Joda-Time silently overflowed. - StandardTypeConverters and StandardModelFactories no longer reference Joda-Time directly. DateTime conversions live in a nested class that loads only when JodaTimeSupport finds Joda-Time with the mapper's class loader. - @DynamoDBTypeConvertedTimestamp keeps Joda-Time pattern semantics through JodaTimestampConverter. Without Joda-Time it fails with a clear DynamoDBMappingException. The javadoc now says the pattern follows Joda-Time rules rather than SimpleDateFormat. - If the application can load Joda-Time but the mapper's class loader cannot, a DateTime attribute now fails with the same clear error instead of being written as DateTime.toString(), including into N attributes. Tests: - MapperDateUtilsJodaCompatibilityTest compares the java.time implementation with the original Joda-Time one, kept as a test-only reference. - DynamoDBTypeConvertedTimestampTest adds unit coverage for the annotation, including a save and load against DynamoDB Local. - DynamoDBMapperWithoutJodaTimeTest runs in a new without-joda-time surefire execution with Joda-Time removed from the classpath, and also covers Joda-Time visible only to the application's class loader.
S-Saranya1
reviewed
Nov 6, 2026
S-Saranya1
approved these changes
Nov 9, 2026
|
This pull request has been closed and the conversation has been locked. Comments on closed PRs are hard for our team to see. If you need more assistance, please open a new issue that references this one. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Note - This branch merges to the feature branch and NOT master.
Motivation and Context
Joda-time was a dependency for the V1 mapper and was ported over. This PR makes it an optional dependency for the preview release (with a follow up task to evaluate options for GA).
Joda-time is now optional and needed only for org.joda.time.DateTime attributes and @DynamoDBTypeConvertedTimestamp. Note - if a customer has a class with a joda
DateTimeattribute, they will already have joda on their classpath, so these cases will continue to work.Changes
Tests:
License