On Tue, 6 Feb 2024 18:58:01 GMT, Claes Redestad <redes...@openjdk.org> wrote:

>> src/java.base/share/classes/java/io/ObjectInputStream.java line 3688:
>> 
>>> 3686:                         // avoid a redundant scan
>>> 3687:                         String utf = new String(buf, pos, 
>>> (int)utflen, StandardCharsets.ISO_8859_1);
>>> 3688:                         pos += (int)utflen;
>> 
>> Suggestion:
>> 
>>                         String utf = new String(buf, pos, ascii, 
>> StandardCharsets.ISO_8859_1);
>>                         pos += ascii;
>> 
>> Redundant casts
>
> I get warnings and build failures if I leave out those casts (`utflen` is a 
> `long`)

Ah, I meant to use the equivalent local variable int ascii, the return value of 
countPositives, to avoid these casts.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17734#discussion_r1480639568

Reply via email to