Describe the bug
The documentation for CtIterator states that it is
A class to be able to iterate over the children elements in the tree of a given node, in depth-first order.
Either the documentation is wrong or the implementation is incorrect, because the iterator also reports the node on which the iterator is invoked.
This also causes an issue with CtElementImpl.descendantIterator(). I don't expect the calling node to be reported as a descendant of itself. At a minimum, this needs to be documented or the name of the function changed to something that reflects what it does, e.g., descendantOrSelfIterator.
Source code you are trying to analyze/transform
Source code for your Spoon processing
Actual output
Expected output
Spoon Version
11.3.0
JVM Version
Java17
What operating system are you using?
Linux
Describe the bug
The documentation for
CtIteratorstates that it isEither the documentation is wrong or the implementation is incorrect, because the iterator also reports the node on which the iterator is invoked.
This also causes an issue with
CtElementImpl.descendantIterator(). I don't expect the calling node to be reported as a descendant of itself. At a minimum, this needs to be documented or the name of the function changed to something that reflects what it does, e.g., descendantOrSelfIterator.Source code you are trying to analyze/transform
Source code for your Spoon processing
Actual output
Expected output
Spoon Version
11.3.0
JVM Version
Java17
What operating system are you using?
Linux