From fd2190e4f61c8de825e622856f2c4009d1cc986c Mon Sep 17 00:00:00 2001 From: ZhouXY108 Date: Sat, 9 Sep 2023 11:07:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8B=BC=E5=86=99=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=9A=84=E6=96=B9=E6=B3=95=E5=90=8D=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zhouxy/plusone/commons/collection/AbstractMapWrapper.java | 2 +- .../plusone/commons/collection/SafeConcurrentHashMap.java | 2 +- .../xyz/zhouxy/plusone/commons/util/ConcurrentHashMapUtil.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/xyz/zhouxy/plusone/commons/collection/AbstractMapWrapper.java b/src/main/java/xyz/zhouxy/plusone/commons/collection/AbstractMapWrapper.java index 2ab3e56..4a95738 100644 --- a/src/main/java/xyz/zhouxy/plusone/commons/collection/AbstractMapWrapper.java +++ b/src/main/java/xyz/zhouxy/plusone/commons/collection/AbstractMapWrapper.java @@ -145,7 +145,7 @@ public abstract class AbstractMapWrapper mappingFunction) { if (this.map instanceof ConcurrentHashMap) { - return ConcurrentHashMapUtil.computIfAbsent( + return ConcurrentHashMapUtil.computeIfAbsent( (ConcurrentHashMap) this.map, key, mappingFunction); } else { return this.map.computeIfAbsent(key, mappingFunction); diff --git a/src/main/java/xyz/zhouxy/plusone/commons/collection/SafeConcurrentHashMap.java b/src/main/java/xyz/zhouxy/plusone/commons/collection/SafeConcurrentHashMap.java index 100c05c..4a351be 100644 --- a/src/main/java/xyz/zhouxy/plusone/commons/collection/SafeConcurrentHashMap.java +++ b/src/main/java/xyz/zhouxy/plusone/commons/collection/SafeConcurrentHashMap.java @@ -102,6 +102,6 @@ public class SafeConcurrentHashMap extends ConcurrentHashMap { /** {@inheritDoc} */ @Override public V computeIfAbsent(K key, Function mappingFunction) { - return ConcurrentHashMapUtil.computIfAbsent(this, key, mappingFunction); + return ConcurrentHashMapUtil.computeIfAbsent(this, key, mappingFunction); } } diff --git a/src/main/java/xyz/zhouxy/plusone/commons/util/ConcurrentHashMapUtil.java b/src/main/java/xyz/zhouxy/plusone/commons/util/ConcurrentHashMapUtil.java index c5ca312..b913f3a 100644 --- a/src/main/java/xyz/zhouxy/plusone/commons/util/ConcurrentHashMapUtil.java +++ b/src/main/java/xyz/zhouxy/plusone/commons/util/ConcurrentHashMapUtil.java @@ -24,7 +24,7 @@ import xyz.zhouxy.plusone.commons.base.JRE; public class ConcurrentHashMapUtil { // TODO 添加文档注释 - public static V computIfAbsent(ConcurrentHashMap map, final K key, final Function mappingFunction) { + public static V computeIfAbsent(ConcurrentHashMap map, final K key, final Function mappingFunction) { if (JRE.isJava8()) { Objects.requireNonNull(mappingFunction); V v = map.get(key);