You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Joda time has not been in active development since Java 8 and with the move to Java 21, it is time to switch. Functionality overlaps in most areas, so most of the work is in switching out Joda Time classes for Java time equivalents. There are a few areas that require extra consideration:
Java time supports nanosecond precision, while Joda Time only has millisecond precision. This could lead to issues when communicating with older brokers due to different serialized representation and should be handled through custom serializers.
Time Zone Handling in Java Time can be done using ZoneID or ZoneOffset. In out case, ZoneOffset would be easier to use, as ZoneOffset.UTC is directly comparable to Instant, while ZoneID and Instant will always have different representations and require extra conversion steps.
Null Value Handling Joda-Time is more permissive when dealing with null values. This can lead to NullPointerExceptions if handled incorrectly.
E.g. start = new DateTime(start, DateTimeZone.UTC); in Joda time will set start to now if it was null. This does not work in java time.
The text was updated successfully, but these errors were encountered:
Joda time has not been in active development since Java 8 and with the move to Java 21, it is time to switch. Functionality overlaps in most areas, so most of the work is in switching out Joda Time classes for Java time equivalents. There are a few areas that require extra consideration:
Java time supports nanosecond precision, while Joda Time only has millisecond precision. This could lead to issues when communicating with older brokers due to different serialized representation and should be handled through custom serializers.
Time Zone Handling in Java Time can be done using
ZoneID
orZoneOffset
. In out case,ZoneOffset
would be easier to use, asZoneOffset.UTC
is directly comparable toInstant
, whileZoneID
andInstant
will always have different representations and require extra conversion steps.Null Value Handling Joda-Time is more permissive when dealing with null values. This can lead to NullPointerExceptions if handled incorrectly.
E.g.
start = new DateTime(start, DateTimeZone.UTC);
in Joda time will set start to now if it was null. This does not work in java time.The text was updated successfully, but these errors were encountered: