ValueConversion.unbox* fixes(?)
Christian Thalinger
christian.thalinger at oracle.com
Thu Jan 13 01:25:56 PST 2011
On Jan 13, 2011, at 2:54 AM, John Rose wrote:
> 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! :-)
Yeah, I want them in! -- Christian
More information about the mlvm-dev
mailing list