On Mon, 26 Oct 2020 15:18:08 GMT, Jorn Vernee <jver...@openjdk.org> wrote:

> Hi,
> 
> This patch adds a `dropReturn` combinator to `MethodHandles` that can be used 
> to create a new method handle that drops the return value, from a given 
> method handle. Similar to the following code:
> 
> MethodHandle target = ...;
> Class<?> targetReturnType = target.type().returnType();
> if (targetReturnType != void.class)
>     target = filterReturnValue(target, empty(methodType(void.class, 
> targetReturnType))); 
> // use target
> 
> But as a short-hand.
> 
> Thanks,
> Jorn
> 
> CSR link: https://bugs.openjdk.java.net/browse/JDK-8255398

This pull request has now been integrated.

Changeset: b8d4e02c
Author:    Jorn Vernee <jver...@openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/b8d4e02c
Stats:     91 lines in 2 files changed: 91 ins; 0 del; 0 mod

8255374: Add a dropReturn MethodHandle combinator

Reviewed-by: redestad

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

PR: https://git.openjdk.java.net/jdk/pull/866

Reply via email to