hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jesse Yates (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HBASE-3387) Pair does not deep check arrays for equality.
Date Mon, 17 Jan 2011 15:41:44 GMT

    [ https://issues.apache.org/jira/browse/HBASE-3387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12982671#action_12982671

Jesse Yates commented on HBASE-3387:

This was introduced to correct behavior in software on my side (e.g. non-HBase core) that
for all intents and purposes should have worked, but didn't because of the previous definition
of Pair.equals().

As far as the equals/hashCode issue, we could also overwrite the hashCode in Pair to ensure
that the equals and hashCode methods work out to the same equality.

This change was made because they underlying arrays really should check the underlying types
in Pairs, to check if they really would be the same thing. If we fix the hashCode method,
then I think we end up with a system that is really more flexible than just comparing the
pointer addresses.

. Is there somewhere in HBase where this breaks the current model and I just missed it?

> Pair does not deep check arrays for equality. 
> ----------------------------------------------
>                 Key: HBASE-3387
>                 URL: https://issues.apache.org/jira/browse/HBASE-3387
>             Project: HBase
>          Issue Type: Bug
>          Components: util
>    Affects Versions: 0.90.1
>         Environment: Any (discovered in Ubuntu 10.10 using TRUNK). 
>            Reporter: Jesse Yates
>            Priority: Minor
>             Fix For: 0.90.1, 0.92.0
>         Attachments: HBASE-3387.patch
>   Original Estimate: 0h
>  Remaining Estimate: 0h
> Pair does not deep check arrays for equality. It merely does x.equals(y) for the sent
Object. However, with any type of array this is merely going to compare the array pointers,
rather than the underlying data structure.
> It requires a rewriting of the private equals method in Pair to check for elements being
an array, then checking the underlying elements.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message