[jdom-interest] NoSuch*Exceptions in JDOM
Kevin Regan
kevinr at valicert.com
Fri Jun 16 11:18:38 PDT 2000
I was on the fence until this example. I'd go with
NoSuch*Exceptions...
--Kevin
On Fri, 16 Jun 2000, bob wrote:
> > if NoSuchElementException is designed, simply to eliminate the need to
> > check for a null, then I would suggest that using a List is just as
> heavy
> > weight.
>
> It typically for people doing long paths.
>
> elem.getChild("foo").getChild("bar").getChild("baz);
>
> You can wrap that with a single try/catch for the
> entire chain. Otherwise, you have to wrap each
> getChild() call with an "if (elem != null)". Which
> turns into a lot of typing.
>
> Also, Exception handling in Java isn't heavy-weight.
> It's computationally similar to a normal return, with
> an 'isAnException' flag set. Remember that Java isn't
> compiled C++ code.
>
> -bob
>
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@you
> rhost.com
>
More information about the jdom-interest
mailing list