mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-14 18:05:27 +07:00
add proper wildcards for evictionListener
GitOrigin-RevId: ef7935a01801e338697ac67bc2d3afe83ea23b02
This commit is contained in:
committed by
intellij-monorepo-bot
parent
8956447cc9
commit
5a24626e03
@@ -41,13 +41,13 @@ public final class CollectionFactory {
|
||||
|
||||
@Contract(value = "_ -> new", pure = true)
|
||||
public static @NotNull <K, V> ConcurrentMap<@NotNull K, @NotNull V> createConcurrentWeakValueMap(
|
||||
@NotNull Consumer<K> evictionListener) {
|
||||
@NotNull Consumer<? super K> evictionListener) {
|
||||
return new ConcurrentWeakValueHashMap<>(evictionListener);
|
||||
}
|
||||
|
||||
@Contract(value = "_ -> new", pure = true)
|
||||
public static @NotNull <K, V> ConcurrentMap<@NotNull K, @NotNull V> createConcurrentSoftValueMap(
|
||||
@NotNull Consumer<K> evictionListener) {
|
||||
@NotNull Consumer<? super K> evictionListener) {
|
||||
return new ConcurrentSoftValueHashMap<>(evictionListener);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,10 +20,10 @@ import java.util.function.Consumer;
|
||||
abstract class ConcurrentRefValueHashMap<K, V> implements ConcurrentMap<K, V> {
|
||||
|
||||
private final ConcurrentMap<K, ValueReference<K, V>> myMap = new ConcurrentHashMap<>();
|
||||
private final Consumer<K> myEvictionListener;
|
||||
private final Consumer<? super K> myEvictionListener;
|
||||
protected final ReferenceQueue<V> myQueue = new ReferenceQueue<>();
|
||||
|
||||
ConcurrentRefValueHashMap(@Nullable Consumer<K> evictionListener) {
|
||||
ConcurrentRefValueHashMap(@Nullable Consumer<? super K> evictionListener) {
|
||||
myEvictionListener = evictionListener;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import java.util.function.Consumer;
|
||||
*/
|
||||
final class ConcurrentSoftValueHashMap<K,V> extends ConcurrentRefValueHashMap<K,V> {
|
||||
|
||||
ConcurrentSoftValueHashMap(@Nullable Consumer<K> evictionListener) {
|
||||
ConcurrentSoftValueHashMap(@Nullable Consumer<? super K> evictionListener) {
|
||||
super(evictionListener);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import java.util.function.Consumer;
|
||||
*/
|
||||
final class ConcurrentWeakValueHashMap<K,V> extends ConcurrentRefValueHashMap<K,V> {
|
||||
|
||||
ConcurrentWeakValueHashMap(@Nullable Consumer<K> evictionListener) {
|
||||
ConcurrentWeakValueHashMap(@Nullable Consumer<? super K> evictionListener) {
|
||||
super(evictionListener);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user