On Thu, 1 Oct 2026 16:24:15 GMT, Jorn Vernee <[email protected]> wrote:

>> Yunbo Zhang has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   8367022: Parameterize invalid fold position tests
>
> src/java.base/share/classes/java/lang/invoke/MethodHandles.java line 5928:
> 
>> 5926:         int foldVals = rtype == void.class ? 0 : 1;
>> 5927:         boolean ok = foldPos >= 0 &&
>> 5928:                 foldPos <= targetType.parameterCount() - foldVals - 
>> foldArgs;
> 
> Also, I'm noticing now that the exception message is not correct for this 
> failure case. I think we should probably just eagerly throw an exception here 
> if this condition fails (with a message to that effect).

Thanks, fixed. 
An invalid position now throws IllegalArgumentException directly, with the 
position included in the message.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/32618#discussion_r4180449622

Reply via email to