Re: Nested exceptions in SAX
Chris Burdess <[email protected]> Thu, 23 Feb 2006 19:23:50 +0000
| Newsgroups | gmane.text.xml.sax.devel |
|---|---|
| Message-ID | <[email protected]> |
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--Apple-Mail-6--793326227
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8; delsp=yes; format=flowed
David Megginson wrote:
>> the proposed fix for this is simply to add
>>
>> public Throwable getCause() {
>> return exception;
>> }
>>
>> to org.xml.sax.SAXException.
>>
>> I don't believe that this introduces any compatibility problems
>> (getCause() is already inherited from Throwable).
>
> I have no objection to this change -- we can batch it up with any
> other minor fixes and put out a maintenance release. I have two
> questions for other SAX users:
>
> 1. Can you anticipate any problems this change might introduce?
It would silently break code that was using initCause but wasn't =20
using the constructor with exception, e.g.
throw (SAXException) new SAXException(message).initCause=20
(originalException);
because the exception set by the programmer will then be ignored. =20
This is an issue with other APIs developed prior to 1.4, =20
MessagingException and ServletException for instance. Unfortunately, =20
because of the initCause contract and the fact that the cause =20
exception is private, it is not possible simply to call initCause in =20
the constructor with exception, since a subsequent call to initCause =20
(which would have been successful prior to this) will then raise =20
IllegalStateException.
> 2. Are there other similar, minor problems you'd like to see addressed
> in a maintenance release?
Now you come to mention it, there is
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D23342
--=20
=E7=8A=AC Chris Burdess
"They that can give up essential liberty to obtain a little safety
deserve neither liberty nor safety." - Benjamin Franklin
--Apple-Mail-6--793326227
content-type: application/pgp-signature; x-mac-type=70674453;
name=PGP.sig
content-description: This is a digitally signed message part
content-disposition: inline; filename=PGP.sig
content-transfer-encoding: 7bit
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (Darwin)
iD4DBQFD/gvH3qhNIztqvgMRAtQ6AJjAr1WHiOTkN3uxVIcHmaG4ALfvAJ9TUcc9
KRNcZLY92lqWulHlZsCNYQ==
=IkAR
-----END PGP SIGNATURE-----
--Apple-Mail-6--793326227--
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
List: sax-devel, [email protected]
See: http://www.saxproject.org/
https://lists.sourceforge.net/lists/listinfo/sax-devel