Closed GoogleCodeExporter closed 9 years ago
In general, you *cannot* guarantee that an ImmutableMap<K, ImmutableSet<V>> can
be safely wrapped as an ImmutableSetMultimap, due to the specific case of empty
value sets.
What might be doable -- though it would convolute the implementation
significantly -- would be to make e.g. ImmutableSetMultimap.Builder smarter
about recognizing in put(K, Iterable<? extends V>) when the value collection is
already immutable and no other values are added for that key.
Original comment by wasserman.louis
on 16 Mar 2013 at 3:52
That said, do you have empirical data suggesting that this is actually a
performance bottleneck for your application?
Original comment by wasserman.louis
on 16 Mar 2013 at 3:53
No, this is definitely not a performance bottleneck. I only opened the issue
because I thought it would be a quick fix but as your comment indicates there
is more to it than simply wrapping existing immutable collections. (I'm also
now seeing that the size of the Multimap would have to be calculated by
iterating over the wrapped Map's entries.)
I don't believe this is worth fixing if it complicates the implementation.
Thanks for the reply, the Guava APIs are a delight to use!
Original comment by ori.schw...@gmail.com
on 16 Mar 2013 at 3:17
Original comment by kevinb@google.com
on 8 Apr 2013 at 7:00
This issue has been migrated to GitHub.
It can be found at https://github.com/google/guava/issues/<issue id>
Original comment by cgdecker@google.com
on 1 Nov 2014 at 4:12
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
ori.schw...@gmail.com
on 15 Mar 2013 at 3:45