-
Enhancement
-
Resolution: Fixed
-
P4
-
1.3.0
-
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).
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).