forked from plusone/plusone-commons
修改拼写错误的方法名。
parent
ef43b4dd87
commit
fd2190e4f6
|
@ -145,7 +145,7 @@ public abstract class AbstractMapWrapper<K, V, T extends AbstractMapWrapper<K, V
|
||||||
|
|
||||||
public final V computeIfAbsent(K key, Function<? super K, ? extends V> mappingFunction) {
|
public final V computeIfAbsent(K key, Function<? super K, ? extends V> mappingFunction) {
|
||||||
if (this.map instanceof ConcurrentHashMap) {
|
if (this.map instanceof ConcurrentHashMap) {
|
||||||
return ConcurrentHashMapUtil.computIfAbsent(
|
return ConcurrentHashMapUtil.computeIfAbsent(
|
||||||
(ConcurrentHashMap<K, V>) this.map, key, mappingFunction);
|
(ConcurrentHashMap<K, V>) this.map, key, mappingFunction);
|
||||||
} else {
|
} else {
|
||||||
return this.map.computeIfAbsent(key, mappingFunction);
|
return this.map.computeIfAbsent(key, mappingFunction);
|
||||||
|
|
|
@ -102,6 +102,6 @@ public class SafeConcurrentHashMap<K, V> extends ConcurrentHashMap<K, V> {
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
@Override
|
@Override
|
||||||
public V computeIfAbsent(K key, Function<? super K, ? extends V> mappingFunction) {
|
public V computeIfAbsent(K key, Function<? super K, ? extends V> mappingFunction) {
|
||||||
return ConcurrentHashMapUtil.computIfAbsent(this, key, mappingFunction);
|
return ConcurrentHashMapUtil.computeIfAbsent(this, key, mappingFunction);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ import xyz.zhouxy.plusone.commons.base.JRE;
|
||||||
|
|
||||||
public class ConcurrentHashMapUtil { // TODO 添加文档注释
|
public class ConcurrentHashMapUtil { // TODO 添加文档注释
|
||||||
|
|
||||||
public static <K, V> V computIfAbsent(ConcurrentHashMap<K, V> map, final K key, final Function<? super K, ? extends V> mappingFunction) {
|
public static <K, V> V computeIfAbsent(ConcurrentHashMap<K, V> map, final K key, final Function<? super K, ? extends V> mappingFunction) {
|
||||||
if (JRE.isJava8()) {
|
if (JRE.isJava8()) {
|
||||||
Objects.requireNonNull(mappingFunction);
|
Objects.requireNonNull(mappingFunction);
|
||||||
V v = map.get(key);
|
V v = map.get(key);
|
||||||
|
|
Loading…
Reference in New Issue