harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Beyer (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (HARMONY-403) HashMap hashcode ignores values in entries
Date Mon, 03 Jul 2006 20:50:30 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-403?page=all ]
Nathan Beyer resolved HARMONY-403:

    Resolution: Fixed

I've applied the patch at r418844, plus an additional fix. The patch hashCode calculation
didn't completely fix the problem; the test case still failed. The problem seemed to be that
the 'put' didn't instantiate an Entry correctly on the new key case; it wasn't passing the
value to the Entry constructor, so the value was always missed.

Let me know if this resolves the issue properly. Thanks.

> HashMap hashcode ignores values in entries
> ------------------------------------------
>          Key: HARMONY-403
>          URL: http://issues.apache.org/jira/browse/HARMONY-403
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Mark Hindess
>     Assignee: Nathan Beyer
>     Priority: Minor
>  Attachments: fix.hashmap.hashcode.diff, hashmap.hashcodes.should.differ.diff
> While it is obviously trivial to create different HashMaps with identical hashCodes,
I'd still expect the following test code to pass:
>   HashMap map1 = new HashMap(10);
>   HashMap map2 = new HashMap(10);
>   map1.put("key", "1");
>   map2.put("key", "2");
>   assertFalse(map1.hashCode() == map2.hashCode());
> That is, I'd expect the 'value' associated with "key" to have some impact on the hashCode.
 It passes on the reference implementations I tested.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message