get, которая используется getIfPresent >
Код: Выделить всё
@Nullable
V get(Object key, int hash) {
try {
if (this.count != 0) {
long now = this.map.ticker.read();
ReferenceEntry e = this.getLiveEntry(key, hash, now);
Object value;
if (e == null) {
value = null;
return value;
}
value = e.getValueReference().get();
if (value != null) {
this.recordRead(e, now);
Object var7 = this.scheduleRefresh(e, e.getKey(), hash, value, now, this.map.defaultLoader);
return var7;
}
this.tryDrainReferenceQueues();
}
Object var11 = null;
return var11;
} finally {
this.postReadCleanup();
}
}
Код: Выделить всё
@Nullable
V put(K key, int hash, V value, boolean onlyIfAbsent) {
this.lock();
.....
Подробнее здесь: https://stackoverflow.com/questions/706 ... avas-cache