[jdom-interest] DataConversionException javadoc and other issues

Jason Hunter jhunter at acm.org
Thu May 16 14:49:12 PDT 2002


Hmm, you seem to be arguing both sides here.

I think the reason we have DCE is because att.getBooleanValue() doesn't
make much sense to throw an NFE.

-jh-

Elliotte Rusty Harold wrote:
> 
> The Javadoc for the DataConversionException constructor (see
> http://www.jdom.org/docs/apidocs/org/jdom/DataConversionException.html)
> is very misleading. It has nothing to do with missing attributes, and
> everything to do with a string not being able to be converted to a number.
> 
> I was just going to submit a patch, but then I began to wonder whther we
> still needed this exception class at all. It is only thrown, as near as
> I can see, by four methods in Attribute: getIntValue(), getFloatValue(),
> getDoubleValue(), getLongValue. If getIntValue() or getFloatValue(),
> etc. fail the natural response is a NumberFormatException. Would it be
> better to throw that and delete DataConversionException completely?
> 
> The big difference is that DataConversionException is checked and
> NumberFormatException is not. I think that this case  does satisfy the
> criterion for checked excepitons that, (following Bloch) " the
> exceptional condition cannot be prevented by proper use of the API /and/
> the programmer using the API can take some useful action once confronted
> with the exception"
> 
> Thoughts?
> 
> --
> +-----------------------+------------------------+-------------------+
> | Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
> +-----------------------+------------------------+-------------------+
> |           The XML Bible, 2nd Edition (IDG Books, 2001)             |
> |             http://www.cafeconleche.org/books/bible2/              |
> |   http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/   |
> +----------------------------------+---------------------------------+
> |  Read Cafe au Lait for Java News:   http://www.cafeaulait.org/     |
> |  Read Cafe con Leche for XML News:  http://www.cafeconleche.org/   |
> +----------------------------------+---------------------------------+
> 
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com



More information about the jdom-interest mailing list