-
Enhancement
-
Resolution: Unresolved
-
P4
-
8-pool
-
None
The Set interface does not have a get() method. This method is useful for interning. The current workaround is to use a Map and each entry has the key and value as the same object. This wastes memory for the reference in each entry.
The tricky question is what should the default implementation do. Should it throw UnsupportedOperationException? Maybe we don't want to add the get() method to the Set interface. Maybe we want to add the get() method to HashSet and perhaps the other classes which implement the Set interface.
The tricky question is what should the default implementation do. Should it throw UnsupportedOperationException? Maybe we don't want to add the get() method to the Set interface. Maybe we want to add the get() method to HashSet and perhaps the other classes which implement the Set interface.
- relates to
-
JDK-6624565 (coll) Reduce HashSet bloat
- Open
-
JDK-4887309 Add method "Set.get(Object o)"
- Closed