Skip to content
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

Element.getChildren() javadoc out of date #131

skiwi2 opened this issue Apr 23, 2014 · 0 comments

Element.getChildren() javadoc out of date #131

skiwi2 opened this issue Apr 23, 2014 · 0 comments


Copy link

@skiwi2 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);
  • 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
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.