jdk1.7 HashMap扩容时死循环问题
jdk1.7 hashmap在resize时进行扩容时,会导致死循环,主要是因为jdk1.7采用的是头插法
void transfer(Entry[] newTable, boolean rehash) {
int newCapacity = newTable.length;
for (Entry<K,V> e : table) {
while(null != e) {
Entry<K,V> next = e.next;
原创
2020-05-12 16:13:38 ·
14140 阅读 ·
0 评论