johnzon-dev mailing list archives

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


Romain Manni-Bucau commented on JOHNZON-80:

[~robertpanzer] can you show me why you can't do in your test something like:

myModel.getNested().setMap(new LinkedHashSet<>(myModel.getNested().getMap()));


If we do it now we'll get tomorrow the opposite issue "My LinkedHashMap order is no more respected".
We can add a flag to sort maps but I don't really get the benefit since it is already doable
when required.

> Serialization of Maps should take AttributeOrder into account
> -------------------------------------------------------------
>                 Key: JOHNZON-80
>                 URL:
>             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.

This message was sent by Atlassian JIRA

View raw message