135 |
|
elementData = Arrays.copyOf(elementData, size, Object[].class); |
136 |
|
} |
137 |
|
|
138 |
– |
private void initFromConcurrentlyMutating(Collection<? extends E> c) { |
139 |
– |
elementData = c.toArray(); |
140 |
– |
size = elementData.length; |
141 |
– |
// c.toArray might (incorrectly) not return Object[] (see 6260652) |
142 |
– |
if (elementData.getClass() != Object[].class) |
143 |
– |
elementData = Arrays.copyOf(elementData, size, Object[].class); |
144 |
– |
} |
145 |
– |
|
146 |
– |
private final static Object UNALLOCATED = new Object(); |
147 |
– |
|
138 |
|
/** |
139 |
|
* Trims the capacity of this <tt>ArrayList</tt> instance to be the |
140 |
|
* list's current size. An application can use this operation to minimize |