<i18n dev> RFR: 8176706: Additional Date-Time Formats [v2]

Naoto Sato naoto at openjdk.java.net
Tue Feb 8 18:47:07 UTC 2022


On Mon, 7 Feb 2022 21:22:12 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> Naoto Sato has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Modified per suggestions on the PR
>
> src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java line 5162:
> 
>> 5160: 
>> 5161:                 formatter = new DateTimeFormatterBuilder().appendPattern(pattern).toFormatter(locale);
>> 5162:                 DateTimeFormatter old = FORMATTER_CACHE.putIfAbsent(key, formatter);
> 
> .computeIfAbsent(key, () -> {....}) might be a bit cleaner/clearer here and avoid the race a few lines of code below. (a slight improvement in old code).

Good point. Changed to `computeIfAbsent()`.

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

PR: https://git.openjdk.java.net/jdk/pull/7340


More information about the i18n-dev mailing list