[
https://issues.apache.org/jira/browse/HBASE-12413?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14381806#comment-14381806
]
Gabriel Reid commented on HBASE-12413:
--------------------------------------
[~tedyu] if this change is incompatible (i.e. if it breaks anything), I would
assume that it is just making it more clear that that thing was broken anyhow.
The case I'm imagining is that KeyValues are being put into a HashSet or used
as keys in a HashMap -- in this case, the current (unpatched) behavior would be
non-determinsitic, but may appear to "work" in many cases (i.e. the fact that
the client code is broken might not be immediately visible).
I think that committing this can only be a good thing -- I think that the worst
case is that it would make it more clear that already-broken code is actually
broken.
> Mismatch in the equals and hashcode methods of KeyValue
> -------------------------------------------------------
>
> Key: HBASE-12413
> URL: https://issues.apache.org/jira/browse/HBASE-12413
> Project: HBase
> Issue Type: Bug
> Reporter: Jingcheng Du
> Assignee: Jingcheng Du
> Priority: Minor
> Attachments: HBASE-12413-V2.diff, HBASE-12413.diff
>
>
> In the equals method of KeyValue only row key is compared, and in the
> hashcode method all bacing bytes are calculated. This breaks the Java rule.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)