RFR: 8363972: Loose matching of dash/minusSign in number parsing [v2]
Naoto Sato
naoto at openjdk.org
Thu Jul 31 22:11:55 UTC 2025
On Thu, 31 Jul 2025 20:55:01 GMT, Francesco Andreuzzi <duke at openjdk.org> wrote:
>> Naoto Sato has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Address review comments
>
> src/java.base/share/classes/java/text/DecimalFormatSymbols.java line 1002:
>
>> 1000:
>> 1001: if (loadNumberData(locale) instanceof Object[] d &&
>> 1002: d[0] instanceof String[] numberElements) {
>
> Should the size be validated here, before accessing `d[0]`?
This should be fine, as there would be no situation where empty array would be returned: https://github.com/openjdk/jdk/blob/724e8c076e1aed05de893ef9366af0e62cc2ac2b/src/java.base/share/classes/sun/util/locale/provider/LocaleResources.java#L223
I modified the `else` case, where the field was not initialized, btw.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26580#discussion_r2246478764
More information about the core-libs-dev
mailing list