diff options
author | Sam Berlin <sameb@google.com> | 2014-05-03 00:38:26 -0400 |
---|---|---|
committer | Sam Berlin <sameb@google.com> | 2014-05-03 00:51:47 -0400 |
commit | f5349cd25c1338473c3cc11f18f389fef3882753 (patch) | |
tree | 3b50e5b993f1e72c0efcb2f2071f15e37a7862c2 /core/src/com/google/inject | |
parent | f1abba38c7f531ec808182579b9d0456b1a00a63 (diff) | |
download | guice-f5349cd25c1338473c3cc11f18f389fef3882753.tar.gz |
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
Diffstat (limited to 'core/src/com/google/inject')
-rw-r--r-- | core/src/com/google/inject/internal/WeakKeySet.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/core/src/com/google/inject/internal/WeakKeySet.java b/core/src/com/google/inject/internal/WeakKeySet.java index 43bbab1f..9e466531 100644 --- a/core/src/com/google/inject/internal/WeakKeySet.java +++ b/core/src/com/google/inject/internal/WeakKeySet.java @@ -78,7 +78,6 @@ final class WeakKeySet { */ 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 @@ final class WeakKeySet { 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 |