Skip to content

Element.getChildren() javadoc out of date #131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
skiwi2 opened this issue Apr 23, 2014 · 0 comments
Closed

Element.getChildren() javadoc out of date #131

skiwi2 opened this issue Apr 23, 2014 · 0 comments

Comments

@skiwi2
Copy link

skiwi2 commented Apr 23, 2014

The javadoc of Element.getChildren() is out of date, it seems to be carried over from JDOM 1.x:

  • Iterator itr = (currentElement.getChildren()).iterator();
  • while(itr.hasNext()) {
  • Element oneLevelDeep = (Element)itr.next();
  • List twoLevelsDeep = oneLevelDeep.getChildren();
  • // Do something with these children
  • }

I propose it to use generics and enhanced for-loop:
for (Element oneLevelDeep : currentElement.getChildren()) {
List twoLevelsDeep = oneLevelDeep.getChildren();
//do stuff
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants