Skip to content

MINOR: fix error message#9730

Merged
mjsax merged 2 commits into
apache:trunkfrom
mjsax:minor-error-msg
Dec 18, 2020
Merged

MINOR: fix error message#9730
mjsax merged 2 commits into
apache:trunkfrom
mjsax:minor-error-msg

Conversation

@mjsax

@mjsax mjsax commented Dec 11, 2020

Copy link
Copy Markdown
Member

Got the accumulator lambda wrong in #9688

Call for review @ableegoldman

@mjsax mjsax added the streams label Dec 11, 2020
throw new AssertionError(
"expected result: " + expectedResult.stream().map(KeyValue::toString).reduce("", (kv, str) -> str.isEmpty() ? kv : str + ", " + kv) +
"\nreceived records: " + result.stream().map(KeyValue::toString).reduce("", (kv, str) -> str.isEmpty() ? kv : str + ", " + kv),
"expected result: " + expectedResult.stream().map(KeyValue::toString).reduce("", (str, kv) -> str.isEmpty() ? kv : str + ", " + kv) +

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about using .collect(Collectors.joining(",")?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still a noob using the JavaStream API... Does this only use the separator if there are more than one element?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this only use the separator if there are more than one element?

yep

@chia7712 chia7712 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mjsax +1 to latest commit :)

@mjsax
mjsax merged commit b689507 into apache:trunk Dec 18, 2020
@mjsax
mjsax deleted the minor-error-msg branch December 18, 2020 01:16
mjsax added a commit that referenced this pull request Dec 18, 2020
Reviewers: A. Sophie Blee-Goldman <sophie@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>
@mjsax

mjsax commented Dec 18, 2020

Copy link
Copy Markdown
Member Author

Merged to trunk and cherry-picked to 2.7 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants