Lists Home |
Date Index |
- From: David Brownell <firstname.lastname@example.org>
- To: David Megginson <email@example.com>
- Date: Sun, 02 Jan 2000 14:33:17 -0800
David Megginson wrote:
> Rajiv Mordani <Rajiv.Mordani@eng.sun.com> writes:
> > java.util.zip.ZipException deriving from IOException is
> > appropriate. It is related to i/o so it makes sense to have that.
Also, the only place it's documented to be thrown is in a constructor
which also throws IOException. I expect the documentation is missing
a fair number of uses though -- which often happens when an exception
inherits from another one.
> I'd be interested in a clear statement of the criteria for this
I doubt you'll get such a clear statement. Organizational politics
have come in, as well as sloppiness on the part of some developers.
That's not just at Sun; many organizations get that way for any
particular category of design decision you can identify.
I'll just say that questions get asked if an exception has strange
inheritance, which can permit it to masquerade as something it isn't,
and defining new categories of RuntimeException is really perceived
as undesirable. Increasingly, those questions need good answers if
such exceptions are expected to become parts of public APIs.
> -- you get a ZipException, presumably, because of an error
> in the format of the zip file you're reading from;
Curious example. java.util.zip.DataFormatException is what I'd
expect to get when faced with bad ZIP data. (Recalling some of
the chaos involved in seeing JDK 1.1 get ZIP/JAR support, it's
no surprise that its exception architecture seems pretty odd.)
That's not an IOException.
> you get a
> SAXException because of an error in the format of the XML file you're
> reading from.
Looking at the JDK 1.2 javadocs, I also see these data format style
exceptions, which don't derive from IOException:
org.omg.CORBA. ... several ...
As with XML format errors, higher layers won't usually see those;
they get morphed by intermediate layers into diagnostics that are
more task-relevant. (A few of those are RuntimeExceptions though.)
xml-dev: A list for W3C XML Developers. To post, mailto:firstname.lastname@example.org
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:email@example.com the following message;
To subscribe to the digests, mailto:firstname.lastname@example.org the following message;
List coordinator, Henry Rzepa (mailto:email@example.com)