dev@jax-ws.java.net

XMLStreamBufferException: is this really useful?

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Fri, 22 Sep 2006 17:45:22 -0700

Many methods of XMLStreamBuffer throws XMLStreamBufferException, which
is a checked exception.

So what happens in the JAX-WS RI most of the time is that we simply wrap
that to XMLStreamException or SAXException, depending on the context.
Sometimes, even when "the context" is clear, like:

   void XMLStreamBuffer.writeToXMLStreamWriter(XMLStreamWriter writer);

It still throws both XMLStreamException and XMLStreamBufferException.

This causes us to write a redundant try/catch block, which IMO makes the
code unnecessarily longer (and I think setting up try/catch block does
cost in terms of performance, too, although it's probably negligible.)

I wonder if we can go through XMLStreamBuffer and remove them as much as
possible.

-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com