vladimir 2002/12/23 13:25:46
Modified: java/src/org/apache/xindice/xml/sax SAXEventGenerator.java
Log:
Fix a bug (no more info, sorry
@@ -320,7 +320,7 @@
if (nsMapCount >= mappedPrefixes.length) {
String[] newBuf = new String[mappedPrefixes.length + XMLNS_MAP_INCREMENT];
- System.arraycopy(mappedPrefixes, 0, newBuf, 0, mappedPrefixes.length);
+ System.arraycopy(mappedPrefixes, 0, newBuf, 0, newBuf.length);
mappedPrefixes = newBuf;
}
Uh? I changed that some time ago, since it was broken, now why are you reverting it (and with "no more info" as an explanation)? This implementation is broken, try it with a document containing a *lot* of namespaces and you will see it: newBuf has more elements than mappedPrefixes (it's mappedPrefixes.length + 5 IIRC), you are asking arraycopy to copy newBuf.length elements from mappedPrefixes, but mappedPrefixes *won't* be that long, by definition. All you get is an IndexOutOfBounds with this setup.
Please consider reverting it back, or explaining me the reasons for this change. Of course, I might well be wrong. :-)
Ciao,
-- Gianugo
