Copy the array using clone; was unchecked-in in my copy of SortableArrayList.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1812 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -168,8 +168,7 @@ public abstract class BaseArrayList<T> extends AbstractList<T>
|
||||
try {
|
||||
BaseArrayList<T> dup = (BaseArrayList<T>) super.clone();
|
||||
if (_elements != null) {
|
||||
dup._elements = (T[])new Object[_size];
|
||||
System.arraycopy(_elements, 0, dup._elements, 0, _size);
|
||||
dup._elements = (T[]) _elements.clone();
|
||||
}
|
||||
return dup;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user