[jdom-interest] My remarks about JDOM B9

Elliotte Rusty Harold elharo at metalab.unc.edu
Fri Apr 18 04:20:42 PDT 2003


At 9:06 AM +0200 4/18/03, phil at triloggroup.com wrote:


>When catching that exception, do you really care about the 
>IOException? I don't think so, you just want to recover from
>the error. And, even in case you need it, you're still able to query 
>the embbeded exception (getCause()).

Yes, I do. I want to treat I/O errors very differently than a 
well-formedness error which is what JDOMException would indicate. For 
example, if In download an RSS document and its malformed I might 
skip it until tomorrow, but if there's a network glitch that prevents 
me from connecting I might try again in 5 minutes.

>>From a user perspective, declaring multiple exceptions that do not 
>>inherit from a common base (other that exception)
>often lead to code like:
>      try {
>      } catch( Exception e ) {
>          //....
>      }
>which catches all exceptions, including RuntimeException! This is 
>definitively worse

I don't write code like that, and if someone does they're violating 
Java conventions.
-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|           Processing XML with Java (Addison-Wesley, 2002)          |
|              http://www.cafeconleche.org/books/xmljava             |
| http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA  |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.cafeconleche.org/    |
+----------------------------------+---------------------------------+



More information about the jdom-interest mailing list