AbstractList.java: Throw messages with IndexOutOfBoundsExceptions.
authorBryce McKinlay <bryce@albatross.co.nz>
Thu, 2 Nov 2000 10:08:03 +0000 (10:08 +0000)
committerBryce McKinlay <bryce@gcc.gnu.org>
Thu, 2 Nov 2000 10:08:03 +0000 (10:08 +0000)
commit7177dab5c931138c85a1762acc54fd53880f4933
tree8357f25c2a8a67f24d63ee938da87068de9dfce6
parent17e2e7f92defe956f5b700558d58aefa96869817
AbstractList.java: Throw messages with IndexOutOfBoundsExceptions.

2000-11-02  Bryce McKinlay  <bryce@albatross.co.nz>

* java/util/AbstractList.java: Throw messages with
IndexOutOfBoundsExceptions.
 (listIterator()): Call listIterator(0).
(size): New field. Initialize to size().
(hasNext): Test position against size, not size().
(remove): Increment knownMod by one instead of resetting it from
modCount.
(add): Ditto.
(SubList.upMod): Removed.
(SubList.set): Don't call upMod() or update knownMod.
(SubList.add(int,Object)): Increment modCount instead of calling
upMod().
(SubList.remove): Ditto.
(SubList.addAll): Don't call backingList.size(). Increment size from
c.size().
(SubList.iterator): New method. Call listIterator(0).
(SubList.listIterator): New method. Restore code to return an
anonymous listIterator implementation (with some changes).
* java/util/AbstractSequentialList.java: Throw messages with
IndexOutOfBoundsExceptions.
(addAll): Add a specnote.
* java/util/ArrayList.java (removeRange): Get the math right.
(addAll): Increment modCount _before_ creating iterator.
* java/util/LinkedList.java: Rewritten, mostly.

From-SVN: r37203
libjava/ChangeLog
libjava/java/util/AbstractList.java
libjava/java/util/AbstractSequentialList.java
libjava/java/util/ArrayList.java
libjava/java/util/LinkedList.java