Don't choke if _elements is null.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1148 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: SortableArrayList.java,v 1.13 2003/04/30 22:24:31 ray Exp $
|
||||
// $Id: SortableArrayList.java,v 1.14 2003/06/16 18:11:30 mdb Exp $
|
||||
//
|
||||
// samskivert library - useful routines for java programs
|
||||
// Copyright (C) 2001 Michael Bayne
|
||||
@@ -249,8 +249,11 @@ public class SortableArrayList extends AbstractList
|
||||
public Object clone ()
|
||||
{
|
||||
try {
|
||||
Object[] elDup = new Object[_elements.length];
|
||||
System.arraycopy(_elements, 0, elDup, 0, _elements.length);
|
||||
Object[] elDup = null;
|
||||
if (_elements != null) {
|
||||
elDup = new Object[_elements.length];
|
||||
System.arraycopy(_elements, 0, elDup, 0, _elements.length);
|
||||
}
|
||||
SortableArrayList dup = (SortableArrayList) super.clone();
|
||||
dup._elements = elDup;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user