ValueConversion.unbox* fixes(?)
John Rose
john.r.rose at oracle.com
Wed Jan 12 17:54:05 PST 2011
On Jan 12, 2011, at 3:31 AM, Christian Thalinger wrote:
>> If you want to convert an int to a short, you can use explicitCastArguments.
>>
>> MethodHandle mh1 = MethodHandles.identity(int.class);
>> MethodHandle mh2 = MethodHandles.explicitCastArguments(mh1, MethodType.methodType(short.class, int.class));
>> short s = (short) mh2.invokeExact(123);
>
> No, that also results in the same exception (with b124).
The implementation of convertArguments and explicitCastArguments both need work to conform to the final API specification. You are finding real bugs in them.
I am surprised that invokedynamic gave you a different result.
The short-to-int path (the reverse of the above) should work even now, but maybe something got broken. These unit tests are important! :-)
-- John
More information about the mlvm-dev
mailing list