diff options
author | bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-07-17 01:56:38 +0000 |
---|---|---|
committer | bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-07-17 01:56:38 +0000 |
commit | ed51db7792b3b8b44bfad57605bca44aa88b9689 (patch) | |
tree | a05033b53765dd8a2196201c146346de3d67021d /libjava/java/util/LinkedList.java | |
parent | 6d866f03ce390aa6f6be2c215b8a4cd5f9cdb0e8 (diff) | |
download | ppe42-gcc-ed51db7792b3b8b44bfad57605bca44aa88b9689.tar.gz ppe42-gcc-ed51db7792b3b8b44bfad57605bca44aa88b9689.zip |
* java/util/LinkedList.java (clone): Clear the copy list with clear(),
not by setting its size field.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44057 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/util/LinkedList.java')
-rw-r--r-- | libjava/java/util/LinkedList.java | 10 |
1 files changed, 2 insertions, 8 deletions
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) |