Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support safety passthrough on several streamlike methods #2174

Merged
merged 2 commits into from
Apr 4, 2022

Conversation

carterkozak
Copy link
Contributor

==COMMIT_MSG==
Support safety passthrough on several streamlike methods
==COMMIT_MSG==

@changelog-app
Copy link

changelog-app bot commented Apr 4, 2022

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

Support safety passthrough on several streamlike methods

Check the box to generate changelog(s)

  • Generate changelog entry

"min",
"max",
"findFirst",
"findAny"));
Copy link
Contributor

@fawind fawind Apr 4, 2022

Choose a reason for hiding this comment

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

Shouldn't this be every instance method on Stream that returns another Stream or even 'Collection'? Maybe we can list those methods using reflection instead of listing them manually?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not quite, the list does not include map/flatMap/mapTo* because those methods may modify the safety of a stream. e.g. streamOfUnsafeObject.map(unsafeObject -> unsafeObject.getSafeField()) is safe. Lambda handling for this sort of thing is super duper tough though, and I'm still trying to figure out the best way to do it.

Copy link
Contributor

@fawind fawind left a comment

Choose a reason for hiding this comment

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

Looks good!

@bulldozer-bot bulldozer-bot bot merged commit 2221072 into develop Apr 4, 2022
@bulldozer-bot bulldozer-bot bot deleted the ckozak/streamlike_passthrough branch April 4, 2022 18:57
@svc-autorelease
Copy link
Collaborator

Released 4.96.0

bulldozer-bot bot pushed a commit to palantir/witchcraft-api that referenced this pull request Apr 4, 2022
###### _excavator_ is a bot for automating changes across repositories.

Changes produced by the roomba/latest-baseline-oss check.

# Release Notes
## 4.96.0
| Type | Description | Link |
| ---- | ----------- | ---- |
| Improvement | Support safety passthrough on several streamlike methods | palantir/gradle-baseline#2174 |



To enable or disable this check, please contact the maintainers of Excavator.
This was referenced Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants