Closed GoogleCodeExporter closed 9 years ago
Thanks for pointing that out this issue.
You mentioned http://code.google.com/p/google-collections/issues/detail?id=72,
which
calls for removing the ReferenceMap constructor that takes an arbitrary backing
map.
Once we do that, this problem will go away.
Besides, it's not clear how often people would want to serialize a ReferenceMap,
since soft and weak references in a deserialized map wouldn't be that useful.
Original comment by jared.l....@gmail.com
on 17 Oct 2008 at 12:51
Yes, removing that constructor would be ideal.
Should ReferenceMap even be "Serializable" given how odd it would be to
serialize
one? Is it only serializable for the case of 'STRONG' keys with 'STRONG'
values? Or
as a convenience for when it would otherwise have to be a transient field in
some
other class?
Original comment by pline...@gmail.com
on 21 Oct 2008 at 1:19
As I understand it, the main reason for making ReferenceMap serializable is so
frameworks, like servlets, that require serializability can use it. Perhaps
someone
who's more familiar with that code could provide more insight.
Original comment by jared.l....@gmail.com
on 21 Oct 2008 at 1:27
I modified ReferenceMap so serialization throws an
UnsupportedOperationException when
the instance has a custom backing map. A noisy failure is better than surprising
behavior.
Original comment by jared.l....@gmail.com
on 24 Oct 2008 at 12:28
Agreed. That's great!
Original comment by pline...@gmail.com
on 25 Oct 2008 at 2:51
Original comment by kevin...@gmail.com
on 29 Dec 2008 at 8:41
Original issue reported on code.google.com by
pline...@gmail.com
on 17 Oct 2008 at 12:27