This commit is contained in:
Looly 2023-04-02 21:05:28 +08:00
parent 4dd0ed53d5
commit ed44167d5c

View File

@ -1284,7 +1284,7 @@ public class MapUtil extends MapGetUtil {
V value = map.get(key);
if (null == value) {
value = mappingFunction.apply(key);
final V res = map.putIfAbsent(key, mappingFunction.apply(key));
final V res = map.putIfAbsent(key, value);
if(null != res){
// issues#I6RVMY
// 如果旧值存在说明其他线程已经赋值成功putIfAbsent没有执行返回旧值