Closed GoogleCodeExporter closed 9 years ago
From what I can tell, I'm pretty sure that
private <T> ImmutableSet<T> fixImmutableSet(final ImmutableSet<T> set) {
return ImmutableSet.copyOf(set);
}
will actually work just fine here. The keySet of an ImmutableMap is marked as
a "partial view," and will actually get a full copy, but the "pure"
ImmutableSet implementations -- including Empty, Singleton, and Regular, as
you've mentioned -- will be passed through without being copied.
Original comment by lowas...@google.com
on 12 Sep 2012 at 3:56
I have the vague feeling that I'm forgetting something, but this seems wrong to
me. For a *mutable* collection, there's no good answer to whether serializing
a view should serialize the whole backing data or not, and that's a large part
of the reason why virtually none of our mutable collection views are
serializable. But here? I can't think of any advantage to serializing the whole
backing map. Serializing the key set ought to serialize only the keys and when
you deserialize it you get a RegularImmutableSet out the other end. Am I
missing something?
Original comment by kevinb@google.com
on 12 Sep 2012 at 10:06
This issue has been migrated to GitHub.
It can be found at https://github.com/google/guava/issues/<id>
Original comment by cgdecker@google.com
on 1 Nov 2014 at 4:13
Original comment by cgdecker@google.com
on 1 Nov 2014 at 4:18
Original comment by cgdecker@google.com
on 3 Nov 2014 at 9:08
Original issue reported on code.google.com by
wes...@cutterslade.ca
on 12 Sep 2012 at 3:26