JDK-4479578 : (coll) Add an IdentityHashSet to go with IdentityHashMap
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.util:collections
  • Affected Version: 1.4.0
  • Priority: P5
  • Status: Closed
  • Resolution: Won't Fix
  • OS: generic
  • CPU: generic
  • Submitted: 2001-07-13
  • Updated: 2012-10-08
  • Resolved: 2010-12-28
Description
Name: bsC130419			Date: 07/13/2001


I don't have JDK 1.4 installed; I've just been reading the list of changes.

I'm very happy that you have added IdentityHashMap but a corresponding
IdentityHashSet would be nice.
(Review ID: 128053) 
======================================================================

Comments
PUBLIC COMMENTS From 1.6, an identity hash set can be created by Collections.newSetFromMap(new IdentityHashMap()).
28-12-2010

WORK AROUND From 1.6, an identity hash set can be created by Collections.newSetFromMap(new IdentityHashMap()).
08-09-2004

EVALUATION It is not clear to me what such a class would be used for. The absence of this class represents a conscious omission on the part of the designers. If it is needed only rarely, then the second suggested workaround (DIY atop IdentityHashMap) is sufficient. If the need is more common, then we should add the class. I'm leaving this RFE open to track demand for this feature. If anyone has a compelling use-case, please add it to this RFE. joshua.bloch@Eng 2001-07-17
17-07-2001