[ 
https://issues.apache.org/jira/browse/IGNITE-3191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15491637#comment-15491637
 ] 

Valentin Kulichenko commented on IGNITE-3191:
---------------------------------------------

Another issue caused by using {{LinkedHashMap}} in the builder is wrong equals. 
If the same set of fields is added with the same values, but in different 
order, objects will not be equal, because we compare byte arrays.

We should use {{TreeMap}} in builder and also sort fields in the 
{{BinaryClassDescriptor}}, so that serialization of a POJO is also consistent.

> BinaryObjectBuilder: binary schema id depends on the order of fields addition
> -----------------------------------------------------------------------------
>
>                 Key: IGNITE-3191
>                 URL: https://issues.apache.org/jira/browse/IGNITE-3191
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Denis Magda
>            Priority: Critical
>             Fix For: 1.8
>
>
> Presently if an object is created using BinaryObjectBuilder then several 
> BinarySchemes can be generated for the same set of fields in case when fields 
> are added in a different order.
> This happens because {{LinkedHashMap}} is used underneath. However we should 
> rely on order-free structure like {{TreeMap}}.



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

Reply via email to