db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Rall <...@finemaltcoding.com>
Subject Re: IOException -> SAXException (was: Developer communication)
Date Sat, 02 Aug 2003 00:07:22 GMT
"Henning P. Schmiedehausen" <hps@intermeta.de> writes:

> Martin Poeschl <mpoeschl@marmot.at> writes:
> >hmmmm .... so let's look at the sources at sax.sf.net
> >    *public* InputSource resolveEntity (String publicId, String systemId)
> >	*throws* IOException, SAXException
> >    {
> >	*return* *null*;
> >    }
> >the IOException was introduced in sax 2.0 ..
> Martin,
> this is an _IMPLEMENTATION_. An implementation is allowed to leave
> exceptions out which are defined in the method. The only valid thing
> is the INTERFACE, which defined the signature of the method.
> And in my source of the the JDK 1.4.1:
> % less org/xml/sax/EntityResolver.java
> [...]
>     public abstract InputSource resolveEntity (String publicId,
>                                                String systemId)
>         throws SAXException, IOException;
> [...]
> q.e.d.
> >i prefere to keep the change
> I beg to differ. I prefer to remove it, because it simply isn't
> necessary. :-)

I think Martin is talking about differences between the original SAX
and newer SAX2 APIs (though I was a bit thrown off at first by the
references).  The EntityResolver interface has been around since SAX1.
I searched around for a bit, and didn't find any handy JavaDoc for
SAX1.  I did notice that the old org.xml.sax.HandlerBase (deprecated
by SAX2) does not decl IOException in its throws clause (valid for its
implementation, but not in the generic case).  I finally located a RPM
claiming to contain the SAX 1.0.1 release.  Both its JavaDoc and its
bytecodes (shown below) claim that the EntityResolver interface throws
IOException.  I don't think we should worry about maintaining
backwards compat with anything less that SAX 1.0.1.

$ rpm -q sax
$ javap -classpath /usr/share/java/classes/sax.jar org.xml.sax.EntityResolver
Compiled from EntityResolver.java
public interface org.xml.sax.EntityResolver
    /* ACC_SUPER bit NOT set */
    public abstract org.xml.sax.InputSource resolveEntity(java.lang.String, java.lang.String)
throws org.xml.sax.SAXException, java.io.IOException;

Since DTDResolver's implementation does actually throw an IOException,
I would prefer that we make this clear in its throws declaration.

Daniel Rall

To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org

View raw message