1 |
|
/* |
2 |
< |
* Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved. |
2 |
> |
* Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved. |
3 |
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
|
* |
5 |
|
* This code is free software; you can redistribute it and/or modify it |
25 |
|
|
26 |
|
package java.util; |
27 |
|
|
28 |
+ |
import java.io.IOException; |
29 |
+ |
import java.io.ObjectInputStream; |
30 |
+ |
import java.io.StreamCorruptedException; |
31 |
|
import java.util.function.Consumer; |
32 |
|
import java.util.function.Predicate; |
33 |
|
import java.util.function.UnaryOperator; |
34 |
|
|
35 |
+ |
import jdk.internal.util.ArraysSupport; |
36 |
+ |
|
37 |
|
/** |
38 |
|
* The {@code Vector} class implements a growable array of |
39 |
|
* objects. Like an array, it contains components that can be |
75 |
|
* |
76 |
|
* <p>As of the Java 2 platform v1.2, this class was retrofitted to |
77 |
|
* implement the {@link List} interface, making it a member of the |
78 |
< |
* <a href="{@docRoot}/../technotes/guides/collections/index.html"> |
78 |
> |
* <a href="{@docRoot}/java.base/java/util/package-summary.html#CollectionsFramework"> |
79 |
|
* Java Collections Framework</a>. Unlike the new collection |
80 |
|
* implementations, {@code Vector} is synchronized. If a thread-safe |
81 |
|
* implementation is not needed, it is recommended to use {@link |
244 |
|
} |
245 |
|
|
246 |
|
/** |
242 |
– |
* The maximum size of array to allocate (unless necessary). |
243 |
– |
* Some VMs reserve some header words in an array. |
244 |
– |
* Attempts to allocate larger arrays may result in |
245 |
– |
* OutOfMemoryError: Requested array size exceeds VM limit |
246 |
– |
*/ |
247 |
– |
private static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8; |
248 |
– |
|
249 |
– |
/** |
247 |
|
* Increases the capacity to ensure that it can hold at least the |
248 |
|
* number of elements specified by the minimum capacity argument. |
249 |
|
* |
251 |
|
* @throws OutOfMemoryError if minCapacity is less than zero |
252 |
|
*/ |
253 |
|
private Object[] grow(int minCapacity) { |
254 |
< |
return elementData = Arrays.copyOf(elementData, |
255 |
< |
newCapacity(minCapacity)); |
254 |
> |
int oldCapacity = elementData.length; |
255 |
> |
int newCapacity = ArraysSupport.newLength(oldCapacity, |
256 |
> |
minCapacity - oldCapacity, /* minimum growth */ |
257 |
> |
capacityIncrement > 0 ? capacityIncrement : oldCapacity |
258 |
> |
/* preferred growth */); |
259 |
> |
return elementData = Arrays.copyOf(elementData, newCapacity); |
260 |
|
} |
261 |
|
|
262 |
|
private Object[] grow() { |
264 |
|
} |
265 |
|
|
266 |
|
/** |
266 |
– |
* Returns a capacity at least as large as the given minimum capacity. |
267 |
– |
* Will not return a capacity greater than MAX_ARRAY_SIZE unless |
268 |
– |
* the given minimum capacity is greater than MAX_ARRAY_SIZE. |
269 |
– |
* |
270 |
– |
* @param minCapacity the desired minimum capacity |
271 |
– |
* @throws OutOfMemoryError if minCapacity is less than zero |
272 |
– |
*/ |
273 |
– |
private int newCapacity(int minCapacity) { |
274 |
– |
// overflow-conscious code |
275 |
– |
int oldCapacity = elementData.length; |
276 |
– |
int newCapacity = oldCapacity + ((capacityIncrement > 0) ? |
277 |
– |
capacityIncrement : oldCapacity); |
278 |
– |
if (newCapacity - minCapacity <= 0) { |
279 |
– |
if (minCapacity < 0) // overflow |
280 |
– |
throw new OutOfMemoryError(); |
281 |
– |
return minCapacity; |
282 |
– |
} |
283 |
– |
return (newCapacity - MAX_ARRAY_SIZE <= 0) |
284 |
– |
? newCapacity |
285 |
– |
: hugeCapacity(minCapacity); |
286 |
– |
} |
287 |
– |
|
288 |
– |
private static int hugeCapacity(int minCapacity) { |
289 |
– |
if (minCapacity < 0) // overflow |
290 |
– |
throw new OutOfMemoryError(); |
291 |
– |
return (minCapacity > MAX_ARRAY_SIZE) ? |
292 |
– |
Integer.MAX_VALUE : |
293 |
– |
MAX_ARRAY_SIZE; |
294 |
– |
} |
295 |
– |
|
296 |
– |
/** |
267 |
|
* Sets the size of this vector. If the new size is greater than the |
268 |
|
* current size, new {@code null} items are added to the end of |
269 |
|
* the vector. If the new size is less than the current size, all |
276 |
|
modCount++; |
277 |
|
if (newSize > elementData.length) |
278 |
|
grow(newSize); |
279 |
< |
for (int i = newSize; i < elementCount; i++) |
280 |
< |
elementData[i] = null; |
279 |
> |
final Object[] es = elementData; |
280 |
> |
for (int to = elementCount, i = newSize; i < to; i++) |
281 |
> |
es[i] = null; |
282 |
|
elementCount = newSize; |
283 |
|
} |
284 |
|
|
556 |
|
modCount++; |
557 |
|
elementCount--; |
558 |
|
elementData[elementCount] = null; /* to let gc do its work */ |
559 |
+ |
// checkInvariants(); |
560 |
|
} |
561 |
|
|
562 |
|
/** |
647 |
|
* method (which is part of the {@link List} interface). |
648 |
|
*/ |
649 |
|
public synchronized void removeAllElements() { |
650 |
< |
// Let gc do its work |
651 |
< |
for (int i = 0; i < elementCount; i++) |
652 |
< |
elementData[i] = null; |
681 |
< |
|
650 |
> |
final Object[] es = elementData; |
651 |
> |
for (int to = elementCount, i = elementCount = 0; i < to; i++) |
652 |
> |
es[i] = null; |
653 |
|
modCount++; |
683 |
– |
elementCount = 0; |
654 |
|
} |
655 |
|
|
656 |
|
/** |
663 |
|
public synchronized Object clone() { |
664 |
|
try { |
665 |
|
@SuppressWarnings("unchecked") |
666 |
< |
Vector<E> v = (Vector<E>) super.clone(); |
666 |
> |
Vector<E> v = (Vector<E>) super.clone(); |
667 |
|
v.elementData = Arrays.copyOf(elementData, elementCount); |
668 |
|
v.modCount = 0; |
669 |
|
return v; |
729 |
|
return (E) elementData[index]; |
730 |
|
} |
731 |
|
|
732 |
+ |
@SuppressWarnings("unchecked") |
733 |
+ |
static <E> E elementAt(Object[] es, int index) { |
734 |
+ |
return (E) es[index]; |
735 |
+ |
} |
736 |
+ |
|
737 |
|
/** |
738 |
|
* Returns the element at the specified position in this Vector. |
739 |
|
* |
780 |
|
elementData = grow(); |
781 |
|
elementData[s] = e; |
782 |
|
elementCount = s + 1; |
783 |
+ |
// checkInvariants(); |
784 |
|
} |
785 |
|
|
786 |
|
/** |
849 |
|
numMoved); |
850 |
|
elementData[--elementCount] = null; // Let gc do its work |
851 |
|
|
852 |
+ |
// checkInvariants(); |
853 |
|
return oldValue; |
854 |
|
} |
855 |
|
|
905 |
|
elementData = grow(s + numNew); |
906 |
|
System.arraycopy(a, 0, elementData, s, numNew); |
907 |
|
elementCount = s + numNew; |
908 |
+ |
// checkInvariants(); |
909 |
|
return true; |
910 |
|
} |
911 |
|
} |
956 |
|
return bulkRemove(e -> !c.contains(e)); |
957 |
|
} |
958 |
|
|
959 |
+ |
/** |
960 |
+ |
* @throws NullPointerException {@inheritDoc} |
961 |
+ |
*/ |
962 |
|
@Override |
963 |
|
public boolean removeIf(Predicate<? super E> filter) { |
964 |
|
Objects.requireNonNull(filter); |
965 |
|
return bulkRemove(filter); |
966 |
|
} |
967 |
|
|
968 |
< |
@SuppressWarnings("unchecked") |
968 |
> |
// A tiny bit set implementation |
969 |
> |
|
970 |
> |
private static long[] nBits(int n) { |
971 |
> |
return new long[((n - 1) >> 6) + 1]; |
972 |
> |
} |
973 |
> |
private static void setBit(long[] bits, int i) { |
974 |
> |
bits[i >> 6] |= 1L << i; |
975 |
> |
} |
976 |
> |
private static boolean isClear(long[] bits, int i) { |
977 |
> |
return (bits[i >> 6] & (1L << i)) == 0; |
978 |
> |
} |
979 |
> |
|
980 |
|
private synchronized boolean bulkRemove(Predicate<? super E> filter) { |
981 |
|
int expectedModCount = modCount; |
982 |
|
final Object[] es = elementData; |
983 |
< |
final int size = elementCount; |
984 |
< |
final boolean modified; |
993 |
< |
int r; |
983 |
> |
final int end = elementCount; |
984 |
> |
int i; |
985 |
|
// Optimize for initial run of survivors |
986 |
< |
for (r = 0; r < size && !filter.test((E) es[r]); r++) |
986 |
> |
for (i = 0; i < end && !filter.test(elementAt(es, i)); i++) |
987 |
|
; |
988 |
< |
if (modified = (r < size)) { |
989 |
< |
expectedModCount++; |
988 |
> |
// Tolerate predicates that reentrantly access the collection for |
989 |
> |
// read (but writers still get CME), so traverse once to find |
990 |
> |
// elements to delete, a second pass to physically expunge. |
991 |
> |
if (i < end) { |
992 |
> |
final int beg = i; |
993 |
> |
final long[] deathRow = nBits(end - beg); |
994 |
> |
deathRow[0] = 1L; // set bit 0 |
995 |
> |
for (i = beg + 1; i < end; i++) |
996 |
> |
if (filter.test(elementAt(es, i))) |
997 |
> |
setBit(deathRow, i - beg); |
998 |
> |
if (modCount != expectedModCount) |
999 |
> |
throw new ConcurrentModificationException(); |
1000 |
|
modCount++; |
1001 |
< |
int w = r++; |
1002 |
< |
try { |
1003 |
< |
for (E e; r < size; r++) |
1004 |
< |
if (!filter.test(e = (E) es[r])) |
1005 |
< |
es[w++] = e; |
1006 |
< |
} catch (Throwable ex) { |
1007 |
< |
// copy remaining elements |
1008 |
< |
System.arraycopy(es, r, es, w, size - r); |
1009 |
< |
w += size - r; |
1010 |
< |
throw ex; |
1011 |
< |
} finally { |
1012 |
< |
Arrays.fill(es, elementCount = w, size, null); |
1013 |
< |
} |
1001 |
> |
int w = beg; |
1002 |
> |
for (i = beg; i < end; i++) |
1003 |
> |
if (isClear(deathRow, i - beg)) |
1004 |
> |
es[w++] = es[i]; |
1005 |
> |
for (i = elementCount = w; i < end; i++) |
1006 |
> |
es[i] = null; |
1007 |
> |
// checkInvariants(); |
1008 |
> |
return true; |
1009 |
> |
} else { |
1010 |
> |
if (modCount != expectedModCount) |
1011 |
> |
throw new ConcurrentModificationException(); |
1012 |
> |
// checkInvariants(); |
1013 |
> |
return false; |
1014 |
|
} |
1014 |
– |
if (modCount != expectedModCount) |
1015 |
– |
throw new ConcurrentModificationException(); |
1016 |
– |
return modified; |
1015 |
|
} |
1016 |
|
|
1017 |
|
/** |
1052 |
|
numMoved); |
1053 |
|
System.arraycopy(a, 0, elementData, index, numNew); |
1054 |
|
elementCount = s + numNew; |
1055 |
+ |
// checkInvariants(); |
1056 |
|
return true; |
1057 |
|
} |
1058 |
|
|
1134 |
|
* (If {@code toIndex==fromIndex}, this operation has no effect.) |
1135 |
|
*/ |
1136 |
|
protected synchronized void removeRange(int fromIndex, int toIndex) { |
1138 |
– |
int numMoved = elementCount - toIndex; |
1139 |
– |
System.arraycopy(elementData, toIndex, elementData, fromIndex, |
1140 |
– |
numMoved); |
1141 |
– |
|
1142 |
– |
// Let gc do its work |
1137 |
|
modCount++; |
1138 |
< |
int newElementCount = elementCount - (toIndex-fromIndex); |
1139 |
< |
while (elementCount != newElementCount) |
1140 |
< |
elementData[--elementCount] = null; |
1138 |
> |
shiftTailOverGap(elementData, fromIndex, toIndex); |
1139 |
> |
// checkInvariants(); |
1140 |
> |
} |
1141 |
> |
|
1142 |
> |
/** Erases the gap from lo to hi, by sliding down following elements. */ |
1143 |
> |
private void shiftTailOverGap(Object[] es, int lo, int hi) { |
1144 |
> |
System.arraycopy(es, hi, es, lo, elementCount - hi); |
1145 |
> |
for (int to = elementCount, i = (elementCount -= hi - lo); i < to; i++) |
1146 |
> |
es[i] = null; |
1147 |
|
} |
1148 |
|
|
1149 |
|
/** |
1150 |
< |
* Save the state of the {@code Vector} instance to a stream (that |
1151 |
< |
* is, serialize it). |
1150 |
> |
* Loads a {@code Vector} instance from a stream |
1151 |
> |
* (that is, deserializes it). |
1152 |
> |
* This method performs checks to ensure the consistency |
1153 |
> |
* of the fields. |
1154 |
> |
* |
1155 |
> |
* @param in the stream |
1156 |
> |
* @throws java.io.IOException if an I/O error occurs |
1157 |
> |
* @throws ClassNotFoundException if the stream contains data |
1158 |
> |
* of a non-existing class |
1159 |
> |
*/ |
1160 |
> |
private void readObject(ObjectInputStream in) |
1161 |
> |
throws IOException, ClassNotFoundException { |
1162 |
> |
ObjectInputStream.GetField gfields = in.readFields(); |
1163 |
> |
int count = gfields.get("elementCount", 0); |
1164 |
> |
Object[] data = (Object[])gfields.get("elementData", null); |
1165 |
> |
if (count < 0 || data == null || count > data.length) { |
1166 |
> |
throw new StreamCorruptedException("Inconsistent vector internals"); |
1167 |
> |
} |
1168 |
> |
elementCount = count; |
1169 |
> |
elementData = data.clone(); |
1170 |
> |
} |
1171 |
> |
|
1172 |
> |
/** |
1173 |
> |
* Saves the state of the {@code Vector} instance to a stream |
1174 |
> |
* (that is, serializes it). |
1175 |
|
* This method performs synchronization to ensure the consistency |
1176 |
|
* of the serialized data. |
1177 |
+ |
* |
1178 |
+ |
* @param s the stream |
1179 |
+ |
* @throws java.io.IOException if an I/O error occurs |
1180 |
|
*/ |
1181 |
|
private void writeObject(java.io.ObjectOutputStream s) |
1182 |
|
throws java.io.IOException { |
1278 |
|
if (i >= size) { |
1279 |
|
return; |
1280 |
|
} |
1281 |
< |
@SuppressWarnings("unchecked") |
1282 |
< |
final E[] elementData = (E[]) Vector.this.elementData; |
1257 |
< |
if (i >= elementData.length) { |
1281 |
> |
final Object[] es = elementData; |
1282 |
> |
if (i >= es.length) |
1283 |
|
throw new ConcurrentModificationException(); |
1284 |
< |
} |
1285 |
< |
while (i != size && modCount == expectedModCount) { |
1261 |
< |
action.accept(elementData[i++]); |
1262 |
< |
} |
1284 |
> |
while (i < size && modCount == expectedModCount) |
1285 |
> |
action.accept(elementAt(es, i++)); |
1286 |
|
// update once at end of iteration to reduce heap write traffic |
1287 |
|
cursor = i; |
1288 |
|
lastRet = i - 1; |
1349 |
|
} |
1350 |
|
} |
1351 |
|
|
1352 |
+ |
/** |
1353 |
+ |
* @throws NullPointerException {@inheritDoc} |
1354 |
+ |
*/ |
1355 |
|
@Override |
1356 |
|
public synchronized void forEach(Consumer<? super E> action) { |
1357 |
|
Objects.requireNonNull(action); |
1358 |
|
final int expectedModCount = modCount; |
1359 |
< |
@SuppressWarnings("unchecked") |
1360 |
< |
final E[] elementData = (E[]) this.elementData; |
1361 |
< |
final int elementCount = this.elementCount; |
1362 |
< |
for (int i=0; modCount == expectedModCount && i < elementCount; i++) { |
1363 |
< |
action.accept(elementData[i]); |
1338 |
< |
} |
1339 |
< |
if (modCount != expectedModCount) { |
1359 |
> |
final Object[] es = elementData; |
1360 |
> |
final int size = elementCount; |
1361 |
> |
for (int i = 0; modCount == expectedModCount && i < size; i++) |
1362 |
> |
action.accept(elementAt(es, i)); |
1363 |
> |
if (modCount != expectedModCount) |
1364 |
|
throw new ConcurrentModificationException(); |
1365 |
< |
} |
1365 |
> |
// checkInvariants(); |
1366 |
|
} |
1367 |
|
|
1368 |
+ |
/** |
1369 |
+ |
* @throws NullPointerException {@inheritDoc} |
1370 |
+ |
*/ |
1371 |
|
@Override |
1345 |
– |
@SuppressWarnings("unchecked") |
1372 |
|
public synchronized void replaceAll(UnaryOperator<E> operator) { |
1373 |
|
Objects.requireNonNull(operator); |
1374 |
|
final int expectedModCount = modCount; |
1375 |
+ |
final Object[] es = elementData; |
1376 |
|
final int size = elementCount; |
1377 |
< |
for (int i=0; modCount == expectedModCount && i < size; i++) { |
1378 |
< |
elementData[i] = operator.apply((E) elementData[i]); |
1379 |
< |
} |
1353 |
< |
if (modCount != expectedModCount) { |
1377 |
> |
for (int i = 0; modCount == expectedModCount && i < size; i++) |
1378 |
> |
es[i] = operator.apply(elementAt(es, i)); |
1379 |
> |
if (modCount != expectedModCount) |
1380 |
|
throw new ConcurrentModificationException(); |
1381 |
< |
} |
1381 |
> |
// TODO(8203662): remove increment of modCount from ... |
1382 |
|
modCount++; |
1383 |
+ |
// checkInvariants(); |
1384 |
|
} |
1385 |
|
|
1386 |
|
@SuppressWarnings("unchecked") |
1388 |
|
public synchronized void sort(Comparator<? super E> c) { |
1389 |
|
final int expectedModCount = modCount; |
1390 |
|
Arrays.sort((E[]) elementData, 0, elementCount, c); |
1391 |
< |
if (modCount != expectedModCount) { |
1391 |
> |
if (modCount != expectedModCount) |
1392 |
|
throw new ConcurrentModificationException(); |
1366 |
– |
} |
1393 |
|
modCount++; |
1394 |
+ |
// checkInvariants(); |
1395 |
|
} |
1396 |
|
|
1397 |
|
/** |
1409 |
|
*/ |
1410 |
|
@Override |
1411 |
|
public Spliterator<E> spliterator() { |
1412 |
< |
return new VectorSpliterator<>(this, null, 0, -1, 0); |
1412 |
> |
return new VectorSpliterator(null, 0, -1, 0); |
1413 |
|
} |
1414 |
|
|
1415 |
|
/** Similar to ArrayList Spliterator */ |
1416 |
< |
static final class VectorSpliterator<E> implements Spliterator<E> { |
1390 |
< |
private final Vector<E> list; |
1416 |
> |
final class VectorSpliterator implements Spliterator<E> { |
1417 |
|
private Object[] array; |
1418 |
|
private int index; // current index, modified on advance/split |
1419 |
|
private int fence; // -1 until used; then one past last index |
1420 |
|
private int expectedModCount; // initialized when fence set |
1421 |
|
|
1422 |
< |
/** Create new spliterator covering the given range */ |
1423 |
< |
VectorSpliterator(Vector<E> list, Object[] array, int origin, int fence, |
1422 |
> |
/** Creates new spliterator covering the given range. */ |
1423 |
> |
VectorSpliterator(Object[] array, int origin, int fence, |
1424 |
|
int expectedModCount) { |
1399 |
– |
this.list = list; |
1425 |
|
this.array = array; |
1426 |
|
this.index = origin; |
1427 |
|
this.fence = fence; |
1431 |
|
private int getFence() { // initialize on first use |
1432 |
|
int hi; |
1433 |
|
if ((hi = fence) < 0) { |
1434 |
< |
synchronized (list) { |
1435 |
< |
array = list.elementData; |
1436 |
< |
expectedModCount = list.modCount; |
1437 |
< |
hi = fence = list.elementCount; |
1434 |
> |
synchronized (Vector.this) { |
1435 |
> |
array = elementData; |
1436 |
> |
expectedModCount = modCount; |
1437 |
> |
hi = fence = elementCount; |
1438 |
|
} |
1439 |
|
} |
1440 |
|
return hi; |
1443 |
|
public Spliterator<E> trySplit() { |
1444 |
|
int hi = getFence(), lo = index, mid = (lo + hi) >>> 1; |
1445 |
|
return (lo >= mid) ? null : |
1446 |
< |
new VectorSpliterator<>(list, array, lo, index = mid, |
1422 |
< |
expectedModCount); |
1446 |
> |
new VectorSpliterator(array, lo, index = mid, expectedModCount); |
1447 |
|
} |
1448 |
|
|
1449 |
|
@SuppressWarnings("unchecked") |
1450 |
|
public boolean tryAdvance(Consumer<? super E> action) { |
1451 |
+ |
Objects.requireNonNull(action); |
1452 |
|
int i; |
1428 |
– |
if (action == null) |
1429 |
– |
throw new NullPointerException(); |
1453 |
|
if (getFence() > (i = index)) { |
1454 |
|
index = i + 1; |
1455 |
|
action.accept((E)array[i]); |
1456 |
< |
if (list.modCount != expectedModCount) |
1456 |
> |
if (modCount != expectedModCount) |
1457 |
|
throw new ConcurrentModificationException(); |
1458 |
|
return true; |
1459 |
|
} |
1462 |
|
|
1463 |
|
@SuppressWarnings("unchecked") |
1464 |
|
public void forEachRemaining(Consumer<? super E> action) { |
1465 |
< |
int i, hi; // hoist accesses and checks from loop |
1466 |
< |
Vector<E> lst; Object[] a; |
1467 |
< |
if (action == null) |
1468 |
< |
throw new NullPointerException(); |
1469 |
< |
if ((lst = list) != null) { |
1470 |
< |
if ((hi = fence) < 0) { |
1471 |
< |
synchronized (lst) { |
1472 |
< |
expectedModCount = lst.modCount; |
1450 |
< |
a = array = lst.elementData; |
1451 |
< |
hi = fence = lst.elementCount; |
1452 |
< |
} |
1453 |
< |
} |
1454 |
< |
else |
1455 |
< |
a = array; |
1456 |
< |
if (a != null && (i = index) >= 0 && (index = hi) <= a.length) { |
1457 |
< |
while (i < hi) |
1458 |
< |
action.accept((E) a[i++]); |
1459 |
< |
if (lst.modCount == expectedModCount) |
1460 |
< |
return; |
1461 |
< |
} |
1462 |
< |
} |
1463 |
< |
throw new ConcurrentModificationException(); |
1465 |
> |
Objects.requireNonNull(action); |
1466 |
> |
final int hi = getFence(); |
1467 |
> |
final Object[] a = array; |
1468 |
> |
int i; |
1469 |
> |
for (i = index, index = hi; i < hi; i++) |
1470 |
> |
action.accept((E) a[i]); |
1471 |
> |
if (modCount != expectedModCount) |
1472 |
> |
throw new ConcurrentModificationException(); |
1473 |
|
} |
1474 |
|
|
1475 |
|
public long estimateSize() { |
1480 |
|
return Spliterator.ORDERED | Spliterator.SIZED | Spliterator.SUBSIZED; |
1481 |
|
} |
1482 |
|
} |
1483 |
+ |
|
1484 |
+ |
void checkInvariants() { |
1485 |
+ |
// assert elementCount >= 0; |
1486 |
+ |
// assert elementCount == elementData.length || elementData[elementCount] == null; |
1487 |
+ |
} |
1488 |
|
} |