Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4429536

(coll) WeakHashMap limitation: values refer to keys

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 1.3.0
    • core-libs



      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)
      ======================================================================

            mr Mark Reinhold
            bonealsunw Bret O'neal (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: