Skip to content

Commit

Permalink
Merge pull request #8283 from serkan-ozal/fix/3.x/issue-7812
Browse files Browse the repository at this point in the history
[BACKPORT] Ensure skipping previously removed `CacheEntryListenerConfiguration` …
  • Loading branch information
Serkan ÖZAL committed May 31, 2016
2 parents 8374d79 + a5f135d commit 1e0954a
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -35,6 +35,7 @@
import java.lang.ref.WeakReference;
import java.net.URI;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Map;
Expand Down Expand Up @@ -412,9 +413,14 @@ protected <K, V, C extends Configuration<K, V>> CacheConfig<K, V> createCacheCon
protected <K, V> void registerListeners(CacheConfig<K, V> cacheConfig, ICache<K, V> source) {
Iterator<CacheEntryListenerConfiguration<K, V>> iterator =
cacheConfig.getCacheEntryListenerConfigurations().iterator();
Set<CacheEntryListenerConfiguration> removedListenerConfigs = new HashSet<CacheEntryListenerConfiguration>();
while (iterator.hasNext()) {
CacheEntryListenerConfiguration<K, V> listenerConfig = iterator.next();
if (removedListenerConfigs.contains(listenerConfig)) {
continue;
}
iterator.remove();
removedListenerConfigs.add(listenerConfig);
source.registerCacheEntryListener(listenerConfig);
}
}
Expand Down

0 comments on commit 1e0954a

Please sign in to comment.