Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8C86E117DD for ; Thu, 3 Jul 2014 22:00:35 +0000 (UTC) Received: (qmail 27671 invoked by uid 500); 3 Jul 2014 22:00:35 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 27612 invoked by uid 500); 3 Jul 2014 22:00:35 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 27598 invoked by uid 99); 3 Jul 2014 22:00:35 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jul 2014 22:00:35 +0000 Date: Thu, 3 Jul 2014 22:00:35 +0000 (UTC) From: "stack (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-11463) (findbugs) HE: Class defines equals() and uses Object.hashCode() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HBASE-11463?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14051958#comment-14051958 ] stack commented on HBASE-11463: ------------------------------- bq. 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. Yes. I suppose it could surprise (looking at the classes, unlikely, but hey.. if it were likely, it wouldn't be a surprise). Any chance of adding in simple equals test for the types you've fixed? > (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)