You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Henri Yandell (JIRA)" <ji...@apache.org> on 2010/07/20 20:31:49 UTC

[jira] Commented: (LANG-411) HashCodeBuilder: expose typed hashing methods

    [ https://issues.apache.org/jira/browse/LANG-411?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12890375#action_12890375 ] 

Henri Yandell commented on LANG-411:
------------------------------------

Thanks Sean.

I don't think ObjectUtils should have state, i.e. static setXyz methods aren't desirable. 

It seems to me that the ObjectUtils API needs to be:

+    public static int hashBooleanArray(int currentHash, int multiplier, Boolean[] boolArray)

Putting the target on the end means we could consider using varargs in the API.

> HashCodeBuilder: expose typed hashing methods
> ---------------------------------------------
>
>                 Key: LANG-411
>                 URL: https://issues.apache.org/jira/browse/LANG-411
>             Project: Commons Lang
>          Issue Type: Wish
>          Components: lang.builder.*
>    Affects Versions: 2.3
>            Reporter: Paul Benedict
>            Priority: Minor
>             Fix For: 3.1
>
>         Attachments: ObjectUtils-Patch-Addresses-LANG-411-and-LANG-627.txt, ObjectUtilsTest-Patch-Adds-Tests-For-Changes-To-Address-LANG-411-and-LANG-627.txt
>
>
> HashCodeBuilder encapsulates the good advice of Joshua Bloch. He details how each java.lang type should be hashed. I want to use those too ... but without reflection. Please expose those as static methods:
> hashInt, hashBoolean, etc.
> They should take two parameters: the field value, and the hash multiplier value.

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