TreeMap.java (fabricateTree): Fix off-by-one error.
2003-01-03 Eric Blake <ebb9@email.byu.edu> * java/util/TreeMap.java (fabricateTree): Fix off-by-one error. (TreeIterator.remove): Prefer IllegalStateException over ConcurrentModificationException, to match Sun. From-SVN: r60837
This commit is contained in:
parent
e392d36793
commit
29456fb870
2 changed files with 9 additions and 3 deletions
|
@ -1,3 +1,9 @@
|
|||
2003-01-03 Eric Blake <ebb9@email.byu.edu>
|
||||
|
||||
* java/util/TreeMap.java (fabricateTree): Fix off-by-one error.
|
||||
(TreeIterator.remove): Prefer IllegalStateException over
|
||||
ConcurrentModificationException, to match Sun.
|
||||
|
||||
2002-12-22 Anthony Green <green@redhat.com>
|
||||
|
||||
* boehm.cc (_Jv_MarkObj): Mark the protectionDomain of a class.
|
||||
|
|
|
@ -865,7 +865,7 @@ public class TreeMap extends AbstractMap
|
|||
int rowsize;
|
||||
|
||||
// Fill each row that is completely full of nodes.
|
||||
for (rowsize = 2; rowsize + rowsize < count; rowsize <<= 1)
|
||||
for (rowsize = 2; rowsize + rowsize <= count; rowsize <<= 1)
|
||||
{
|
||||
Node parent = row;
|
||||
Node last = null;
|
||||
|
@ -1468,10 +1468,10 @@ public class TreeMap extends AbstractMap
|
|||
*/
|
||||
public void remove()
|
||||
{
|
||||
if (knownMod != modCount)
|
||||
throw new ConcurrentModificationException();
|
||||
if (last == null)
|
||||
throw new IllegalStateException();
|
||||
if (knownMod != modCount)
|
||||
throw new ConcurrentModificationException();
|
||||
|
||||
removeNode(last);
|
||||
last = null;
|
||||
|
|
Loading…
Add table
Reference in a new issue