ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/CopyOnWriteArrayList.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/CopyOnWriteArrayList.java (file contents):
Revision 1.106 by dl, Mon May 6 15:52:59 2013 UTC vs.
Revision 1.107 by jsr166, Mon May 6 18:50:41 2013 UTC

# Line 917 | Line 917 | public class CopyOnWriteArrayList<E>
917      }
918  
919      public void sort(Comparator<? super E> c) {
920 <         final ReentrantLock lock = this.lock;
921 <         lock.lock();
922 <         try {
923 <             Object[] elements = getArray();
924 <             Object[] newElements = Arrays.copyOf(elements, elements.length);
925 <             @SuppressWarnings("unchecked") E[] es = (E[])newElements;
926 <             Arrays.sort(es, c);
927 <             setArray(newElements);
920 >        final ReentrantLock lock = this.lock;
921 >        lock.lock();
922 >        try {
923 >            Object[] elements = getArray();
924 >            Object[] newElements = Arrays.copyOf(elements, elements.length);
925 >            @SuppressWarnings("unchecked") E[] es = (E[])newElements;
926 >            Arrays.sort(es, c);
927 >            setArray(newElements);
928          } finally {
929              lock.unlock();
930          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines