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

Method scheduleRefresh

output/java_guava/1.4.19/LocalCache.java:2447–2462  ·  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

2445 }
2446
2447 V scheduleRefresh(
2448 ReferenceEntry<K, V> entry,
2449 K key,
2450 int hash,
2451 V oldValue,
2452 long now,
2453 CacheLoader<? super K, V> loader) {
2454 if (map.refreshes() && (now - entry.getWriteTime() > map.refreshNanos)
2455 && !entry.getValueReference().isLoading()) {
2456 V newValue = refresh(key, hash, loader, true);
2457 if (newValue != null) {
2458 return newValue;
2459 }
2460 }
2461 return oldValue;
2462 }
2463
2464 /**
2465 * Refreshes the value associated with {@code key}, unless another thread is already doing so.

Callers 1

getMethod · 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