【发布时间】:2017-05-09 05:42:58
【问题描述】:
运行时跟随代码,永远不会终止并陷入无限循环。
我不确定卡在哪里。
有趣的是,当我将 AaAa 更改为 AAAA 时,一切都按预期正常工作。
public class Test {
public static void main(String[] args) {
Map<String, Integer> map = new ConcurrentHashMap<>(16);
map.computeIfAbsent(
"AaAa",
key -> {
return map.computeIfAbsent(
"BBBB",
key2 -> 42);
}
);
}
}
谁能帮我理解这种行为。
【问题讨论】: