Following code when run, never terminates and stuck in endless loop.
I am not sure where it is getting stuck.
Interesting thing is when I change AaAa
to AAAA
every thing works fine as expected.
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);
}
);
}
}
Can some one help me understanding this behavior.