You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Michael Sean Mickey (JIRA)" <ji...@apache.org> on 2010/06/24 18:06:50 UTC

[jira] Created: (LANG-627) Include a way to explicitly define a hash constant for each primitive type, along with the functionality described in LANG-411

Include a way to explicitly define a hash constant for each primitive type, along with the functionality described in LANG-411
------------------------------------------------------------------------------------------------------------------------------

                 Key: LANG-627
                 URL: https://issues.apache.org/jira/browse/LANG-627
             Project: Commons Lang
          Issue Type: Improvement
          Components: lang.*
    Affects Versions: 3.0
            Reporter: Michael Sean Mickey
            Priority: Minor


Regarding LANG-411, the description mentions 2 parameters for each hash operation: the first a parameter to hold the type instance to be hashed, the second a hash multiplier.

Shouldn't there also be a way to define a specific hash constant value as well? Joshua Bloch refers to this value as the starting value for "result" in his examples and the HashCodeBuilder code maintains an internal field named: iTotal for this value. It doesn't seem to make sense to add a parameter to the hashing operations for a starting hash constant value, but it probably makes sense to add mutators that allow setting this value across any given type. For example: setIntHashConstant, setBoolHashConstant, setLongHashConstant, etc. Default values could be defined so that explicit hash constants are not required.

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


[jira] Updated: (LANG-627) Include a way to explicitly define a hash constant for each primitive type, along with the functionality described in LANG-411

Posted by "Sean Mickey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-627?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sean Mickey updated LANG-627:
-----------------------------

    Affects Version/s: 3.1
                           (was: 3.0)

> Include a way to explicitly define a hash constant for each primitive type, along with the functionality described in LANG-411
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: LANG-627
>                 URL: https://issues.apache.org/jira/browse/LANG-627
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>    Affects Versions: 3.1
>            Reporter: Sean Mickey
>            Priority: Minor
>   Original Estimate: 8h
>  Remaining Estimate: 8h
>
> Regarding LANG-411, the description mentions 2 parameters for each hash operation: the first a parameter to hold the type instance to be hashed, the second a hash multiplier.
> Shouldn't there also be a way to define a specific hash constant value as well? Joshua Bloch refers to this value as the starting value for "result" in his examples and the HashCodeBuilder code maintains an internal field named: iTotal for this value. It doesn't seem to make sense to add a parameter to the hashing operations for a starting hash constant value, but it probably makes sense to add mutators that allow setting this value across any given type. For example: setIntHashConstant, setBoolHashConstant, setLongHashConstant, etc. Default values could be defined so that explicit hash constants are not required.

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