IdentityHashMap.java (get): Fix off-by-one error.
authorJeff Sturm <jsturm@one-point.com>
Tue, 21 Aug 2001 14:24:48 +0000 (14:24 +0000)
committerJeff Sturm <jsturm@gcc.gnu.org>
Tue, 21 Aug 2001 14:24:48 +0000 (14:24 +0000)
* java/util/IdentityHashMap.java (get): Fix off-by-one error.
(put): Likewise.

From-SVN: r45077

libjava/ChangeLog
libjava/java/util/IdentityHashMap.java

index 3b1d8cb614ef421fec25e6f0bcce9c00cb42903a..b5f0dee882bb0596889b0c845bbcc56b303986b4 100644 (file)
@@ -1,3 +1,8 @@
+2001-08-21  Jeff Sturm  <jsturm@one-point.com>
+
+       * java/util/IdentityHashMap.java (get): Fix off-by-one error.
+       (put): Likewise.
+
 2001-08-20  Tom Tromey  <tromey@redhat.com>
 
        * java/awt/GridBagConstraints.java: Removed comment.
index 374f09e70d1e4bb0aa25c826471e7b908aa7e768..5a1d76b2941a07e76ac3ade2c3160f5f76855190 100644 (file)
@@ -172,7 +172,7 @@ public class IdentityHashMap extends AbstractMap
        if (table[h] == emptyslot)
          return null;
        h += 2;
-       if (h > table.length)
+       if (h >= table.length)
          h = 0;
        if (h == save)
          return null;
@@ -257,7 +257,7 @@ public class IdentityHashMap extends AbstractMap
            break;
          }
        h += 2;
-       if (h > table.length)
+       if (h >= table.length)
          h = 0;
        if (h == save)
          break;