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

Collections framework lacks identity-based collections

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.3.0
    • core-libs
    • None
    • beta
    • generic
    • generic
    • Verified

      All of our collections in the Collections Framework are defined in terms of
      element equality rather than element identity. Most of the time this is
      exactly what one wants, but occasionally, it isn't. To do topology-preserving
      object graph transformations (such as serialization) you need to maintain an
      identity-based "node table." Identity-based maps are also used to maintain
      object-to-meta-information mappings in dynamic debuggers and similar systems.
      Finally, identity-based Maps are useful in thwarting "spoof attacks" resulting
      from intentionally perverse equals methods (cf. 4253756). An added benefit of
      identity-based sets and maps is that they run substantially faster than their
      normal (equality-based) counterparts (2x in early testing).

            jjb Josh Bloch (Inactive)
            jjb Josh Bloch (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: