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.64 by jsr166, Sun May 28 23:36:29 2006 UTC vs.
Revision 1.65 by jsr166, Mon May 21 20:49:41 2007 UTC

# Line 985 | Line 985 | public class CopyOnWriteArrayList<E>
985          }
986  
987          public E next() {
988 <            try {
989 <                return (E)(snapshot[cursor++]);
990 <            } catch (IndexOutOfBoundsException ex) {
988 >            if (! hasNext())
989                  throw new NoSuchElementException();
990 <            }
990 >            return (E) snapshot[cursor++];
991          }
992  
993          public E previous() {
994 <            try {
997 <                return (E)(snapshot[--cursor]);
998 <            } catch (IndexOutOfBoundsException e) {
994 >            if (! hasPrevious())
995                  throw new NoSuchElementException();
996 <            }
996 >            return (E) snapshot[--cursor];
997          }
998  
999          public int nextIndex() {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines