MCPcopy Create free account
hub / github.com/antlr/codebuff / removeEntry

Method removeEntry

output/java_guava/1.4.19/LocalCache.java:3463–3481  ·  view source on GitHub ↗
(ReferenceEntry<K, V> entry, int hash, RemovalCause cause)

Source from the content-addressed store, hash-verified

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

Callers 2

expireEntriesMethod · 0.95
evictEntriesMethod · 0.95

Calls 7

removeValueFromChainMethod · 0.95
getMethod · 0.65
getNextMethod · 0.65
getKeyMethod · 0.65
getValueReferenceMethod · 0.65
setMethod · 0.65
lengthMethod · 0.45

Tested by

no test coverage detected