On Wed, 22 Jun 2022 21:29:50 GMT, Andrey Turbanov <aturba...@openjdk.org> wrote:
>> Instead of separate ConcurrentHashMap.get call, we can use result of >> previous putIfAbsent call. > > Andrey Turbanov has updated the pull request incrementally with one > additional commit since the last revision: > > 8288723: Avoid redundant ConcurrentHashMap.get call in java.time > use computeIfAbsent where lambda could be short and static src/java.base/share/classes/java/time/format/DateTimeTextProvider.java line 312: > 310: private Object findStore(TemporalField field, Locale locale) { > 311: Entry<TemporalField, Locale> key = createEntry(field, locale); > 312: return CACHE.computeIfAbsent(key, e -> createStore(e.getKey(), > e.getValue())); If `createStore` can be static, the call site will only have to construct a constant lambda than having to pass `this` to construct a new instance on every call ------------- PR: https://git.openjdk.org/jdk/pull/9208