RFR[9]:Fix java/lang/invoke/MethodHandleImpl's use of Unsafe.defineAnonymousClass()

Paul Sandoz paul.sandoz at oracle.com
Fri May 13 08:39:10 UTC 2016


> On 13 May 2016, at 09:13, shilpi.rastogi at oracle.com wrote:
> 
> Thank you Vladimir for comments.
> 
> Please review updated webrev http://cr.openjdk.java.net/~srastogi/8149574/webrev.09/
> 

Just one minor comment (last one i promise!):

1140                 MethodHandle vamh = prepareForInvoker(MH_checkCallerClass);
1141                 Object ok = bccInvoker.invokeExact(vamh, new Object[]{hostClass, bcc});
1142                 assert((boolean)ok);

If you wanna keep that assert I think it would be better to state:

  assert Boolean.TRUE.equals(ok) : ok;

since the cast could theoretically result in an NPE rather than an AE.

Paul.




More information about the core-libs-dev mailing list