Skip to content

[Discussion] CtQuery Improvements #4756

Open
@bolu61

Description

@bolu61

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 CtConsumers 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:

Stream<CtElement> 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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions