|
|
@@ -173,7 +173,9 @@ public class NativeArrayList<T> extends AbstractList<T> implements RandomAccess
|
|
|
@Override
|
|
|
public void add(int index, T value) {
|
|
|
checkCapacity(index);
|
|
|
- checkBounds(index);
|
|
|
+ if(index > size) {
|
|
|
+ throw new IndexOutOfBoundsException(index +" out of bound " + size);
|
|
|
+ }
|
|
|
System.arraycopy(array, index, array, index + 1, size - index);
|
|
|
size++;
|
|
|
accessor.put(array, index, value);
|