aboutsummaryrefslogtreecommitdiff
path: root/libjava/gnu/xml/dom/DomNode.java
diff options
context:
space:
mode:
authorTom Tromey <tromey@gcc.gnu.org>2005-03-29 20:10:21 +0000
committerTom Tromey <tromey@gcc.gnu.org>2005-03-29 20:10:21 +0000
commit8d06274e61b7487079328bdb7a6417e79171271c (patch)
tree82c3d1612d87f4c67ff20739155d3645617ed760 /libjava/gnu/xml/dom/DomNode.java
parent1fff69c9a4ac6a18dcb45abbb311ae1e3e96c6e7 (diff)
downloadgcc-8d06274e61b7487079328bdb7a6417e79171271c.zip
gcc-8d06274e61b7487079328bdb7a6417e79171271c.tar.gz
gcc-8d06274e61b7487079328bdb7a6417e79171271c.tar.bz2
[multiple changes]
2005-03-26 Chris Burdess <dog@gnu.org> * gnu/xml/dom/DomNode.java (notifyNode): grow listener array as required. 2005-03-13 Michael Koch <konqueror@gmx.de> * gnu/xml/aelfred2/XmlParser.java: Fixed typo. 2005-03-11 Chris Burdess <dog@gnu.org> * gnu/xml/aelfred2/SAXDriver.java: Corrected bug handling URI warnings. 2005-02-27 Chris Burdess <dog@gnu.org> * gnu/xml/aelfred2/JAXPFactory.java, gnu/xml/aelfred2/SAXDriver.java, gnu/xml/aelfred2/XmlParser.java, gnu/xml/aelfred2/XmlReader.java: Applied GNU Classpath source code formatting conventions. Replaced arrays of Object with struct-like classes for easier maintainability. Made SAXDriver.stringInterning package private to allow access from XmlParser inside the loop without a method call overhead. 2005-03-11 Chris Burdess <dog@gnu.org> * gnu/xml/aelfred2/SAXDriver.java: Corrected bug handling URI warnings. From-SVN: r97200
Diffstat (limited to 'libjava/gnu/xml/dom/DomNode.java')
-rw-r--r--libjava/gnu/xml/dom/DomNode.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/libjava/gnu/xml/dom/DomNode.java b/libjava/gnu/xml/dom/DomNode.java
index 20a62c5..f763adf 100644
--- a/libjava/gnu/xml/dom/DomNode.java
+++ b/libjava/gnu/xml/dom/DomNode.java
@@ -1686,13 +1686,16 @@ public abstract class DomNode
{
continue;
}
- if (count < notificationSet.length)
+ if (count >= notificationSet.length)
{
- notificationSet[count++] = rec;
+ // very simple growth algorithm
+ int len = Math.max(notificationSet.length, 1);
+ ListenerRecord[] tmp = new ListenerRecord[len * 2];
+ System.arraycopy(notificationSet, 0, tmp, 0,
+ notificationSet.length);
+ notificationSet = tmp;
}
- else
- // XXX fire up some cheap growth algorithm
- throw new RuntimeException("Event notification set size exceeded");
+ notificationSet[count++] = rec;
}
// Notify just those listeners