# HG changeset patch # User vlivanov # Date 1362095417 -14400 # Node ID 20f287fec09fc29ea83222ed4f7c7d53e67a2089 # Parent f098e2297ff1248ecfa821bd6a8d61f9a105d656 8009049: Better method handle binding Reviewed-by: jrose, twisti, jdn diff -r f098e2297ff1 -r 20f287fec09f src/share/classes/sun/invoke/util/Wrapper.java --- a/src/share/classes/sun/invoke/util/Wrapper.java Wed Feb 27 13:58:55 2013 -0800 +++ b/src/share/classes/sun/invoke/util/Wrapper.java Fri Mar 01 03:50:17 2013 +0400 @@ -456,6 +456,9 @@ // If the target type is an interface, perform no runtime check. // (This loophole is safe, and is allowed by the JVM verifier.) // If the target type is a primitive, change it to a wrapper. + assert(!type.isPrimitive()); + if (!type.isInterface()) + type.cast(x); @SuppressWarnings("unchecked") T result = (T) x; // unchecked warning is expected here return result;