Commit d528ed6e authored by Jesse Wilson's avatar Jesse Wilson
Browse files

Fix various issues in CopyOnWriteArrayList discovered by Google Collections' test suite:

Fixed CopyOnWriteArrayList problems:
- addAll() doesn't return true if the collection is empty
- clear() fails on an empty list
- containsAll() doesn't return true if the collection is empty
- subList() fails on an empty range
- subList() doesn't implement equals(), hashCode() or toString()

Fixed CopyOnWriteArraySet problems:
- addAll() adds duplicates if the added collection contains duplicates
- equals() throws NullPointerException if this is empty

The following issues aren't fixed:
- the iterator throws UnsupportedOperationException when it should throw
  IllegalStateException
- sublists don't reflect non-structural changes in the underlying list

http://b/3270784
Change-Id: I8c174e4ceda1ff964e2ad8224fa7338dac552288
parent f2ea6987
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment