158 |
|
else |
159 |
|
newCapacity = MAX_ARRAY_SIZE; |
160 |
|
} |
161 |
< |
return array = ((items == null) ? |
161 |
> |
return array = ((items == null) ? |
162 |
|
new Object[newCapacity] : |
163 |
|
Arrays.copyOf(items, newCapacity)); |
164 |
|
} |
427 |
|
n = len; |
428 |
|
int fence = bound < 0 || bound > n ? n : bound; |
429 |
|
int i = (origin < 0) ? 0 : origin; |
430 |
< |
if (i != fence) |
430 |
> |
if (i != fence) |
431 |
|
return Arrays.copyOfRange(items, i, fence, Object[].class); |
432 |
|
} |
433 |
|
return new Object[0]; |
568 |
|
final StampedLock lock = this.lock; |
569 |
|
long stamp = lock.tryOptimisticRead(); |
570 |
|
Object[] items; |
571 |
< |
if (index >= 0 && (items = array) != null && |
571 |
> |
if (index >= 0 && (items = array) != null && |
572 |
|
index < count && index < items.length) { |
573 |
|
@SuppressWarnings("unchecked") E e = (E)items[index]; |
574 |
|
if (lock.validate(stamp)) |
584 |
|
long stamp = lock.readLock(); |
585 |
|
try { |
586 |
|
Object[] items; |
587 |
< |
if ((items = array) != null && index < items.length && |
587 |
> |
if ((items = array) != null && index < items.length && |
588 |
|
index < count && index >= 0) |
589 |
|
e = (E)items[index]; |
590 |
|
else |
596 |
|
throw new ArrayIndexOutOfBoundsException(index); |
597 |
|
return (E)e; |
598 |
|
} |
599 |
< |
|
599 |
> |
|
600 |
|
public int hashCode() { |
601 |
|
int h; |
602 |
|
final StampedLock lock = this.lock; |
608 |
|
} |
609 |
|
return h; |
610 |
|
} |
611 |
< |
|
611 |
> |
|
612 |
|
public int indexOf(Object o) { |
613 |
|
int idx; |
614 |
|
final StampedLock lock = this.lock; |
743 |
|
if (ret != null) |
744 |
|
return ret; |
745 |
|
} |
746 |
< |
|
746 |
> |
|
747 |
|
throw new ArrayIndexOutOfBoundsException(fromIndex < 0 ? fromIndex : toIndex); |
748 |
|
} |
749 |
|
|
867 |
|
final StampedLock lock = this.lock; |
868 |
|
long stamp = lock.readLock(); |
869 |
|
try { |
870 |
< |
Object[] items; |
870 |
> |
Object[] items; |
871 |
|
int len, n; |
872 |
|
if ((items = array) != null && (len = items.length) > 0 && |
873 |
|
(n = count) <= len) { |
921 |
|
long stamp = lock.tryOptimisticRead(); |
922 |
|
Object[] items; |
923 |
|
int i; |
924 |
< |
if ((items = array) != null && (i = count - 1) >= 0 && |
924 |
> |
if ((items = array) != null && (i = count - 1) >= 0 && |
925 |
|
i < items.length) { |
926 |
|
@SuppressWarnings("unchecked") E e = (E)items[i]; |
927 |
|
if (lock.validate(stamp)) |
974 |
|
try { |
975 |
|
if (index < count) |
976 |
|
idx = findLastIndex(array, o, index, 0); |
977 |
< |
else |
977 |
> |
else |
978 |
|
oobe = true; |
979 |
|
} finally { |
980 |
|
lock.unlockRead(stamp); |