RFR: 8364781: Re-examine DigitList digits resizing during parsing [v2]

Justin Lu jlu at openjdk.org
Fri Aug 8 23:28:48 UTC 2025


On Fri, 8 Aug 2025 22:35:29 GMT, Chen Liang <liach at openjdk.org> wrote:

>> Justin Lu has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Chen review - replace with ArraysSupport
>
> src/java.base/share/classes/java/text/DigitList.java line 157:
> 
>> 155:         if (count == digits.length) {
>> 156:             char[] data = new char[count > Integer.MAX_VALUE / 2 ?
>> 157:                     Integer.MAX_VALUE : count * 2];
> 
> I think you can use `ArraysSupport.newLength(count, 1, count)` instead.

Did not know we had that, thanks!

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26705#discussion_r2264122792


More information about the core-libs-dev mailing list