<i18n dev> RFR: 8349000: Performance improvement for Currency.isPastCutoverDate(String) [v2]
Naoto Sato
naoto at openjdk.org
Mon Feb 3 18:08:46 UTC 2025
On Mon, 3 Feb 2025 12:47:15 GMT, Andrey Turbanov <aturbanov at openjdk.org> wrote:
>> Justin Lu has updated the pull request incrementally with one additional commit since the last revision:
>>
>> generalize format comment
>
> src/java.base/share/classes/java/util/Currency.java line 1182:
>
>> 1180: private static boolean isPastCutoverDate(String cutOver) {
>> 1181: return System.currentTimeMillis() >
>> 1182: LocalDateTime.parse(cutOver.trim(), DateTimeFormatter.ISO_LOCAL_DATE_TIME)
>
> Btw, do we really need this `trim()` call?
> It looks redundant. prop.date is result part of `m.group(4)` of this regexp:
> https://github.com/openjdk/jdk/blob/3f1d9b573546685215af06031656efe6f1429caf/src/java.base/share/classes/java/util/Currency.java#L255-L257
> `(\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2})`
>
> I don't see how it could contain whitespace characters on start or end.
That seems to be correct to me
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23374#discussion_r1939814234
More information about the i18n-dev
mailing list