You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ambari.apache.org by "Tamas Payer (Jira)" <ji...@apache.org> on 2021/03/25 12:12:00 UTC

[jira] [Created] (AMBARI-25638) FindBugs: Class defines equals() and uses Object.hashCode()

Tamas Payer created AMBARI-25638:
------------------------------------

             Summary: FindBugs: Class defines equals() and uses Object.hashCode()
                 Key: AMBARI-25638
                 URL: https://issues.apache.org/jira/browse/AMBARI-25638
             Project: Ambari
          Issue Type: Bug
          Components: ambari-server
    Affects Versions: 2.7.3, 2.7.4, 2.7.5
            Reporter: Tamas Payer
            Assignee: Tamas Payer
             Fix For: 2.7.6


FindBugs finding:
org.apache.ambari.server.state.alert.MetricSource$JmxInfo defines equals and uses Object.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.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)