axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jihad Abdul-Latif (JIRA)" <j...@apache.org>
Subject [jira] Created: (AXIS2-3386) i ran findbugs over the cobra's source code and its suggest that Class defines equals() and uses Object.hashCode()
Date Tue, 04 Dec 2007 16:47:43 GMT
i ran findbugs over the cobra's source code and its suggest that Class defines equals() and
uses Object.hashCode()
------------------------------------------------------------------------------------------------------------------

                 Key: AXIS2-3386
                 URL: https://issues.apache.org/jira/browse/AXIS2-3386
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
    Affects Versions: nightly
         Environment: WindowsXP, eclispe
            Reporter: Jihad Abdul-Latif


i ran findbugs over the cobra's source code and 
here is the bug message



Class defines equals() and uses Object.hashCode()</b><br/><p> This class
overrides <code>equals(Object)</code>, but does not  override <code>hashCode()</code>,
and inherits the implementation of
  <code>hashCode()</code> from <code>java.lang.Object</code> (which
returns
  the identity hash code, an arbitrary value assigned to the object
  by the VM).&nbsp; Therefore, the class is very likely to violate the
  invariant that equal objects must have equal hashcodes.

and here is the fix

public int hashCode() {
      assert false : "hashCode not designed";
      return 42; // any arbitrary constant will do 
      }


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Mime
View raw message