ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/jsr166e/extra/ReadMostlyVector.java
(Generate patch)

Comparing jsr166/src/jsr166e/extra/ReadMostlyVector.java (file contents):
Revision 1.13 by jsr166, Fri Aug 5 17:08:04 2011 UTC vs.
Revision 1.14 by jsr166, Sun Dec 4 01:25:16 2011 UTC

# Line 32 | Line 32 | import java.util.*;
32   *
33   * @author Doug Lea
34   */
35 < public class ReadMostlyVector<E> implements List<E>, RandomAccess, Cloneable, java.io.Serializable {
35 > public class ReadMostlyVector<E>
36 >        implements List<E>, RandomAccess, Cloneable, java.io.Serializable {
37      private static final long serialVersionUID = 8673264195747942595L;
38  
39      /*
# Line 199 | Line 200 | public class ReadMostlyVector<E> impleme
200          return -1;
201      }
202  
203 <    final void rawAdd(Object e) {
203 >    final void rawAdd(E e) {
204          int n = count;
205          Object[] items = array;
206          if (n >= items.length)
# Line 208 | Line 209 | public class ReadMostlyVector<E> impleme
209          count = n + 1;
210      }
211  
212 <    final void rawAddAt(int index, Object e) {
212 >    final void rawAddAt(int index, E e) {
213          int n = count;
214          Object[] items = array;
215          if (index > n)
# Line 261 | Line 262 | public class ReadMostlyVector<E> impleme
262       * field under lock.
263       */
264      final boolean internalRemoveAll(Collection<?> c, int origin, int bound) {
265 <        SequenceLock lock = this.lock;
265 >        final SequenceLock lock = this.lock;
266          boolean removed = false;
267          lock.lock();
268          try {
# Line 280 | Line 281 | public class ReadMostlyVector<E> impleme
281      }
282  
283      final boolean internalRetainAll(Collection<?> c, int origin, int bound) {
284 <        SequenceLock lock = this.lock;
284 >        final SequenceLock lock = this.lock;
285          boolean removed = false;
286          if (c != this) {
287              lock.lock();
# Line 327 | Line 328 | public class ReadMostlyVector<E> impleme
328      }
329  
330      final boolean internalContainsAll(Collection<?> c, int origin, int bound) {
331 <        SequenceLock lock = this.lock;
331 >        final SequenceLock lock = this.lock;
332          boolean contained;
333          boolean locked = false;
334          try {
# Line 367 | Line 368 | public class ReadMostlyVector<E> impleme
368      }
369  
370      final boolean internalEquals(List<?> list, int origin, int bound) {
371 <        SequenceLock lock = this.lock;
371 >        final SequenceLock lock = this.lock;
372          boolean locked = false;
373          boolean equal;
374          try {
# Line 408 | Line 409 | public class ReadMostlyVector<E> impleme
409      }
410  
411      final int internalHashCode(int origin, int bound) {
412 <        SequenceLock lock = this.lock;
412 >        final SequenceLock lock = this.lock;
413          int hash;
414          boolean locked = false;
415          try {
# Line 440 | Line 441 | public class ReadMostlyVector<E> impleme
441      }
442  
443      final String internalToString(int origin, int bound) {
444 <        SequenceLock lock = this.lock;
444 >        final SequenceLock lock = this.lock;
445          String ret;
446          boolean locked = false;
447          try {
# Line 487 | Line 488 | public class ReadMostlyVector<E> impleme
488  
489      final Object[] internalToArray(int origin, int bound) {
490          Object[] result;
491 <        SequenceLock lock = this.lock;
491 >        final SequenceLock lock = this.lock;
492          boolean locked = false;
493          try {
494              for (;;) {
# Line 514 | Line 515 | public class ReadMostlyVector<E> impleme
515          return result;
516      }
517  
518 +    @SuppressWarnings("unchecked")
519      final <T> T[] internalToArray(T[] a, int origin, int bound) {
520          int alen = a.length;
521          T[] result;
522 <        SequenceLock lock = this.lock;
522 >        final SequenceLock lock = this.lock;
523          boolean locked = false;
524          try {
525              for (;;) {
# Line 556 | Line 558 | public class ReadMostlyVector<E> impleme
558      // public List methods
559  
560      public boolean add(E e) {
561 <        SequenceLock lock = this.lock;
561 >        final SequenceLock lock = this.lock;
562          lock.lock();
563          try {
564              rawAdd(e);
# Line 567 | Line 569 | public class ReadMostlyVector<E> impleme
569      }
570  
571      public void add(int index, E element) {
572 <        SequenceLock lock = this.lock;
572 >        final SequenceLock lock = this.lock;
573          lock.lock();
574          try {
575              rawAddAt(index, element);
# Line 581 | Line 583 | public class ReadMostlyVector<E> impleme
583          int len = elements.length;
584          if (len == 0)
585              return false;
586 <        SequenceLock lock = this.lock;
586 >        final SequenceLock lock = this.lock;
587          lock.lock();
588          try {
589              Object[] items = array;
# Line 598 | Line 600 | public class ReadMostlyVector<E> impleme
600      }
601  
602      public boolean addAll(int index, Collection<? extends E> c) {
603 <        SequenceLock lock = this.lock;
603 >        final SequenceLock lock = this.lock;
604          boolean ret;
605          Object[] elements = c.toArray();
606          lock.lock();
# Line 611 | Line 613 | public class ReadMostlyVector<E> impleme
613      }
614  
615      public void clear() {
616 <        SequenceLock lock = this.lock;
616 >        final SequenceLock lock = this.lock;
617          lock.lock();
618          try {
619              int n = count;
# Line 641 | Line 643 | public class ReadMostlyVector<E> impleme
643      }
644  
645      public E get(int index) {
646 <        SequenceLock lock = this.lock;
646 >        final SequenceLock lock = this.lock;
647          for (;;) {
648              long seq = lock.awaitAvailability();
649              int n = count;
650              Object[] items = array;
651              if (n > items.length)
652                  continue;
653 <            Object e; boolean ex;
654 <            if (index < 0 || index >= n) {
655 <                e = null;
654 <                ex = true;
655 <            }
656 <            else {
657 <                e = items[index];
658 <                ex = false;
659 <            }
653 >            boolean outOfBounds = (index < 0 || index >= n);
654 >            @SuppressWarnings("unchecked")
655 >            E e = outOfBounds ? null : (E) items[index];
656              if (lock.getSequence() == seq) {
657 <                if (ex)
657 >                if (outOfBounds)
658                      throw new ArrayIndexOutOfBoundsException(index);
659                  else
660 <                    return (E)e;
660 >                    return e;
661              }
662          }
663      }
# Line 671 | Line 667 | public class ReadMostlyVector<E> impleme
667      }
668  
669      public int indexOf(Object o) {
670 <        SequenceLock lock = this.lock;
670 >        final SequenceLock lock = this.lock;
671          for (;;) {
672              long seq = lock.awaitAvailability();
673              Object[] items = array;
# Line 704 | Line 700 | public class ReadMostlyVector<E> impleme
700      }
701  
702      public int lastIndexOf(Object o) {
703 <        SequenceLock lock = this.lock;
703 >        final SequenceLock lock = this.lock;
704          for (;;) {
705              long seq = lock.awaitAvailability();
706              Object[] items = array;
# Line 737 | Line 733 | public class ReadMostlyVector<E> impleme
733      }
734  
735      public E remove(int index) {
736 <        SequenceLock lock = this.lock;
741 <        Object oldValue;
736 >        final SequenceLock lock = this.lock;
737          lock.lock();
738          try {
739              if (index < 0 || index >= count)
740                  throw new ArrayIndexOutOfBoundsException(index);
741 <            oldValue = array[index];
741 >            @SuppressWarnings("unchecked")
742 >            E oldValue = (E) array[index];
743              rawRemoveAt(index);
744 +            return oldValue;
745          } finally {
746              lock.unlock();
747          }
751        return (E)oldValue;
748      }
749  
750      public boolean remove(Object o) {
751 <        SequenceLock lock = this.lock;
756 <        boolean removed;
751 >        final SequenceLock lock = this.lock;
752          lock.lock();
753          try {
754 <            removed = rawRemoveAt(rawIndexOf(o, 0, count));
754 >            return rawRemoveAt(rawIndexOf(o, 0, count));
755          } finally {
756              lock.unlock();
757          }
763        return removed;
758      }
759  
760      public boolean removeAll(Collection<?> c) {
# Line 772 | Line 766 | public class ReadMostlyVector<E> impleme
766      }
767  
768      public E set(int index, E element) {
769 <        Object oldValue;
776 <        SequenceLock lock = this.lock;
769 >        final SequenceLock lock = this.lock;
770          lock.lock();
771          try {
772              Object[] items = array;
773              if (index < 0 || index >= count)
774                  throw new ArrayIndexOutOfBoundsException(index);
775 <            oldValue = items[index];
775 >            @SuppressWarnings("unchecked")
776 >            E oldValue = (E) items[index];
777              items[index] = element;
778 +            return oldValue;
779          } finally {
780              lock.unlock();
781          }
787        return (E)oldValue;
782      }
783  
784      public int size() {
# Line 820 | Line 814 | public class ReadMostlyVector<E> impleme
814       * @return {@code true} if the element was added
815       */
816      public boolean addIfAbsent(E e) {
817 <        boolean added;
824 <        SequenceLock lock = this.lock;
817 >        final SequenceLock lock = this.lock;
818          lock.lock();
819          try {
820              if (rawIndexOf(e, 0, count) < 0) {
821                  rawAdd(e);
822 <                added = true;
822 >                return true;
823              }
824              else
825 <                added = false;
825 >                return false;
826          } finally {
827              lock.unlock();
828          }
836        return added;
829      }
830  
831      /**
# Line 855 | Line 847 | public class ReadMostlyVector<E> impleme
847              lock.lock();
848              try {
849                  for (int i = 0; i < clen; ++i) {
850 <                    Object e = cs[i];
850 >                    @SuppressWarnings("unchecked")
851 >                    E e = (E) cs[i];
852                      if (rawIndexOf(e, 0, count) < 0) {
853                          rawAdd(e);
854                          ++added;
# Line 881 | Line 874 | public class ReadMostlyVector<E> impleme
874      }
875  
876      static final class SnapshotIterator<E> implements Iterator<E> {
877 <        final Object[] items;
878 <        int cursor;
877 >        private final Object[] items;
878 >        private int cursor;
879          SnapshotIterator(ReadMostlyVector<E> v) { items = v.toArray(); }
880          public boolean hasNext() { return cursor < items.length; }
881 +        @SuppressWarnings("unchecked")
882          public E next() {
883              if (cursor < items.length)
884                  return (E) items[cursor++];
# Line 897 | Line 891 | public class ReadMostlyVector<E> impleme
891  
892      /** See {@link Vector#firstElement} */
893      public E firstElement() {
894 <        SequenceLock lock = this.lock;
894 >        final SequenceLock lock = this.lock;
895          for (;;) {
896              long seq = lock.awaitAvailability();
897              Object[] items = array;
# Line 905 | Line 899 | public class ReadMostlyVector<E> impleme
899              int n = count;
900              if (n > len)
901                  continue;
902 <            Object e; boolean ex;
903 <            if (n > 0) {
904 <                e = items[0];
911 <                ex = false;
912 <            }
913 <            else {
914 <                e = null;
915 <                ex = true;
916 <            }
902 >            boolean empty = (n == 0);
903 >            @SuppressWarnings("unchecked")
904 >            E e = empty ? null : (E) items[0];
905              if (lock.getSequence() == seq) {
906 <                if (ex)
906 >                if (empty)
907                      throw new NoSuchElementException();
908                  else
909 <                    return (E)e;
909 >                    return e;
910              }
911          }
912      }
913  
914      /** See {@link Vector#lastElement} */
915      public E lastElement() {
916 <        SequenceLock lock = this.lock;
916 >        final SequenceLock lock = this.lock;
917          for (;;) {
918              long seq = lock.awaitAvailability();
919              Object[] items = array;
# Line 933 | Line 921 | public class ReadMostlyVector<E> impleme
921              int n = count;
922              if (n > len)
923                  continue;
924 <            Object e; boolean ex;
925 <            if (n > 0) {
926 <                e = items[n - 1];
939 <                ex = false;
940 <            }
941 <            else {
942 <                e = null;
943 <                ex = true;
944 <            }
924 >            boolean empty = (n == 0);
925 >            @SuppressWarnings("unchecked")
926 >            E e = empty ? null : (E) items[n - 1];
927              if (lock.getSequence() == seq) {
928 <                if (ex)
928 >                if (empty)
929                      throw new NoSuchElementException();
930                  else
931 <                    return (E)e;
931 >                    return e;
932              }
933          }
934      }
935  
936      /** See {@link Vector#indexOf(Object, int)} */
937      public int indexOf(Object o, int index) {
938 <        SequenceLock lock = this.lock;
938 >        final SequenceLock lock = this.lock;
939          int idx = 0;
940          boolean ex = false;
941          long seq = lock.awaitAvailability();
# Line 984 | Line 966 | public class ReadMostlyVector<E> impleme
966  
967      /** See {@link Vector#lastIndexOf(Object, int)} */
968      public int lastIndexOf(Object o, int index) {
969 <        SequenceLock lock = this.lock;
969 >        final SequenceLock lock = this.lock;
970          int idx = 0;
971          boolean ex = false;
972          long seq = lock.awaitAvailability();
# Line 1017 | Line 999 | public class ReadMostlyVector<E> impleme
999      public void setSize(int newSize) {
1000          if (newSize < 0)
1001              throw new ArrayIndexOutOfBoundsException(newSize);
1002 <        SequenceLock lock = this.lock;
1002 >        final SequenceLock lock = this.lock;
1003          lock.lock();
1004          try {
1005              int n = count;
# Line 1036 | Line 1018 | public class ReadMostlyVector<E> impleme
1018  
1019      /** See {@link Vector#copyInto} */
1020      public void copyInto(Object[] anArray) {
1021 <        SequenceLock lock = this.lock;
1021 >        final SequenceLock lock = this.lock;
1022          lock.lock();
1023          try {
1024              System.arraycopy(array, 0, anArray, 0, count);
# Line 1047 | Line 1029 | public class ReadMostlyVector<E> impleme
1029  
1030      /** See {@link Vector#trimToSize} */
1031      public void trimToSize() {
1032 <        SequenceLock lock = this.lock;
1032 >        final SequenceLock lock = this.lock;
1033          lock.lock();
1034          try {
1035              Object[] items = array;
# Line 1062 | Line 1044 | public class ReadMostlyVector<E> impleme
1044      /** See {@link Vector#ensureCapacity} */
1045      public void ensureCapacity(int minCapacity) {
1046          if (minCapacity > 0) {
1047 <            SequenceLock lock = this.lock;
1047 >            final SequenceLock lock = this.lock;
1048              lock.lock();
1049              try {
1050                  if (minCapacity - array.length > 0)
# Line 1121 | Line 1103 | public class ReadMostlyVector<E> impleme
1103      // other methods
1104  
1105      public ReadMostlyVector<E> clone() {
1106 <        SequenceLock lock = this.lock;
1106 >        final SequenceLock lock = this.lock;
1107          Object[] a = null;
1108          boolean retry = false;
1109          long seq = lock.awaitAvailability();
# Line 1145 | Line 1127 | public class ReadMostlyVector<E> impleme
1127  
1128      private void writeObject(java.io.ObjectOutputStream s)
1129              throws java.io.IOException {
1130 <        SequenceLock lock = this.lock;
1130 >        final SequenceLock lock = this.lock;
1131          lock.lock();
1132          try {
1133              s.defaultWriteObject();
# Line 1158 | Line 1140 | public class ReadMostlyVector<E> impleme
1140          final ReadMostlyVector<E> list;
1141          final SequenceLock lock;
1142          Object[] items;
1143 <        Object next, prev;
1143 >        E next, prev;
1144          long seq;
1145          int cursor;
1146          int fence;
# Line 1184 | Line 1166 | public class ReadMostlyVector<E> impleme
1166                       lock.getSequence() != seq);
1167          }
1168  
1169 +        @SuppressWarnings("unchecked")
1170          public boolean hasNext() {
1171              boolean valid;
1172              int i = cursor;
# Line 1192 | Line 1175 | public class ReadMostlyVector<E> impleme
1175                      valid = false;
1176                      break;
1177                  }
1178 <                next = items[i];
1178 >                next = (E) items[i];
1179                  if (lock.getSequence() == seq) {
1180                      valid = true;
1181                      break;
# Line 1202 | Line 1185 | public class ReadMostlyVector<E> impleme
1185              return validNext = valid;
1186          }
1187  
1188 +        @SuppressWarnings("unchecked")
1189          public boolean hasPrevious() {
1190              boolean valid;
1191              int i = cursor - 1;
# Line 1210 | Line 1194 | public class ReadMostlyVector<E> impleme
1194                      valid = false;
1195                      break;
1196                  }
1197 <                prev = items[i];
1197 >                prev = (E) items[i];
1198                  if (lock.getSequence() == seq) {
1199                      valid = true;
1200                      break;
# Line 1224 | Line 1208 | public class ReadMostlyVector<E> impleme
1208              if (validNext || hasNext()) {
1209                  validNext = false;
1210                  lastRet = cursor++;
1211 <                return (E) next;
1211 >                return next;
1212              }
1213              throw new NoSuchElementException();
1214          }
# Line 1233 | Line 1217 | public class ReadMostlyVector<E> impleme
1217              if (validPrev || hasPrevious()) {
1218                  validPrev = false;
1219                  lastRet = cursor--;
1220 <                return (E) prev;
1220 >                return prev;
1221              }
1222              throw new NoSuchElementException();
1223          }
# Line 1290 | Line 1274 | public class ReadMostlyVector<E> impleme
1274          public int previousIndex() { return cursor - 1; }
1275      }
1276  
1277 <    static final class ReadMostlyVectorSublist<E> implements List<E>, RandomAccess, java.io.Serializable {
1277 >    static final class ReadMostlyVectorSublist<E>
1278 >            implements List<E>, RandomAccess, java.io.Serializable {
1279 >        static final long serialVersionUID = 3041673470172026059L;
1280 >
1281          final ReadMostlyVector<E> list;
1282          final int offset;
1283          volatile int size;
1284  
1285 <        ReadMostlyVectorSublist(ReadMostlyVector<E> list, int offset, int size) {
1285 >        ReadMostlyVectorSublist(ReadMostlyVector<E> list,
1286 >                                int offset, int size) {
1287              this.list = list;
1288              this.offset = offset;
1289              this.size = size;
# Line 1307 | Line 1295 | public class ReadMostlyVector<E> impleme
1295          }
1296  
1297          public boolean add(E element) {
1298 <            SequenceLock lock = list.lock;
1298 >            final SequenceLock lock = list.lock;
1299              lock.lock();
1300              try {
1301                  int c = size;
# Line 1320 | Line 1308 | public class ReadMostlyVector<E> impleme
1308          }
1309  
1310          public void add(int index, E element) {
1311 <            SequenceLock lock = list.lock;
1311 >            final SequenceLock lock = list.lock;
1312              lock.lock();
1313              try {
1314                  if (index < 0 || index > size)
# Line 1334 | Line 1322 | public class ReadMostlyVector<E> impleme
1322  
1323          public boolean addAll(Collection<? extends E> c) {
1324              Object[] elements = c.toArray();
1325 <            int added;
1338 <            SequenceLock lock = list.lock;
1325 >            final SequenceLock lock = list.lock;
1326              lock.lock();
1327              try {
1328                  int s = size;
1329                  int pc = list.count;
1330                  list.rawAddAllAt(offset + s, elements);
1331 <                added = list.count - pc;
1331 >                int added = list.count - pc;
1332                  size = s + added;
1333 +                return added != 0;
1334              } finally {
1335                  lock.unlock();
1336              }
1349            return added != 0;
1337          }
1338  
1339          public boolean addAll(int index, Collection<? extends E> c) {
1340              Object[] elements = c.toArray();
1341 <            int added;
1355 <            SequenceLock lock = list.lock;
1341 >            final SequenceLock lock = list.lock;
1342              lock.lock();
1343              try {
1344                  int s = size;
# Line 1360 | Line 1346 | public class ReadMostlyVector<E> impleme
1346                      throw new ArrayIndexOutOfBoundsException(index);
1347                  int pc = list.count;
1348                  list.rawAddAllAt(index + offset, elements);
1349 <                added = list.count - pc;
1349 >                int added = list.count - pc;
1350                  size = s + added;
1351 +                return added != 0;
1352              } finally {
1353                  lock.unlock();
1354              }
1368            return added != 0;
1355          }
1356  
1357          public void clear() {
1358 <            SequenceLock lock = list.lock;
1358 >            final SequenceLock lock = list.lock;
1359              lock.lock();
1360              try {
1361                  list.internalClear(offset, offset + size);
# Line 1406 | Line 1392 | public class ReadMostlyVector<E> impleme
1392          }
1393  
1394          public int indexOf(Object o) {
1395 <            SequenceLock lock = list.lock;
1395 >            final SequenceLock lock = list.lock;
1396              long seq = lock.awaitAvailability();
1397              Object[] items = list.array;
1398              int c = list.count;
# Line 1434 | Line 1420 | public class ReadMostlyVector<E> impleme
1420          }
1421  
1422          public int lastIndexOf(Object o) {
1423 <            SequenceLock lock = list.lock;
1423 >            final SequenceLock lock = list.lock;
1424              long seq = lock.awaitAvailability();
1425              Object[] items = list.array;
1426              int c = list.count;
# Line 1462 | Line 1448 | public class ReadMostlyVector<E> impleme
1448          }
1449  
1450          public E remove(int index) {
1451 <            Object result;
1466 <            SequenceLock lock = list.lock;
1451 >            final SequenceLock lock = list.lock;
1452              lock.lock();
1453              try {
1454                  Object[] items = list.array;
1455                  int i = index + offset;
1456                  if (index < 0 || index >= size || i >= items.length)
1457                      throw new ArrayIndexOutOfBoundsException(index);
1458 <                result = items[i];
1458 >                @SuppressWarnings("unchecked")
1459 >                E result = (E) items[i];
1460                  list.rawRemoveAt(i);
1461                  size--;
1462 +                return result;
1463              } finally {
1464                  lock.unlock();
1465              }
1479            return (E)result;
1466          }
1467  
1468          public boolean remove(Object o) {
1469 <            boolean removed = false;
1484 <            SequenceLock lock = list.lock;
1469 >            final SequenceLock lock = list.lock;
1470              lock.lock();
1471              try {
1472                  if (list.rawRemoveAt(list.rawIndexOf(o, offset,
1473                                                       offset + size))) {
1489                    removed = true;
1474                      --size;
1475 +                    return true;
1476                  }
1477 +                else
1478 +                    return false;
1479              } finally {
1480                  lock.unlock();
1481              }
1495            return removed;
1482          }
1483  
1484          public boolean removeAll(Collection<?> c) {
# Line 1540 | Line 1526 | public class ReadMostlyVector<E> impleme
1526          final ReadMostlyVector<E> list;
1527          final SequenceLock lock;
1528          Object[] items;
1529 <        Object next, prev;
1529 >        E next, prev;
1530          long seq;
1531          int cursor;
1532          int fence;
# Line 1571 | Line 1557 | public class ReadMostlyVector<E> impleme
1557              } while (lock.getSequence() != seq);
1558          }
1559  
1560 +        @SuppressWarnings("unchecked")
1561          public boolean hasNext() {
1562              boolean valid;
1563              int i = cursor;
# Line 1579 | Line 1566 | public class ReadMostlyVector<E> impleme
1566                      valid = false;
1567                      break;
1568                  }
1569 <                next = items[i];
1569 >                next = (E) items[i];
1570                  if (lock.getSequence() == seq) {
1571                      valid = true;
1572                      break;
# Line 1589 | Line 1576 | public class ReadMostlyVector<E> impleme
1576              return validNext = valid;
1577          }
1578  
1579 +        @SuppressWarnings("unchecked")
1580          public boolean hasPrevious() {
1581              boolean valid;
1582              int i = cursor - 1;
# Line 1597 | Line 1585 | public class ReadMostlyVector<E> impleme
1585                      valid = false;
1586                      break;
1587                  }
1588 <                prev = items[i];
1588 >                prev = (E) items[i];
1589                  if (lock.getSequence() == seq) {
1590                      valid = true;
1591                      break;
# Line 1611 | Line 1599 | public class ReadMostlyVector<E> impleme
1599              if (validNext || hasNext()) {
1600                  validNext = false;
1601                  lastRet = cursor++;
1602 <                return (E) next;
1602 >                return next;
1603              }
1604              throw new NoSuchElementException();
1605          }
# Line 1620 | Line 1608 | public class ReadMostlyVector<E> impleme
1608              if (validPrev || hasPrevious()) {
1609                  validPrev = false;
1610                  lastRet = cursor--;
1611 <                return (E) prev;
1611 >                return prev;
1612              }
1613              throw new NoSuchElementException();
1614          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines