XStream
  1. XStream
  2. XSTR-774

Use ISO-8601 strings for java.time objects

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major 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-terrible well 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.

        Activity

        Hide
        Geoff Groos added a comment -

        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.

        Show
        Geoff Groos added a comment - 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.

          People

          • Assignee:
            Jörg Schaible
            Reporter:
            Geoff Groos
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: