Hashtable.Entry.hashCode() no longer conforms to Map.Entry.hashCode()

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 8
    • Affects Version/s: 7-pool, 8
    • Component/s: core-libs

        Neil Richards <neil.richards@ngmr.net> reports:

        I notice that the behaviour of java.util.Hashtable.Entry.hashCode() no
        longer conforms to the defined behaviour (in the Java API Javadoc [1])
        for java.util.Map.Entry.hashCode() implementations.

        The code in Hashtable.Entry.hashCode() assumes that the value in
        Hashtable.Entry.hash will always be the same as that for
        Hashtable.Entry.getKey().hashCode() .

        However, since Java bug 7126277 (Alternative String hashing
        implementation), the use of Hashtable.hashSeed, a randomizing factor,
        has been introduced into the calculation of Hashtable.hash().

        It is the result from Hashtable.hash() which ends up stored in the
        Hashtable.Entry.hash field.

        So the assumption made in Hashtable.Entry.hashCode() is no longer valid,
        and the code needs to be corrected, so that it once more complies with
        the Java API defined behaviour.

              Assignee:
              Mike Duigou
              Reporter:
              Mike Duigou
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: