CDV ❯ ConcurrentHashMapKeySetWrapper should implement equals
-
Bug
-
Status: Closed
-
2 Major
-
Resolution: Fixed
-
-
-
cdennis
-
Reporter: visionlink
-
February 21, 2011
-
1
-
Watchers: 2
-
July 27, 2012
-
April 22, 2011
Description
under DSO mode, i should be able to do this:
x = new ConcurrentHashMap(); x.put(“abc”, “def”); x.put(“ghi”, “jkl”);
y = new ConcurrentHashMap(); y.put(“abc”, “def”); y.put(“ghi”, “jkl”);
assert x.keySet().equals(y.keySet());
however, this doesn’t work since ConcurrentHashMapKeySetWrapper doesn’t forward “equals” to the realKeySet.
Comments
Fiona OShea 2011-03-22
Tim Eck 2011-03-23
we’d probably want to explore these wrappers in all the jdk collections we’re involved with.
If we’re delegating equals() I’d think hashcode should maybe too.
toString(), clone(), etc are also maybe candidate?
Chris Dennis 2011-04-22
I’ve added test coverage to GenericMapTest for equals and hashCode in keySet() and entrySet(), and fixed the exposed bugs in CHM and Hashtable. For the moment I have left the issue of clone() and toString() alone. If there is interest in fixing these too then I suggest that we file a new JIRA.
If easy go ahead for Ulloa.