Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6909336

OpenJDK Bug 100123 XMLDOMWriterImpl throws ArrayIndexOutOfBoundsException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 7
    • xml
    • 1.4
    • generic
    • generic
    • Verified

        https://bugs.openjdk.java.net/show_bug.cgi?id=100123

        Somebody ought to be very ashamed of this. XMLDOMWriterImpl cannot write more
        that 20 nested elements without throwing an ArrayIndexOutOfBoundsException.

        The following code demonstrates the problem:

        import javax.xml.stream.*;
        import javax.xml.transform.dom.*;
        import org.w3c.dom.*;
        import org.w3c.dom.bootstrap.*;

        public class DOMWriter {
            public static void main(String[] args)
            throws Exception {
            Document doc = DOMImplementationRegistry
                .newInstance()
                .getDOMImplementation("XML 3.0")
                .createDocument("", "root", null);

            XMLStreamWriter xsw = XMLOutputFactory
                .newInstance()
                .createXMLStreamWriter(new DOMResult(doc.getDocumentElement()));

            for (int i = 0; i < 30; ++i) {
                xsw.writeStartElement("nested");
            }
            }
        }

              joehw Joe Wang
              joehw Joe Wang
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: