(ReferenceEntry<K, V> entry, int hash, RemovalCause cause)
| 3461 | } |
| 3462 | |
| 3463 | @VisibleForTesting |
| 3464 | @GuardedBy("this") |
| 3465 | boolean removeEntry(ReferenceEntry<K, V> entry, int hash, RemovalCause cause) { |
| 3466 | int newCount = this.count - 1; |
| 3467 | AtomicReferenceArray<ReferenceEntry<K, V>> table = this.table; |
| 3468 | int index = hash & (table.length() - 1); |
| 3469 | ReferenceEntry<K, V> first = table.get(index); |
| 3470 | for (ReferenceEntry<K, V> e = first; e != null; e = e.getNext()) { |
| 3471 | if (e == entry) { |
| 3472 | ++modCount; |
| 3473 | ReferenceEntry<K, V> newFirst = removeValueFromChain(first, e, e.getKey(), hash, e.getValueReference().get(), e.getValueReference(), cause); |
| 3474 | newCount = this.count - 1; |
| 3475 | table.set(index, newFirst); |
| 3476 | this.count = newCount; // write-volatile |
| 3477 | return true; |
| 3478 | } |
| 3479 | } |
| 3480 | return false; |
| 3481 | } |
| 3482 | |
| 3483 | /** |
| 3484 | * Performs routine cleanup following a read. Normally cleanup happens during writes. If cleanup |
no test coverage detected