Fix WeakConcurrentMap memory leak
@@ -215,6 +215,12 @@ public class WeakConcurrentMap<K, V>
return super.get(key);
}
+ @Override
+ public V getIfPresent(K key) {
+ expungeStaleEntries();
+ return super.getIfPresent(key);
+ }
+
@Override
public boolean containsKey(K key) {
expungeStaleEntries();
@@ -227,6 +233,12 @@ public class WeakConcurrentMap<K, V>
return super.put(key, value);
}
+ @Override
+ public V putIfAbsent(K key, V value) {
+ expungeStaleEntries();
+ return super.putIfAbsent(key, value);
+ }
+
@Override
public V remove(K key) {
expungeStaleEntries();
