On Mon, 26 Oct 2020 15:45:00 GMT, Claes Redestad <redes...@openjdk.org> wrote:
>> Jorn Vernee has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Collapse lform get and update into single line >> >> Co-authored-by: Claes Redestad <claes.redes...@gmail.com> > > LGTM, pending CSR. > > A minor simplification suggested inline. I don't mind shorthands, but the existing idiom is shorter than advertised, a one-liner assuming the MH is already bound to a var: target = target.asType(target.type().changeReturnType(void.class)); The API has good short circuits already; no new objects are created if the MH is already void-returning. Perhaps this RFE could be adjusted to `MethodHandle::changeReturnType`? Then it could be used for dropping returns *or* casting them to other types. ------------- PR: https://git.openjdk.java.net/jdk/pull/866