1 |
|
/* |
2 |
|
* %W% %E% |
3 |
|
* |
4 |
< |
* Copyright 2006 Sun Microsystems, Inc. All rights reserved. |
4 |
> |
* Copyright 2007 Sun Microsystems, Inc. All rights reserved. |
5 |
|
* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. |
6 |
|
*/ |
7 |
|
|
66 |
|
* should be used only to detect bugs.</i><p> |
67 |
|
* |
68 |
|
* This class is a member of the |
69 |
< |
* <a href="{@docRoot}/../guide/collections/index.html"> |
69 |
> |
* <a href="{@docRoot}/../technotes/guides/collections/index.html"> |
70 |
|
* Java Collections Framework</a>. |
71 |
|
* |
72 |
|
* @author Josh Bloch |
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 |