private static final int DEFAULT_CAPACITY 10 public void ensureCapacit

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
private static final int DEFAULT_CAPACITY = 10;
...
public void ensureCapacity(int minCapacity) {
int minExpand = (elementData != EMPTY_ELEMENTDATA)
// any size if real element table
? 0
// larger than default for empty table. It's already supposed to be
// at default size.
: DEFAULT_CAPACITY;
if (minCapacity > minExpand) {
ensureExplicitCapacity(minCapacity);
}
}