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.17 by jsr166, Sat Dec 31 05:38:24 2011 UTC vs.
Revision 1.18 by jsr166, Sat Dec 31 05:50:22 2011 UTC

# Line 648 | Line 648 | public class ReadMostlyVector<E>
648              long seq = lock.awaitAvailability();
649              int n = count;
650              Object[] items = array;
651            if (n > items.length)
652                continue;
653            boolean outOfBounds = (index < 0 || index >= n);
651              @SuppressWarnings("unchecked")
652 <            E e = outOfBounds ? null : (E) items[index];
652 >            E e = (index < items.length) ? (E) items[index] : null;
653              if (lock.getSequence() == seq) {
654 <                if (outOfBounds)
654 >                if (index >= n)
655                      throw new ArrayIndexOutOfBoundsException(index);
656 <                else
660 <                    return e;
656 >                return e;
657              }
658          }
659      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines