[jdom-interest] B9 and hasChildren( ) deprecation

Rolf Lear rlear at algorithmics.com
Tue Apr 15 04:02:41 PDT 2003


How about using:

if (anElement.getChildren().isEmpty()) {

Rolf

-----Original Message-----
From: Shaun Smith [mailto:shauns at pixology.com]
Sent: Tuesday, April 15, 2003 6:46 AM
To: 'jdom-interest at jdom.org'
Subject: [jdom-interest] B9 and hasChildren( ) deprecation


Hi, 
I have just moved over to the B9 codebase from B7 (had to skip B8 due to
that appalling memory leak in 1.4.1), and am a little surprised to find that
hasChildren( ) has been deprecated.

I have had a search through the archives, and found a snippet of
converstaion between Jason and Elliotte where it's deprecation is discussed
in performance terms.

I vote for the reinstatement of the method, as think it improves the
readability of client code:

if( ! anElement.hasChildren( ) )

compared to:

if( 0 == anElement.getChildren( ).size( ) )

Other than that, and the addition of the IOException to the SAXBuilder
method signatures, everything else looks good for us with B9.

Cheers,
Shaun.
_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jdom.org/pipermail/jdom-interest/attachments/20030415/18eaba2d/attachment.htm


More information about the jdom-interest mailing list