-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Collectors.toMap
handling for streams (#938)
Fixes #934 The key new thing with the support here is we have further nesting. Rather than a `map` method, where the relevant lambda is passed directly: ```java stream.filter(foo -> foo.bar != null).map(foo -> foo.bar.baz) ``` In this case we have a `collect` call, which gets as its argument the result of `Collectors.toMap`, and the relevant lambdas are passed to `toMap`: ```java stream .filter(foo -> foo.bar != null) .collect(Collectors.toMap(foo -> foo.bar.baz, foo -> foo.bar.other)) ``` Supporting this requires some new types of logic in our streams handler (particularly because there are multiple relevant lambdas for a single `collect` call). We do also handle anonymous inner classes.
- Loading branch information
Showing
9 changed files
with
468 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.