[jdom-commits] CVS update: jdom/samples
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/samples
In directory jools.org:/tmp/cvs-serv5494/samples
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: Count.java Status: Up-to-date
Working revision: 1.7 Thu Apr 11 06:19:10 2002
Repository revision: 1.7 /home/cvspublic/jdom/samples/Count.java,v
jdom_1_0_b8 (revision: 1.6)
jdom_1_0_b8_rc1 (revision: 1.6)
jdom_prefilter (revision: 1.6)
jdom_1_0_b7 (revision: 1.5)
jdom_1_0_b6 (revision: 1.4)
More information about the jdom-commits