[jdom-interest] NoSuch*Exceptions in JDOM

Kevin Regan kevinr at valicert.com
Fri Jun 16 11:48:02 PDT 2000


> 
> BTW, if getChild() were to return null on occasion, the people who like
> to
> chain a bunch of getChild calls together can still do it:
> 
> 	try
> 	{
> 		attr =
> el.getChild("foo").getChild("bar").getAttribute("id");
> 		// do something
> 	}
> 	catch (NullPointerException ex)
> 	{
> 		// ooops, one of the gets returned null
> 	}
> 

This calls is ambiguous: was there a bug in the code, or
did getChild return a null?

--Kevin





More information about the jdom-interest mailing list