[jdom-commits] CVS update: jdom/src/java/org/jdom/input
cvs at jools.org
cvs at jools.org
Wed Apr 10 23:19:10 PDT 2002
Date: Thursday April 11, 2002 @ 2:19
Update of /home/cvspublic/jdom/src/java/org/jdom/input
In directory jools.org:/tmp/cvs-serv5494/src/java/org/jdom/input
Patch from elharo to improve how builders handle exceptions.
Warning: There's a lot of code that will need to change because of
this. It's an easy change though. Builder calls are now going
to need to catch IOException.
In his words:
I've attached patches for the four classes affected by the decision to
allow build() to throw IOException. I've made separate patch files for
each of the classes because my last mega-patch had troubles being
applied. The four files are:
All the tests that ran before still run after these four patches are
applied. This is going to affect a lot of client code, but in my initial
tests not as much as I originally expected.
The basic idea of these patches is to rationalize the excepiton
throwing. This patch does several things:
1. Allows IOExceptions to propagate unchanged from the builder.
2. Converts all SAXExceptions to JDOMExceptions
3. Removes a number of "throws Exception" and "throws IOException"
clauses where no exception was being thrown.
4. Changes some "throws Exception" and "throws IOException" clauses to
5. Allows unexpected runtime exceptions (e.g. NullPointerException) to
I think this makes sense. The basic idea is that SAXBuilder should throw
an IOException for an I/O error, a JDOMException for an XML problem, and
that unexpected runtime exceptions should not be hidden. I fully expect
that this will break existing code, but the sooner we do it the less
pain it will cause. As always more testing is appreciated.
I also updated the Count sample which needed to catch IOException.
File: no file SAXBuilder.java Status: Needs Checkout
Working revision: 1.65 Thu Apr 11 06:19:10 2002
Repository revision: 1.65 /home/cvspublic/jdom/src/java/org/jdom/input/SAXBuilder.java,v
jdom_1_0_b8 (revision: 1.64)
jdom_1_0_b8_rc1 (revision: 1.64)
jdom_prefilter (revision: 1.59)
jdom_1_0_b7 (revision: 1.53)
jdom_1_0_b6 (revision: 1.34)
start (revision: 18.104.22.168)
jdom (branch: 1.1.1)
File: no file SAXHandler.java Status: Needs Checkout
Working revision: 1.40 Thu Apr 11 06:19:10 2002
Repository revision: 1.40 /home/cvspublic/jdom/src/java/org/jdom/input/SAXHandler.java,v
jdom_1_0_b8 (revision: 1.39)
jdom_1_0_b8_rc1 (revision: 1.38)
jdom_prefilter (revision: 1.27)
jdom_1_0_b7 (revision: 1.18)
More information about the jdom-commits