You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Jihad Abdul-Latif (JIRA)" <ji...@apache.org> on 2007/12/04 17:49:43 UTC
[jira] Updated: (AXIS2-3386) i ran findbugs over the cobra's source
code and its suggest that Class defines equals() and uses Object.hashCode()
[ https://issues.apache.org/jira/browse/AXIS2-3386?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jihad Abdul-Latif updated AXIS2-3386:
-------------------------------------
Attachment: screenshot-1.jpg
the fix is under the equals method
> 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
> Attachments: screenshot-1.jpg
>
>
> 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). 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