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

Method scheduleRefresh

output/java_guava/1.4.13/LocalCache.java:2438–2448  ·  view source on GitHub ↗
(ReferenceEntry<K, V> entry, K key, int hash, V oldValue, long now, CacheLoader<? super K, V> loader)

Source from the content-addressed store, hash-verified

2436 }
2437
2438 V scheduleRefresh(ReferenceEntry<K, V> entry, K key, int hash, V oldValue, long now, CacheLoader<? super K, V> loader) {
2439 if (map.refreshes()
2440 && (now - entry.getWriteTime() > map.refreshNanos)
2441 && !entry.getValueReference().isLoading()) {
2442 V newValue = refresh(key, hash, loader, true);
2443 if (newValue != null) {
2444 return newValue;
2445 }
2446 }
2447 return oldValue;
2448 }
2449
2450 /**
2451 * Refreshes the value associated with {@code key}, unless another thread is already doing so.

Callers 2

getMethod · 0.95
refreshMethod · 0.95

Calls 5

refreshMethod · 0.95
getWriteTimeMethod · 0.65
isLoadingMethod · 0.65
getValueReferenceMethod · 0.65
refreshesMethod · 0.45

Tested by

no test coverage detected