mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
kotlin compatibility restored
This commit is contained in:
@@ -44,7 +44,7 @@ import java.util.regex.Pattern;
|
||||
@State(name = "JavaProjectCodeInsightSettings", storages = @Storage("codeInsightSettings.xml"))
|
||||
public class JavaProjectCodeInsightSettings implements PersistentStateComponent<JavaProjectCodeInsightSettings> {
|
||||
@SuppressWarnings("MismatchedQueryAndUpdateOfCollection")
|
||||
private static final ConcurrentMap<String, Pattern> ourPatterns = ConcurrentWeakFactoryMap.createMap(key->
|
||||
private static final ConcurrentMap<String, Pattern> ourPatterns = ConcurrentWeakFactoryMap.createWeakMap(key->
|
||||
PatternUtil.fromMask(key)
|
||||
);
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ public abstract class AbstractBundle {
|
||||
|
||||
@SuppressWarnings("MismatchedQueryAndUpdateOfCollection")
|
||||
private static final Map<ClassLoader, Map<String, ResourceBundle>> ourCache =
|
||||
ConcurrentWeakFactoryMap.createMap(new Function<ClassLoader, Map<String, ResourceBundle>>() {
|
||||
ConcurrentWeakFactoryMap.createWeakMap(new Function<ClassLoader, Map<String, ResourceBundle>>() {
|
||||
@Override
|
||||
public Map<String, ResourceBundle> fun(ClassLoader k) {return ContainerUtil.createConcurrentSoftValueMap();}
|
||||
});
|
||||
|
||||
@@ -25,9 +25,17 @@ import java.util.concurrent.ConcurrentMap;
|
||||
/**
|
||||
* @author peter
|
||||
*/
|
||||
public abstract class ConcurrentWeakFactoryMap {
|
||||
public abstract class ConcurrentWeakFactoryMap extends ConcurrentFactoryMap {
|
||||
/**
|
||||
* Use {@link #createWeakMap(Function)} instead
|
||||
* TODO to remove in IDEA 2018
|
||||
*/
|
||||
@Deprecated
|
||||
public ConcurrentWeakFactoryMap() {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static <T, V> ConcurrentMap<T, V> createMap(@NotNull Function<T, V> compute) {
|
||||
public static <T, V> ConcurrentMap<T, V> createWeakMap(@NotNull Function<T, V> compute) {
|
||||
return ConcurrentFactoryMap.createMap(compute, new Producer<ConcurrentMap<T, V>>() {
|
||||
@Override
|
||||
public ConcurrentMap<T, V> produce() {return ContainerUtil.createConcurrentWeakMap();}
|
||||
|
||||
Reference in New Issue
Block a user