On Tue, 15 Jul 2025 20:24:22 GMT, Volkan Yazici <[email protected]> wrote:
>> src/java.base/share/classes/sun/nio/cs/ISO_8859_1.java line 201:
>>
>>> 199: int len = (dlen < slen) ? dlen : slen;
>>> 200: try {
>>> 201: int ret = len <= 0 ? 0 : encodeISOArray(sa, sp, da,
>>> dp, len);
>>
>> Moving the length correction into `encodeISOArray` would help other callers
>> too. (There's only 1 at the moment).
>
> I've tried to make the code such that wrapper functions contain nothing but
> argument checks. Moving `if (len <= 0) { return 0; }` logic to the wrapper
> function will introduce a behavior different than the one implemented by the
> intrinsic. @RogerRiggs, do you still prefer me to carry out this change?
The wrapper is the method actually called, the intrinsic `encodeISOArray0`
intrinsic would be inlined into it.
I don't have a compelling reason to change it, given the solitary caller.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25998#discussion_r2208599130