palantir / palantir/conjure-java

Accept Stream<T> in collection-like builder fields

Open
#519 3 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.