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

Method getLiveValue

output/java_guava/1.4.17/LocalCache.java:1964–1977  ·  view source on GitHub ↗

Gets the value from an entry. Returns null if the entry is invalid, partially-collected, loading, or expired. Unlike Segment#getLiveValue this method does not attempt to cleanup stale entries. As such it should only be called outside of a segment context, such as during iteration.

(ReferenceEntry<K, V> entry, long now)

Source from the content-addressed store, hash-verified

1962 */
1963
1964 @Nullable
1965 V getLiveValue(ReferenceEntry<K, V> entry, long now) {
1966 if (entry.getKey() == null) {
1967 return null;
1968 }
1969 V value = entry.getValueReference().get();
1970 if (value == null) {
1971 return null;
1972 }
1973 if (isExpired(entry, now)) {
1974 return null;
1975 }
1976 return value;
1977 }
1978
1979 // expiration
1980

Callers 4

isLiveMethod · 0.45
containsValueMethod · 0.45
advanceToMethod · 0.45
getOrComputeMethod · 0.45

Calls 4

isExpiredMethod · 0.95
getKeyMethod · 0.65
getMethod · 0.65
getValueReferenceMethod · 0.65

Tested by

no test coverage detected