diff -r cc682329886b -r b0610cd08440 src/share/jaxws_classes/com/sun/xml/internal/rngom/digested/DXMLPrinter.java --- a/src/share/jaxws_classes/com/sun/xml/internal/rngom/digested/DXMLPrinter.java Thu Sep 26 10:43:28 2013 -0700 +++ b/src/share/jaxws_classes/com/sun/xml/internal/rngom/digested/DXMLPrinter.java Fri Oct 04 16:21:34 2013 +0100 @@ -110,7 +110,11 @@ visitor.on(grammar); visitor.endDocument(); } catch (XMLWriterException e) { - throw (XMLStreamException) e.getCause(); + if (e.getCause() instanceof XMLStreamException) { + throw (XMLStreamException) e.getCause(); + } else { + throw new XMLStreamException(e); + } } } @@ -123,7 +127,11 @@ try { pattern.accept(visitor); } catch (XMLWriterException e) { - throw (XMLStreamException) e.getCause(); + if (e.getCause() instanceof XMLStreamException) { + throw (XMLStreamException) e.getCause(); + } else { + throw new XMLStreamException(e); + } } } @@ -136,7 +144,11 @@ try { nc.accept(ncVisitor); } catch (XMLWriterException e) { - throw (XMLStreamException) e.getCause(); + if (e.getCause() instanceof XMLStreamException) { + throw (XMLStreamException) e.getCause(); + } else { + throw new XMLStreamException(e); + } } }