OSDN Git Service

* java/util/IdentityHashMap.java (get): Fix off-by-one error.
authorjsturm <jsturm@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 21 Aug 2001 14:24:48 +0000 (14:24 +0000)
committerjsturm <jsturm@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 21 Aug 2001 14:24:48 +0000 (14:24 +0000)
(put): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45077 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 3b1d8cb..b5f0dee 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 374f09e..5a1d76b 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;