johnzon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Romain Manni-Bucau (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (JOHNZON-80) Serialization of Maps should take AttributeOrder into account
Date Tue, 31 May 2016 08:40:12 GMT

     [ https://issues.apache.org/jira/browse/JOHNZON-80?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Romain Manni-Bucau updated JOHNZON-80:
--------------------------------------
    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.

  was:
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.


> Serialization of Maps should take AttributeOrder into account
> -------------------------------------------------------------
>
>                 Key: JOHNZON-80
>                 URL: https://issues.apache.org/jira/browse/JOHNZON-80
>             Project: Johnzon
>          Issue Type: Improvement
>          Components: Mapper
>    Affects Versions: 0.9.2-incubating
>            Reporter: Robert Panzer
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message