ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Taras Ledkov (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (IGNITE-4062) BinaryObject header should not participate in equals test
Date Fri, 21 Oct 2016 16:10:58 GMT

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

Taras Ledkov commented on IGNITE-4062:
--------------------------------------

I guess in case one of objects {{typeId == UNREGISTERED_TYPE_ID}} make sense compare the first
{{hash}} codes and if they are equals check the class names.

> BinaryObject header should not participate in equals test
> ---------------------------------------------------------
>
>                 Key: IGNITE-4062
>                 URL: https://issues.apache.org/jira/browse/IGNITE-4062
>             Project: Ignite
>          Issue Type: Bug
>          Components: binary
>    Affects Versions: 1.7
>            Reporter: Valentin Kulichenko
>            Assignee: Taras Ledkov
>            Priority: Critical
>             Fix For: 1.8
>
>
> {{BinaryObject.equals()}} compares the full byte array, which can give incorrect results
in come cases. For example, we sometimes write full class name instead of type ID, so two
objects that are equal from user's standpoint will have different binary representation and
{{equals()}} will return false.
> We should make {{equals()}} implementation more smart and compare separately:
> * type ID
> * hash code
> * portion of byte array that contains actual data, i.e. fields without header and footer



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

Mime
View raw message