Commit 252afcd0 authored by Alexey Kudravtsev's avatar Alexey Kudravtsev Committed by intellij-monorepo-bot
Browse files

remove deprecated method usages

(cherry picked from commit e60b4c37a7fab09fbf3933760968ca19e2f2edd3)
(cherry picked from commit 01a4b7c5fcf4bbbbe7b20c69178ed2ac97aac6c2)

GitOrigin-RevId: aebb2dc44171ded16279ddcaa3bd3fa7222d9f0c
parent b51300b0
Showing with 12 additions and 10 deletions
+12 -10
......@@ -38,7 +38,7 @@ public class ResolveScopeManagerImpl extends ResolveScopeManager {
myManager = psiManager;
myAdditionalIndexableFileSet = new AdditionalIndexableFileSet(project);
myDefaultResolveScopesCache = ConcurrentFactoryMap.createMap(
myDefaultResolveScopesCache = ConcurrentFactoryMap.create(
key -> {
GlobalSearchScope scope = null;
for (ResolveScopeProvider resolveScopeProvider : ResolveScopeProvider.EP_NAME.getExtensionList()) {
......
......@@ -20,7 +20,7 @@ import java.util.Map;
public class DefaultConsoleHistoryModel extends SimpleModificationTracker implements ConsoleHistoryModel {
private final static Map<String, DefaultConsoleHistoryModel> ourModels =
ConcurrentFactoryMap.createMap(key -> new DefaultConsoleHistoryModel(null),
ConcurrentFactoryMap.create(key -> new DefaultConsoleHistoryModel(null),
ContainerUtil::createConcurrentWeakValueMap);
public static DefaultConsoleHistoryModel createModel(String persistenceId) {
......
......@@ -47,7 +47,7 @@ public class MockFileManager implements FileManager {
public MockFileManager(PsiManagerEx manager) {
myManager = manager;
myViewProviders = ConcurrentFactoryMap.createMap(key->new SingleRootFileViewProvider(myManager, key), ContainerUtil::createConcurrentWeakKeyWeakValueMap);
myViewProviders = ConcurrentFactoryMap.create(key->new SingleRootFileViewProvider(myManager, key), ContainerUtil::createConcurrentWeakKeyWeakValueMap);
}
@Override
......
......@@ -162,7 +162,7 @@ public class SliceLeafAnalyzer {
}
public Map<SliceNode, Collection<PsiElement>> createMap() {
return ConcurrentFactoryMap.createMap(k -> ConcurrentCollectionFactory.createConcurrentSet(myLeafEquality),
return ConcurrentFactoryMap.create(k -> ConcurrentCollectionFactory.createConcurrentSet(myLeafEquality),
() -> ConcurrentCollectionFactory.createMap(ContainerUtil.identityStrategy()));
}
......
......@@ -29,7 +29,7 @@ import java.util.stream.Collectors;
*/
public abstract class DummyCachingFileSystem<T extends VirtualFile> extends DummyFileSystem {
private final String myProtocol;
private final ConcurrentMap<String, T> myCachedFiles = ConcurrentFactoryMap.createMap(
private final ConcurrentMap<String, T> myCachedFiles = ConcurrentFactoryMap.create(
this::findFileByPathInner, ContainerUtil::createConcurrentWeakValueMap);
public DummyCachingFileSystem(String protocol) {
......
......@@ -6,12 +6,11 @@ import org.jetbrains.annotations.NotNull;
public class DeprecatedMethodException extends RuntimeException {
private static final Logger LOG = Logger.getInstance(DeprecatedMethodException.class);
private DeprecatedMethodException(String message) {
private DeprecatedMethodException(@NotNull String message) {
super(message);
}
public static void report(@NotNull String message) {
LOG.warn(new DeprecatedMethodException("This method in " + ReflectionUtil.findCallerClass(2) +
" is deprecated and going to be removed soon. "+message));
}
......
......@@ -188,7 +188,9 @@ public abstract class ConcurrentFactoryMap<K,V> implements ConcurrentMap<K,V> {
*/
@Deprecated
@NotNull
public static <K, V> ConcurrentMap<K, V> createMap(@NotNull final Function<? super K, ? extends V> computeValue, @NotNull final Producer<? extends ConcurrentMap<K, V>> mapCreator) {
public static <K, V> ConcurrentMap<K, V> createMap(@NotNull Function<? super K, ? extends V> computeValue,
@NotNull Producer<? extends ConcurrentMap<K, V>> mapCreator) {
DeprecatedMethodException.report("Use ConcurrentFactoryMap.create() instead");
return new ConcurrentFactoryMap<K, V>(true) {
@Nullable
@Override
......@@ -205,7 +207,8 @@ public abstract class ConcurrentFactoryMap<K,V> implements ConcurrentMap<K,V> {
}
@NotNull
public static <K, V> ConcurrentMap<K, V> create(@NotNull final Function<? super K, ? extends V> computeValue, @NotNull final Supplier<? extends ConcurrentMap<K, V>> mapCreator) {
public static <K, V> ConcurrentMap<K, V> create(@NotNull Function<? super K, ? extends V> computeValue,
@NotNull Supplier<? extends ConcurrentMap<K, V>> mapCreator) {
return new ConcurrentFactoryMap<K, V>(true) {
@Nullable
@Override
......
......@@ -36,7 +36,7 @@ public class DomApplicationComponent {
}
);
private final Map<Class, InvocationCache> myInvocationCaches = ConcurrentFactoryMap.createMap(InvocationCache::new,
private final Map<Class, InvocationCache> myInvocationCaches = ConcurrentFactoryMap.create(InvocationCache::new,
ContainerUtil::createConcurrentSoftValueMap);
private final Map<Class<? extends DomElementVisitor>, VisitorDescription> myVisitorDescriptions =
ConcurrentFactoryMap.createMap(VisitorDescription::new);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment