[jdom-interest] NoSuch*Exceptions in JDOM

Thomas M. Sasala tsasala at hifusion.com
Wed Jun 28 04:48:01 PDT 2000


Patrick Dowler wrote:
> 
> On Fri, 23 Jun 2000, you wrote:
> > I suggest a new method following the java.util.Properties pattern
> > meets the underlying need and solves your problem. Namely:
> >
> >   public Element getChild(String aString, Object defaultValue)
> >
> > It does not throw a NoSuchElementException and can return
> > a null, "" or 0 as appropriate. -GreatOne--
> 
> This seems to go totally against what most people are trying to do. If
> you call getChild, you really want to know if the child was there or not.
> Having a default value returned doesn't seem too useful for anyone...
> correct me if I'm wrong on that :-)
> 
> For something simple like Properties, it makes sense. For a child
> element, you could be talking about a whole structure ( the "body"
> child of an "html" Element, for example).
> 
> Did this ever get resolved? What is the current standing of returning
> null vs. throwing NoSuchElementException from getChild? I got the
> feeling last week that we have not reached any consensus on this...
> 
> I'm still for a null return value.


	Me too....

> --
> 
> Patrick Dowler
> Canadian Astronomy Data Centre
> 
> _______________________________________________
> 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