[concurrency-interest] COWList snapshot.
martinrb at google.com
Wed Feb 19 15:22:07 EST 2014
On Wed, Feb 19, 2014 at 12:08 PM, Zhong Yu <zhong.j.yu at gmail.com> wrote:
> On Wed, Feb 19, 2014 at 1:55 PM, Martin Buchholz <martinrb at google.com>
> > Владимир,
> > I agree that a snapshot method as you propose would be useful. As
> > implementing the List interface ends up being rather a lot of tedious
> > which may be a reason it never got done.
> Interestingly, JDK doesn't not seem to have a method to wrap an array
> as a read-only list. A lot of people use Arrays.asList(), which is
It's probably a matter of trust. If you implemented ImmutableArrayList
with a constructor that took an Object, you would need to trust whoever
handed you the array, or make a copy.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Concurrency-interest