+2001-07-17 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
+
+ * java/util/LinkedList.java (clone): Clear the copy list with clear(),
+ not by setting its size field.
+
2001-07-12 Tom Tromey <tromey@redhat.com>
David Brownell <david-b@pacbell.net>
catch (CloneNotSupportedException ex)
{
}
- copy.size = 0;
+ copy.clear();
copy.addAll(this);
return copy;
}
}
/** A ListIterator over the list. This class keeps track of its
- * position in the list, the size of the list, and the two list
- * entries it is between. This enables it to be used identically
- * for both the list itself and a sublist of the list.
+ * position in the list and the two list entries it is between.
*/
class LinkedListItr implements ListIterator
{
Entry lastReturned; // entry that will be affected by remove() or set().
int position; // index of `next'.
- /**
- * Create a new Iter starting at a given Entry within the list, at a given
- * position, in a list of given size.
- */
LinkedListItr(int index)
{
if (index == size)