mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
fix code
This commit is contained in:
parent
4dd0ed53d5
commit
ed44167d5c
@ -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没有执行,返回旧值
|
||||||
|
Loading…
x
Reference in New Issue
Block a user