[concurrency-interest] need to use collection.sort w. CopyOnWriteArrayList but cant.....
Tue, 1 Jun 2004 07:42:40 -0400
> i need ot add sort capability and tried doing it through the
> Collections.sort but this fails cause the sort method eventually calls the
> set method on the list iterator and this is not supported in the
> do i have alternatives?
You could use something like (omitting any generic types you might be
Object array = list.toArray();
This is not too fast, but at least makes only two full copies
per sort rather than a copy per element change.