Use the correct key to check for blacklisting of multibound elements.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=64831090
diff --git a/core/src/com/google/inject/internal/WeakKeySet.java b/core/src/com/google/inject/internal/WeakKeySet.java
index 43bbab1..9e46653 100644
--- a/core/src/com/google/inject/internal/WeakKeySet.java
+++ b/core/src/com/google/inject/internal/WeakKeySet.java
@@ -78,7 +78,6 @@
*/
private void cleanUpForCollectedState(Set<KeyAndSource> keysAndSources) {
synchronized (lock) {
-
for (KeyAndSource keyAndSource : keysAndSources) {
Multiset<Object> set = backingSet.get(keyAndSource.mapKey);
if (set != null) {
@@ -125,15 +124,15 @@
public boolean contains(Key<?> key) {
evictionCache.cleanUp();
- return backingSet != null && backingSet.containsKey(key);
+ return backingSet != null && backingSet.containsKey(toMapKey(key));
}
public Set<Object> getSources(Key<?> key) {
evictionCache.cleanUp();
- Multiset<Object> sources = (backingSet == null) ? null : backingSet.get(key);
+ Multiset<Object> sources = (backingSet == null) ? null : backingSet.get(toMapKey(key));
return (sources == null) ? null : sources.elementSet();
}
-
+
private static Object toMapKey(Key<?> key) {
Annotation annotation = key.getAnnotation();
if (annotation != null