Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion guava/src/com/google/common/cache/LocalCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
* @author Charles Fry
* @author Bob Lee ({@code com.google.common.collect.MapMaker})
* @author Doug Lea ({@code ConcurrentHashMap})
* @author Ko Su
*/
@SuppressWarnings({
"GoodTime", // lots of violations (nanosecond math)
Expand Down Expand Up @@ -2287,7 +2288,16 @@ V waitForLoadingValue(ReferenceEntry<K, V> e, K key, ValueReference<K, V> valueR
removeLoadingValue(key, hash, computingValueReference);
return null;
} else {
removeEntry(e, hash, RemovalCause.EXPLICIT);
V oldValue = valueReference.get();

RemovalCause cause;
if (oldValue == null && valueReference.isActive()) {
cause = RemovalCause.COLLECTED;
} else {
cause = RemovalCause.EXPLICIT;
}

removeEntry(e, hash, cause);
return null;
}
} finally {
Expand Down