Fix bug of IndexOutOfRangeException for

function query(query, text) {}


git-svn-id: svn://10.0.0.236/trunk@68401 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
norris%netscape.com
2000-05-05 16:38:16 +00:00
parent a6e4aa1c6a
commit 9eeb86c316
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;
}
}