RFR: 8332826: Make hashCode methods in ArraysSupport friendlier [v2]

Claes Redestad redestad at openjdk.org
Wed May 29 08:39:01 UTC 2024


On Wed, 29 May 2024 03:16:02 GMT, Chen Liang <liach at openjdk.org> wrote:

>> In fact, if I change it to `2`, the following tests will fail:
>> 
>>   - `jdk/jdk/classfile/Utf8EntryTest.java`
>>   - `jdk/java/util/zip/ZipCoding.java`
>>   - `jdk/java/text/Format/MessageFormat/MessageRegression.java`
>
> Indeed, the actual length passed at call site is `value.length >> 1` instead of `value.length`; this adjusted char-length carries on to `vectorizedHashCode` call.

Ah, sneaky. Might affect scores for the zero and one-char cases since the shift now happens unconditionally, but probably doesn't matter in practice.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19414#discussion_r1618456668



More information about the security-dev mailing list