From 7fb7568e63c3fe14af521de4699cb37898923ca7 Mon Sep 17 00:00:00 2001 From: tromey Date: Tue, 29 Mar 2005 20:10:21 +0000 Subject: 2005-03-26 Chris Burdess * gnu/xml/dom/DomNode.java (notifyNode): grow listener array as required. 2005-03-13 Michael Koch * gnu/xml/aelfred2/XmlParser.java: Fixed typo. 2005-03-11 Chris Burdess * gnu/xml/aelfred2/SAXDriver.java: Corrected bug handling URI warnings. 2005-02-27 Chris Burdess * 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 * gnu/xml/aelfred2/SAXDriver.java: Corrected bug handling URI warnings. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97200 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/gnu/xml/dom/DomNode.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'libjava/gnu/xml/dom') diff --git a/libjava/gnu/xml/dom/DomNode.java b/libjava/gnu/xml/dom/DomNode.java index 20a62c53ba5..f763adf995a 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 -- cgit v1.2.3