hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Drob (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HBASE-11463) (findbugs) HE: Class defines equals() and uses Object.hashCode()
Date Thu, 03 Jul 2014 21:20:33 GMT

     [ https://issues.apache.org/jira/browse/HBASE-11463?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Mike Drob updated HBASE-11463:

    Attachment: HBASE-11463.patch.txt

Patch attached that implements several {{hashCode()}} methods to be consistent with existing
{{equals()}} and {{compareTo()}} implementations.

Most of these classes did not have explicit tests for equality, so I'm not sure what y'all
would like to see in terms of additional testing.

> (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

View raw message