[ 
https://jira.codehaus.org/browse/QDOX-236?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=275821#comment-275821
 ] 

Lars K. W. Gohlke commented on QDOX-236:
----------------------------------------

{code}
public int hashCode() { 
    int hashCode = name.hashCode(); 
    if (returns != null) 
         hashCode *= returns.hashCode(); 
    hashCode *= getParameters().length; 
    return hashCode; 
}
{code}

> 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


Reply via email to