Fix bug of IndexOutOfRangeException for

function query(query, text) {}
This commit is contained in:
norris%netscape.com 2000-05-05 16:38:16 +00:00
parent 26d7203e07
commit 3300d508c9
2 changed files with 22 additions and 0 deletions

View File

@ -136,6 +136,17 @@ public class VariableTable {
if (i != null) {
itsVariables.removeElementAt(i.intValue());
itsVariableNames.remove(name);
Hashtable ht = new Hashtable(11);
Enumeration e = itsVariableNames.keys();
while (e.hasMoreElements()) {
Object k = e.nextElement();
Integer v = (Integer) itsVariableNames.get(k);
int v2 = v.intValue();
if (v2 > i.intValue())
v = new Integer(v2 - 1);
ht.put(k, v);
}
itsVariableNames = ht;
}
}

View File

@ -136,6 +136,17 @@ public class VariableTable {
if (i != null) {
itsVariables.removeElementAt(i.intValue());
itsVariableNames.remove(name);
Hashtable ht = new Hashtable(11);
Enumeration e = itsVariableNames.keys();
while (e.hasMoreElements()) {
Object k = e.nextElement();
Integer v = (Integer) itsVariableNames.get(k);
int v2 = v.intValue();
if (v2 > i.intValue())
v = new Integer(v2 - 1);
ht.put(k, v);
}
itsVariableNames = ht;
}
}