[jdom-interest] Re: NoSuch*Exceptions

Jean-Henri Duteau jeand at telusplanet.net
Thu Jul 13 11:01:26 PDT 2000

At 10:48 AM 7/13/00 -0600, you wrote:
>I would compare it more with java.util.Properties.  There, the load 
>method throws an exception if an error occurs during input, but the 
>getProperty method (asking for something by name!) returns null if 
>the property isn't there.
>You can argue that this is poor design, but it's certainly idiomatic -
>it pervades all the core APIs.  (The primary reason, I'm sure, being
>that a lot of these are built on Hashtable or HashMap, which returns
>null if no mapping for a key is found.)  Since it's idiomatic, an API
>in a different style will be harder to understand.

Oh and now Steve makes an excellent counterpoint!!  Hashtables, Properties are widely used Java classes and so the concept of returning null when you ask for something by name that doesn't exist is something that all Java programmers will understand.

This is why I sat in the weeds and watched the discussion.  But now that it's been decided, let's all get back to making this API the easiest and quickest Java XML API.  Right?


More information about the jdom-interest mailing list