[
https://jira.codehaus.org/browse/QDOX-236?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=275822#comment-275822
]
Robert Scholte commented on QDOX-236:
-------------------------------------
I'll review alle hashcodes, but I don't want to depend on commons-lang just for
this.
Right now QDox has zero compile-time dependencies and I'd like to keep it that
way.
But hashCodes which could result in {{0}} are indeed wrong.
> HashCode is invalid
> -------------------
>
> Key: QDOX-236
> URL: https://jira.codehaus.org/browse/QDOX-236
> Project: QDox
> Issue Type: Bug
> Components: Java API
> Affects Versions: 1.12
> Reporter: Lars K. W. Gohlke
>
> at least in class JavaMethod
> {code}
> public int hashCode() {
> int hashCode = name.hashCode();
> if (returns != null) hashCode *= returns.hashCode();
> hashCode *= getParameters().length;
> return hashCode;
> }
> {code}
> when parameter.set has zero length, hashcode turns to be zero as well
> this affects usage in Maps
> improvement would be to use:
> http://commons.apache.org/lang/api-2.4/org/apache/commons/lang/builder/HashCodeBuilder.html
> this could be also wrong in other classes
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email