com.google.inject.internal.WeakKeySet Maven / Gradle / Ivy
package com.google.inject.internal;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.RemovalCause;
import com.google.common.cache.RemovalListener;
import com.google.common.collect.LinkedHashMultiset;
import com.google.common.collect.Maps;
import com.google.common.collect.Multiset;
import com.google.common.collect.Sets;
import com.google.inject.Key;
import com.google.inject.internal.util.SourceProvider;
import java.util.Map;
import java.util.Set;
/**
* Minimal set that doesn't hold strong references to the contained keys.
*/
final class WeakKeySet {
/**
* This is already locked externally on add and getSources but we need it to handle clean up in
* the evictionCache's RemovalListener.
*/
private final Object lock;
private Map, Multiset