Skip to content

[Bug]: CtIterator documentation does not match the the implementation. #6703

Open

Description

@strRM

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions