[concurrency-interest] subList, subMap and navigable
stanimir at riflexo.com
Mon Jul 23 10:27:40 EDT 2012
It looks subMaps returned by the implementers of SortedMap are serializable
as rule of the thumb. All subLists returned by COWArrayList, ArrayList,
LinkedList, etc are not. The latter is a major issue with RPC since if
methods accept just java.util.List it'd be excepted to work remotely just
as they work in the same JVM. In our case it was rarely a subList to be
serialized, so it was not caught early on.
The behavior clearly favors SortedMap for unknown reason, Maps can be just
as big or even bigger than Lists (List can have more than 2^31 elementes or
all get/set, ListIterator fail)
While I realize it's an official bug:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4782922 I do not quite
understand the closing reason - writeReplace is always an option to
minimize serialization footprint. Also SortedMaps (like TreeMap) do not
even try to optimize that.
Is there any objective reason the bug/RFE to still be considered "closed,
will not implemented" [as COW follows the same path]?
Another question, based mostly on curiosity. Was NavigableSet/Map
introduced in JDK1.6 to mostly accommodate the CSLM or if was fixing
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Concurrency-interest