palantir / palantir/conjure-java
Accept Stream<T> in collection-like builder fields
Open
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 39
- Forks
- 49
- Avg merge
- 8h 22m
- Merged PRs (30d)
- 32
Description
Since Conjure always makes a defensive copy and the element type may need conversion, accepting only Iterable<T> encourages creation of a "waste" copy:
Bean bean = Bean.builder()
.values(myValues.stream().map(Converter::convert).collect(toList()))
.build();
Instead, this could accept the stream directly, use .forEachOrdered and avoid the extra copy:
Bean bean = Bean.builder()
.values(myValues.stream().map(Converter::convert))
.build();
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is named. Start by locating the generator path that creates collection-like builder fields and read how Iterable inputs are handled; confirm the generated builders accept Stream and preserve ordered consumption without the caller's intermediate copy.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend-api-design
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100