mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
LinkedMultiMap support for custom EqualityPolicy (for CPP-819 Support MSVC toolchain: CMake + NMake generation)
This commit is contained in:
committed by
Anton Makeev
parent
b3ff6f2d2f
commit
2f15e39cf9
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* Copyright 2000-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.intellij.util.containers;
|
||||
|
||||
import com.intellij.util.containers.hash.EqualityPolicy;
|
||||
import com.intellij.util.containers.hash.LinkedHashMap;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -28,12 +29,16 @@ public class LinkedMultiMap<K, V> extends MultiMap<K, V> {
|
||||
@NotNull
|
||||
@Override
|
||||
protected Map<K, Collection<V>> createMap() {
|
||||
return new LinkedHashMap<K, Collection<V>>();
|
||||
return new LinkedHashMap<K, Collection<V>>(getEqualityPolicy());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Map<K, Collection<V>> createMap(int initialCapacity, float loadFactor) {
|
||||
return new LinkedHashMap<K, Collection<V>>(initialCapacity, loadFactor);
|
||||
return new LinkedHashMap<K, Collection<V>>(initialCapacity, loadFactor, getEqualityPolicy());
|
||||
}
|
||||
|
||||
protected EqualityPolicy<K> getEqualityPolicy() {
|
||||
return (EqualityPolicy<K>)EqualityPolicy.CANONICAL;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user