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

Method setValue

output/java_guava/1.4.13/LocalCache.java:2239–2248  ·  view source on GitHub ↗

Sets a new value of an entry. Adds newly created entries at the end of the access queue.

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

Source from the content-addressed store, hash-verified

2237 */
2238
2239 @GuardedBy("this")
2240 void setValue(ReferenceEntry<K, V> entry, K key, V value, long now) {
2241 ValueReference<K, V> previous = entry.getValueReference();
2242 int weight = map.weigher.weigh(key, value);
2243 checkState(weight >= 0, "Weights must be non-negative");
2244 ValueReference<K, V> valueReference = map.valueStrength.referenceValue(this, entry, value, weight);
2245 entry.setValueReference(valueReference);
2246 recordWrite(entry, weight, now);
2247 previous.notifyNewValue(value);
2248 }
2249
2250 // loading
2251

Callers 1

refreshMethod · 0.95

Calls 7

recordWriteMethod · 0.95
getValueReferenceMethod · 0.65
weighMethod · 0.65
setValueReferenceMethod · 0.65
notifyNewValueMethod · 0.65
checkStateMethod · 0.45
referenceValueMethod · 0.45

Tested by

no test coverage detected