14 |
|
* throughput when invocations of read-only methods by multiple |
15 |
|
* threads are most common. |
16 |
|
* |
17 |
< |
* <p> The iterators returned by this class's {@link #iterator() |
17 |
> |
* <p>The iterators returned by this class's {@link #iterator() |
18 |
|
* iterator} and {@link #listIterator(int) listIterator} methods are |
19 |
|
* best-effort in the presence of concurrent modifications, and do |
20 |
|
* <em>NOT</em> throw {@link ConcurrentModificationException}. An |
172 |
|
static int findFirstIndex(Object[] items, Object x, int index, int fence) { |
173 |
|
int len; |
174 |
|
if (items != null && (len = items.length) > 0) { |
175 |
< |
int start = (index < 0)? 0 : index; |
175 |
> |
int start = (index < 0) ? 0 : index; |
176 |
|
int bound = (fence < len) ? fence : len; |
177 |
|
for (int i = start; i < bound; ++i) { |
178 |
|
Object e = items[i]; |
406 |
|
sb.append('['); |
407 |
|
for (;;) { |
408 |
|
Object e = items[i]; |
409 |
< |
sb.append((e == this)? "(this Collection)" : e.toString()); |
409 |
> |
sb.append((e == this) ? "(this Collection)" : e.toString()); |
410 |
|
if (++i < fence) |
411 |
|
sb.append(',').append(' '); |
412 |
|
else |
1039 |
|
long stamp = lock.writeLock(); |
1040 |
|
try { |
1041 |
|
Object[] items = array; |
1042 |
< |
int cap = (items == null)? 0 : items.length; |
1042 |
> |
int cap = (items == null) ? 0 : items.length; |
1043 |
|
if (minCapacity - cap > 0) |
1044 |
|
grow(minCapacity); |
1045 |
|
} finally { |