Commit 8455c7f7 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Made #entrySet and #keySet thread safe.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@8674 b35dd754-fafc-0310-a699-88a17e54d16e
parent 120b1709
......@@ -391,15 +391,18 @@ public class DefaultCache<K, V> implements Cache<K, V> {
deleteExpiredEntries();
// TODO Make this work right
return Collections.unmodifiableSet(map.entrySet());
synchronized (this) {
return new HashSet(map.entrySet());
}
}
public Set<K> keySet() {
// First, clear all entries that have been in cache longer than the
// maximum defined age.
deleteExpiredEntries();
return Collections.unmodifiableSet(map.keySet());
synchronized (this) {
return new HashSet<K>(map.keySet());
}
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment