Uploaded image for project: 'Johnzon'
  1. Johnzon
  2. JOHNZON-80

Serialization of Maps should take AttributeOrder into account

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.9.2-incubating
    • 1.1.4
    • Mapper
    • None

    Description

      MapperBuilder allows to pass a java.util.Comparator to define the AttributeOrder, e.g. write Object properties in their lexicographic order.

      It seems that this order is ignored when java.util.Maps are serialized.
      It would be nice if the AttributeOrder would be used in this case as well.

      Tested on Johnzon 0.9.2-incubating, but looking at the current master it seems that this behavior is still in place even though the code was a bit refactored.

      edit: After discussion it seems this shouldn't be done automatically with the AttributeOrder. Instead it might be considered to have an additional flag like sortMaps on the MapperBuilder to get the desired behavior.

      Attachments

        Activity

          People

            romain.manni-bucau Romain Manni-Bucau
            robertpanzer Robert Panzer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: