(K key, V value)
| 560 | } |
| 561 | |
| 562 | V putImpl(K key, V value) { |
| 563 | Entry<K,V> entry; |
| 564 | if(key == null) { |
| 565 | entry = findNullKeyEntry(); |
| 566 | if (entry == null) { |
| 567 | modCount++; |
| 568 | entry = createHashedEntry(null, 0, 0); |
| 569 | if (++elementCount > threshold) { |
| 570 | rehash(); |
| 571 | } |
| 572 | } |
| 573 | } else { |
| 574 | int hash = computeHashCode(key); |
| 575 | int index = hash & (elementData.length - 1); |
| 576 | entry = findNonNullKeyEntry(key, index, hash); |
| 577 | if (entry == null) { |
| 578 | modCount++; |
| 579 | entry = createHashedEntry(key, index, hash); |
| 580 | if (++elementCount > threshold) { |
| 581 | rehash(); |
| 582 | } |
| 583 | } |
| 584 | } |
| 585 | |
| 586 | V result = entry.value; |
| 587 | entry.value = value; |
| 588 | return result; |
| 589 | } |
| 590 | |
| 591 | Entry<K, V> createEntry(K key, int index, V value) { |
| 592 | Entry<K, V> entry = new Entry<K, V>(key, value); |
no test coverage detected