From: Bryce McKinlay Date: Tue, 17 Jul 2001 01:56:38 +0000 (+0000) Subject: LinkedList.java (clone): Clear the copy list with clear(), not by setting its size... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f79ced717fee2e31787829fe9710fef790077583;p=gcc.git LinkedList.java (clone): Clear the copy list with clear(), not by setting its size field. * java/util/LinkedList.java (clone): Clear the copy list with clear(), not by setting its size field. From-SVN: r44057 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 017a99a8cf0..161649f124a 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,8 @@ +2001-07-17 Bryce McKinlay + + * java/util/LinkedList.java (clone): Clear the copy list with clear(), + not by setting its size field. + 2001-07-12 Tom Tromey David Brownell diff --git a/libjava/java/util/LinkedList.java b/libjava/java/util/LinkedList.java index 092c8bd7e73..41ca0936cf2 100644 --- a/libjava/java/util/LinkedList.java +++ b/libjava/java/util/LinkedList.java @@ -474,7 +474,7 @@ public class LinkedList extends AbstractSequentialList catch (CloneNotSupportedException ex) { } - copy.size = 0; + copy.clear(); copy.addAll(this); return copy; } @@ -534,9 +534,7 @@ public class LinkedList extends AbstractSequentialList } /** 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 { @@ -546,10 +544,6 @@ public class LinkedList extends AbstractSequentialList 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)