mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -1284,7 +1284,7 @@ public class MapUtil extends MapGetUtil {
|
|||||||
V value = map.get(key);
|
V value = map.get(key);
|
||||||
if (null == value) {
|
if (null == value) {
|
||||||
value = mappingFunction.apply(key);
|
value = mappingFunction.apply(key);
|
||||||
final V res = map.putIfAbsent(key, mappingFunction.apply(key));
|
final V res = map.putIfAbsent(key, value);
|
||||||
if(null != res){
|
if(null != res){
|
||||||
// issues#I6RVMY
|
// issues#I6RVMY
|
||||||
// 如果旧值存在,说明其他线程已经赋值成功,putIfAbsent没有执行,返回旧值
|
// 如果旧值存在,说明其他线程已经赋值成功,putIfAbsent没有执行,返回旧值
|
||||||
|
Reference in New Issue
Block a user