(K key, V value)
| 540 | } |
| 541 | |
| 542 | V putImpl(K key, V value) { |
| 543 | Entry<K,V> entry; |
| 544 | if(key == null) { |
| 545 | entry = findNullKeyEntry(); |
| 546 | if (entry == null) { |
| 547 | modCount++; |
| 548 | entry = createHashedEntry(null, 0, 0); |
| 549 | if (++elementCount > threshold) { |
| 550 | rehash(); |
| 551 | } |
| 552 | } |
| 553 | } else { |
| 554 | int hash = computeHashCode(key); |
| 555 | int index = hash & (elementData.length - 1); |
| 556 | entry = findNonNullKeyEntry(key, index, hash); |
| 557 | if (entry == null) { |
| 558 | modCount++; |
| 559 | entry = createHashedEntry(key, index, hash); |
| 560 | if (++elementCount > threshold) { |
| 561 | rehash(); |
| 562 | } |
| 563 | } |
| 564 | } |
| 565 | |
| 566 | V result = entry.value; |
| 567 | entry.value = value; |
| 568 | return result; |
| 569 | } |
| 570 | |
| 571 | Entry<K, V> createEntry(K key, int index, V value) { |
| 572 | Entry<K, V> entry = new Entry<K, V>(key, value); |
no test coverage detected