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 |
|
} |