[9] RFR (S) 8050173: Generalize BMH.copyWith API to all method handles

Paul Sandoz paul.sandoz at oracle.com
Fri Sep 5 13:46:38 UTC 2014


On Sep 5, 2014, at 3:15 PM, Vladimir Ivanov <vladimir.x.ivanov at oracle.com> wrote:
>> 
>> Looks good, just one comment.
>> 
>> MethodHandles.restrictReceiver
>> 
>> This method has:
>> 
>> 1578         private MethodHandle restrictReceiver(MemberName method, MethodHandle mh, Class<?> caller) throws IllegalAccessException {
>> ...
>> 1589             assert(mh instanceof DirectMethodHandle);  // DirectMethodHandle.copyWith
>> 
>> Why not make the second parameter be "DirectMethodHandle mh" ?
> Good point! While prototyping this I spotted uncovered corner case (restrict a receiver on a MH with bound caller).
> 
> Updated webrev:
>  http://cr.openjdk.java.net/~vlivanov/8050173/webrev.01/
> Diff:
>  http://cr.openjdk.java.net/~vlivanov/8050173/webrev.00.01/
> 
> Reordered restrictReceiver and maybeBindCaller operations.
> 

Looks good,
Paul.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mail.openjdk.java.net/pipermail/mlvm-dev/attachments/20140905/3890d483/signature.asc>


More information about the mlvm-dev mailing list