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

Mike Drob commented on HBASE-11463:
-----------------------------------

Well, in an ideal world, we could wire up something like QuickCheck and assert 
that all instances that all equal instances have equal hash codes, but that's 
likely too much for something like this. Just a reminder that without adding 
more tests, it places burden on the developers to be more vigilant in the 
future about what changing the equality contract means.

> (findbugs) HE: Class defines equals() and uses Object.hashCode()
> ----------------------------------------------------------------
>
>                 Key: HBASE-11463
>                 URL: https://issues.apache.org/jira/browse/HBASE-11463
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Mike Drob
>            Priority: Trivial
>              Labels: findbugs
>         Attachments: HBASE-11463.patch.txt
>
>
> Findbugs warns that several classes define {{equals}} but not {{hashcode}}:
> {noformat}
> HE: Class defines equals() and uses Object.hashCode() (HE_EQUALS_USE_HASHCODE)
> This class overrides equals(Object), but does not override hashCode(), and 
> inherits the implementation of hashCode() from java.lang.Object (which 
> returns the identity hash code, an arbitrary value assigned to the object by 
> the VM).  Therefore, the class is very likely to violate the invariant that 
> equal objects must have equal hashcodes.
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to