--- jsr166/src/jsr166e/extra/ReadMostlyVector.java 2011/12/31 05:38:24 1.17 +++ jsr166/src/jsr166e/extra/ReadMostlyVector.java 2011/12/31 05:50:22 1.18 @@ -648,16 +648,12 @@ public class ReadMostlyVector long seq = lock.awaitAvailability(); int n = count; Object[] items = array; - if (n > items.length) - continue; - boolean outOfBounds = (index < 0 || index >= n); @SuppressWarnings("unchecked") - E e = outOfBounds ? null : (E) items[index]; + E e = (index < items.length) ? (E) items[index] : null; if (lock.getSequence() == seq) { - if (outOfBounds) + if (index >= n) throw new ArrayIndexOutOfBoundsException(index); - else - return e; + return e; } } }