Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 1.4.7
-
Fix Version/s: 1.4.10
-
Component/s: Converters
-
Labels:None
Description
As a dev I want to use XStream to serialize java.time objects so that I can develop with a
not-terriblewell thought out time library
Currently XStream's default conversion behaviour for all members of the java.time package (namely Duration and LocalTime) is to reduce them to a second and nanos long value, and attempt to serialize them as a generic base class.
XStream fails to preserve the specific types, resulting in a failure on deserialization for reasons unbeknownst to yours truely (though Jorg might have some insight here)
Regardless, the java.time classes all toString() to ISO 8601 compliant strings, thus it makes much more sense for XStream to simply serialize and deserialize to these strings instead of performing any kind of conversion.
I started poking at some classes and test cases to implement this.
I'm going to do my best to come up with a reasonably comprehensive test suite, though I'm not too familiar with all of the minutia of date-time problems.