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

OpenJDK Bug 100123 XMLDOMWriterImpl throws ArrayIndexOutOfBoundsException

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 7
    • Fix Version/s: 1.4.0
    • Component/s: xml
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      1.4
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Backports

        Description

        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");
            }
            }
        }

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: