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). 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]