[Discussion] CtQuery Improvements
- Dominant language
- Java
- Stars
- 2k
- Forks
- 392
- Avg merge
- 11h 24m
- Merged PRs (30d)
- 36
Description
I found that the API of `CtQuery` is somewhat limited. It functions essentially, as I understand it, similarly to a stream of `CtElements`, but is limited to consumption by `CtConsumer`s and collection into lists. I came across the discussion in #1070 and the limitations are justified by the fact that the implementation is based on `CtScanner`. Is there a reason that `CtScanner` must be used?
Now that there is #1986, the following is possible:
```java
Stream query = StreamSupport.stream(element.asIterable().spliterator(), false);
```
From what I understand, this can replace `CtQuery`. Can java stream replace the query API? If not what are the missing features or differing behaviours? Is it possible to reimplement/refactor `CtQuery` to use streams internally?
Contributor guide
Assessment
This issue has not been assessed yet.