INRIA / INRIA/spoon

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

Open
#6,703 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
2k
Forks
392
Avg merge
11h 24m
Merged PRs (30d)
36

Description

### 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

```Java

```

### Source code for your Spoon processing

```Java

```

### Actual output

```Java

```

### Expected output

```Java

```

### Spoon Version

11.3.0

### JVM Version

Java17

### What operating system are you using?

Linux

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.