JDK-4429536 : (coll) WeakHashMap limitation: values refer to keys
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.util:collections
  • Affected Version: 1.3.0
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: generic
  • CPU: generic
  • Submitted: 2001-03-23
  • Updated: 2012-10-08
Related Reports
Relates :  
Relates :  
Relates :  

Name: boT120536			Date: 03/23/2001

java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

The WeakHashMap is documented as having a minor defect. When values refer to
their own keys, the keys are strongly referenced, defeating the purpose of the
WeakHashMap. I have been burned by this on several occasions. I wasn't aware
that the values were indirectly referencing the keys.

Although the docs indicate that this defect might be fixed in a future release,
it would be nice if an official report was in the bug parade. I'd also like to
know if anyone has any ideas on how this defect can be fixed. I've been studing
the references API, and I can't see any solution.
(Review ID: 119340) 

EVALUATION This will be fixed if/when 4630118 is fixed. -- ###@###.### 2002/12/16