記錄ConcurrentHashMap的一個bug

public static void main(String[] args) {
    Map<String,Integer> map=new ConcurrentHashMap<>();
    map.computeIfAbsent("AaAa",key->  map.computeIfAbsent("BBBB", key2->42));
    System.out.println(map);
}

 

轉:https://www.toutiao.com/i6838199855249097219/?timestamp=1592179075&app=news_article_lite&group_id=6838199855249097219&req_id=20200615075755010027024142236D2953

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章