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

DOMSerializerImpl.writeToString swallows nested exceptions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.3.0
    • 5.0
    • xml
    • 1.3
    • x86
    • linux
    • Verified

        com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl.writeToString(Node) has code like this:

        try {
          // ...
        } catch (RuntimeException e) {
          // ...
          throw new LSException(LSException.SERIALIZE_ERR, e.toString());
        } catch (IOException ioe) {
          // ...
          throw new DOMException(DOMException.DOMSTRING_SIZE_ERR, msg);
        }

        If there is a failure from some implementation-internal code, the stack trace will be lost.

        Observed because prepareForSerialization can throw NPE in

          next = node.getNextSibling();

        which I will report separately if I can figure out under which conditions it occurs.

        Observed in JDK 5 but JDK 7 seems to still have the same code.

              joehw Joe Wang
              jglick Jesse Glick (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: