Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-627

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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • Patch Needed
    • lang.*
    • None

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              sparkspit Sean Mickey
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 8h
                  8h
                  Remaining:
                  Remaining Estimate - 8h
                  8h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified