On Tue, 25 Feb 2025 22:08:33 GMT, Chen Liang <li...@openjdk.org> wrote:

>> src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java line 2241:
>> 
>>> 2239:         var form = constantForm(basicType);
>>> 2240: 
>>> 2241:         if (type.isPrimitive()) {
>> 
>> I think you could simplify this using `Wrapper.forBasicType`; all variants 
>> should be able to use `wrapper.convert`
>
> The cast is not performed if the `type` is an interface; this is a behavioral 
> disparity with the old `value = ptype.cast(value);` in `insertArguments`.

Sure, we'd need an explicit `cast` in the `OBJECT` case and that would be a bit 
redundant. Might still amount to a code simplification.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/23706#discussion_r1982027617

Reply via email to