(K key, V value)
| 527 | } |
| 528 | |
| 529 | V putImpl(K key, V value) { |
| 530 | Entry<K,V> entry; |
| 531 | if(key == null) { |
| 532 | entry = findNullKeyEntry(); |
| 533 | if (entry == null) { |
| 534 | modCount++; |
| 535 | entry = createHashedEntry(null, 0, 0); |
| 536 | if (++elementCount > threshold) { |
| 537 | rehash(); |
| 538 | } |
| 539 | } |
| 540 | } else { |
| 541 | int hash = computeHashCode(key); |
| 542 | int index = hash & (elementData.length - 1); |
| 543 | entry = findNonNullKeyEntry(key, index, hash); |
| 544 | if (entry == null) { |
| 545 | modCount++; |
| 546 | entry = createHashedEntry(key, index, hash); |
| 547 | if (++elementCount > threshold) { |
| 548 | rehash(); |
| 549 | } |
| 550 | } |
| 551 | } |
| 552 | |
| 553 | V result = entry.value; |
| 554 | entry.value = value; |
| 555 | return result; |
| 556 | } |
| 557 | |
| 558 | Entry<K, V> createEntry(K key, int index, V value) { |
| 559 | Entry<K, V> entry = new Entry<K, V>(key, value); |
no test coverage detected