RFR: 8300237: Minor improvements in MethodHandles [v3]

Sergey Tsypanov stsypanov at openjdk.org
Tue Jan 17 18:10:39 UTC 2023


On Tue, 17 Jan 2023 15:30:12 GMT, Rémi Forax <forax at openjdk.org> wrote:

>> Precious little method handle use in lambda bootstrap since JDK 11. Though I agree with the sentiment - having fixed a number of bootstrap issues in the past - `MethodHandles` is a small step up the abstraction ladder and the code in particular already uses a number of method refs and lambdas.
>
> ok, two small changes,
> -  formatting: usually the method call in a stream are aligned with the '.' at the beginning
>     ```
>      stream
>        .filter(...)
>       .map(...)
>    ```
>    instead of at the end.
> 
> - the reduce is a max(),
>   `max(Comparator.comparingInt(List::size))`

@forax formatting is fixed. As of max() I think we can improve this even more by hoisting max() before calling ptypes()

-------------

PR: https://git.openjdk.org/jdk/pull/12025


More information about the core-libs-dev mailing list