Fix build with additional WeakHash map implementation
This commit is contained in:
parent
edacd7a41d
commit
95a963a364
|
|
@ -108,7 +108,6 @@ public interface WeakMap<K, V> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized V getOrCreate(K key, ValueSupplier<V> supplier) {
|
public synchronized V getOrCreate(K key, ValueSupplier<V> supplier) {
|
||||||
|
|
||||||
if (!map.containsKey(key)) {
|
if (!map.containsKey(key)) {
|
||||||
map.put(key, supplier.get());
|
map.put(key, supplier.get());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -175,6 +175,15 @@ class WeakMapSuppliers {
|
||||||
public void putIfAbsent(final K key, final V value) {
|
public void putIfAbsent(final K key, final V value) {
|
||||||
map.putIfAbsent(key, value);
|
map.putIfAbsent(key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public V getOrCreate(K key, ValueSupplier<V> supplier) {
|
||||||
|
if (!map.containsKey(key)) {
|
||||||
|
map.put(key, supplier.get());
|
||||||
|
}
|
||||||
|
|
||||||
|
return map.get(key);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static class Inline implements WeakMap.Implementation {
|
static class Inline implements WeakMap.Implementation {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue