remove unused deprecated members

GitOrigin-RevId: 3cf577526a6a1b663ef29ead3534d70bb57de679
This commit is contained in:
Alexey Kudravtsev
2019-08-08 19:12:10 +03:00
committed by intellij-monorepo-bot
parent 36e0d5ad5b
commit 0fb79c1da2
18 changed files with 19 additions and 250 deletions
@@ -17,7 +17,6 @@ package com.intellij.slicer;
import com.intellij.codeInsight.Nullability;
import com.intellij.codeInsight.PsiEquivalenceUtil;
import com.intellij.codeInspection.dataFlow.Nullness;
import com.intellij.ide.util.treeView.AbstractTreeNode;
import com.intellij.ide.util.treeView.AbstractTreeStructure;
import com.intellij.openapi.application.ReadAction;
@@ -205,18 +204,6 @@ public abstract class SliceNullnessAnalyzerBase {
return node(root, map);
}
/**
* @param element element to find nullness for
* @return element nullness
* @deprecated for removal; call/override {@link #checkNullability(PsiElement)} instead.
*/
@SuppressWarnings("DeprecatedIsStillUsed")
@Deprecated
@NotNull
protected Nullness checkNullness(@SuppressWarnings("unused") final PsiElement element) {
throw new UnsupportedOperationException();
}
/**
* Implementors must override this method; default implementation just throws UnsupportedOperationException.
*
@@ -225,8 +212,7 @@ public abstract class SliceNullnessAnalyzerBase {
*/
@NotNull
protected Nullability checkNullability(final PsiElement element) {
//noinspection deprecation
return checkNullness(element).toNullability();
throw new UnsupportedOperationException();
}
public static class NullAnalysisResult {
@@ -713,12 +713,6 @@ public final class PsiUtil extends PsiUtilCore {
return containingClass1 == null && containingClass2 == null;
}
/** @deprecated use more generic {@link #isCompileTimeConstant(PsiVariable)} instead */
@Deprecated
public static boolean isCompileTimeConstant(@NotNull final PsiField field) {
return isCompileTimeConstant((PsiVariable)field);
}
/**
* JLS 15.28
*/
@@ -994,13 +988,6 @@ public final class PsiUtil extends PsiUtilCore {
!parentClass.hasModifierProperty(PsiModifier.FINAL);
}
/** @deprecated Use {@link #canBeOverridden(PsiMethod)} instead */
@SuppressWarnings("SpellCheckingInspection")
@Deprecated
public static boolean canBeOverriden(@NotNull PsiMethod method) {
return canBeOverridden(method);
}
@NotNull
public static PsiElement[] mapElements(@NotNull ResolveResult[] candidates) {
PsiElement[] result = new PsiElement[candidates.length];
@@ -69,15 +69,6 @@ public abstract class NonClasspathClassFinder extends PsiElementFinder {
return cache;
}
/**
* @deprecated use {@link PackageDirectoryCache#createCache(List)}
*/
@NotNull
@Deprecated
protected static PackageDirectoryCache createCache(@NotNull final List<? extends VirtualFile> roots) {
return PackageDirectoryCache.createCache(roots);
}
public void clearCache() {
myCache = null;
}
@@ -153,7 +153,7 @@ public class FileTypeAssocTable<T> {
@Deprecated
@NotNull
public String[] getAssociatedExtensions(@NotNull T type) {
String[] getAssociatedExtensions(@NotNull T type) {
List<String> exts = new ArrayList<>();
for (Map.Entry<CharSequence, T> entry : myExtensionMappings.entrySet()) {
if (entry.getValue() == type) {
@@ -3,7 +3,6 @@ package com.intellij.lang;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.UserDataHolder;
import com.intellij.openapi.util.UserDataHolderUnprotected;
import com.intellij.psi.tree.IElementType;
import com.intellij.psi.tree.TokenSet;
import com.intellij.util.diff.FlyweightCapableTreeStructure;
@@ -18,8 +17,7 @@ import org.jetbrains.annotations.Nullable;
* @see PsiParser
* @see ASTNode
*/
@SuppressWarnings("deprecation")
public interface PsiBuilder extends UserDataHolder, UserDataHolderUnprotected {
public interface PsiBuilder extends UserDataHolder {
/**
* Returns a project for which PSI builder was created (see {@link PsiBuilderFactory}).
* @return project.
@@ -142,15 +142,19 @@ public class PsiBuilderAdapter implements PsiBuilder {
myDelegate.putUserData(key, value);
}
@SuppressWarnings("deprecation")
@Override
/**
* @deprecated Use {@link #getUserData(Key)} instead
*/
@Deprecated
public <T> T getUserDataUnprotected(@NotNull final Key<T> key) {
return myDelegate.getUserDataUnprotected(key);
return getUserData(key);
}
@SuppressWarnings("deprecation")
@Override
/**
* @deprecated Use {@link #putUserData(Key, Object)} instead
*/
@Deprecated
public <T> void putUserDataUnprotected(@NotNull final Key<T> key, @Nullable final T value) {
myDelegate.putUserDataUnprotected(key, value);
putUserData(key, value);
}
}
@@ -34,6 +34,7 @@ import com.intellij.psi.tree.IElementType;
import com.intellij.psi.util.*;
import com.intellij.reference.SoftReference;
import com.intellij.testFramework.LightVirtualFile;
import com.intellij.util.DeprecatedMethodException;
import com.intellij.util.ObjectUtils;
import com.intellij.util.containers.ConcurrentList;
import com.intellij.util.containers.ContainerUtil;
@@ -752,7 +753,7 @@ public class InjectedLanguageUtil {
*/
@Deprecated
public static <T> void putInjectedFileUserData(MultiHostRegistrar registrar, Key<T> key, T value) {
LOG.warn("use #putInjectedFileUserData(com.intellij.psi.PsiElement, com.intellij.lang.Language, com.intellij.openapi.util.Key, java.lang.Object)} instead");
DeprecatedMethodException.report("use #putInjectedFileUserData(com.intellij.psi.PsiElement, com.intellij.lang.Language, com.intellij.openapi.util.Key, java.lang.Object)} instead");
InjectionResult result = ((InjectionRegistrarImpl)registrar).getInjectedResult();
if (result != null && result.files != null) {
List<? extends PsiFile> files = result.files;
@@ -35,7 +35,6 @@ import com.intellij.psi.util.PsiUtilCore;
import com.intellij.util.ObjectUtils;
import com.intellij.util.PathUtil;
import com.intellij.util.SmartList;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -73,13 +72,6 @@ class InjectionRegistrarImpl extends MultiHostRegistrarImpl implements MultiHost
myHostDocument = (DocumentEx)viewProvider.getDocument();
}
@Override
@Nullable("null means nobody cared to call .doneInjecting()")
@Deprecated
public List<Pair<Place, PsiFile>> getResult() {
return resultFiles == null ? null : ContainerUtil.map(resultFiles, file -> Pair.create(InjectedLanguageUtil.getShreds(file), file));
}
@Nullable
InjectionResult getInjectedResult() {
return resultFiles == null && resultReferences == null ? null : new InjectionResult(myHostPsiFile, resultFiles, resultReferences);
@@ -15,8 +15,6 @@
*/
package com.intellij.openapi.actionSystem;
import org.jetbrains.annotations.NonNls;
/**
* Identifiers for data items which can be returned from {@link DataContext#getData(String)} and
* {@link DataProvider#getData(String)}.
@@ -32,13 +30,6 @@ public interface DataConstants {
*/
@Deprecated String PROJECT = CommonDataKeys.PROJECT.getName();
/**
* Returns {@link com.intellij.openapi.module.Module}
*
* @deprecated use {@link com.intellij.openapi.actionSystem.LangDataKeys#MODULE} instead
*/
@Deprecated @NonNls String MODULE = "module";
/**
* Returns {@link com.intellij.openapi.vfs.VirtualFile}
*
@@ -205,7 +205,7 @@ public class InstalledPluginsManagerMain extends PluginManagerMain {
String part = "disabled plugin" + (dependencies.size() > 1 ? "s " : " ");
String deps = StringUtil.join(dependencies, IdeaPluginDescriptor::getName, ", ");
String message = "Plugin " + pluginDescriptor.getName() + " depends on " + part + deps + ". Enable " + part.trim() + "?";
if (MessagesEx.showOkCancelDialog(parent, message, "Install Plugin", Messages.getWarningIcon()) == Messages.OK) {
if (Messages.showOkCancelDialog(message, "Install Plugin", "Install", CommonBundle.getCancelButtonText(), Messages.getWarningIcon()) == Messages.OK) {
model.enableRows(dependencies.toArray(new IdeaPluginDescriptor[0]), Boolean.TRUE);
}
}
@@ -62,16 +62,6 @@ public class MessagesEx extends Messages {
else showInfoMessage(message, title);
}
/**
* @return {@link #OK} if user pressed "Ok" or {@link #CANCEL} if user pressed "Cancel" button.
* @deprecated Please provide meaningful action names via {@link #showOkCancelDialog(Component, String, String, String, String, Icon)} instead
*/
@OkCancelResult
@Deprecated
public static int showOkCancelDialog(@Nullable Component parent, String message, String title, Icon icon) {
return parent != null ? Messages.showOkCancelDialog(parent, message, title, icon) : showOkCancelDialog(message, title, icon);
}
public abstract static class BaseDialogInfo<ThisClass extends BaseDialogInfo> {
private final Project myProject;
private String myMessage;
@@ -1,29 +0,0 @@
/*
* Copyright 2000-2009 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* @author max
*/
package com.intellij.usages.rules;
/**
* @deprecated override {@link UsageGroupingRule#getRank()} instead
*/
@Deprecated
public interface OrderableUsageGroupingRule extends UsageGroupingRule {
@Override
int getRank();
}
@@ -74,27 +74,6 @@ public class ContainerUtilRt {
return new HashMap<K, V>(initialCapacity);
}
/**
* @deprecated Use {@link TreeMap#TreeMap()}
*/
@NotNull
@Contract(value = " -> new", pure = true)
@Deprecated
public static <K extends Comparable<? super K>, V> TreeMap<K, V> newTreeMap() {
return new TreeMap<K, V>();
}
/**
* @deprecated Use {@link TreeMap#TreeMap(Map)}
*/
@SuppressWarnings("unused")
@NotNull
@Contract(value = "_ -> new", pure = true)
@Deprecated
public static <K extends Comparable<? super K>, V> TreeMap<K, V> newTreeMap(@NotNull Map<? extends K, ? extends V> map) {
return new TreeMap<K, V>(map);
}
/**
* @deprecated Use {@link LinkedHashMap#LinkedHashMap()}
*/
@@ -105,26 +84,6 @@ public class ContainerUtilRt {
return new LinkedHashMap<K, V>();
}
/**
* @deprecated Use {@link LinkedHashMap#LinkedHashMap(int)}
*/
@NotNull
@Contract(value = "_ -> new", pure = true)
@Deprecated
public static <K, V> LinkedHashMap<K, V> newLinkedHashMap(int capacity) {
return new LinkedHashMap<K, V>(capacity);
}
/**
* @deprecated Use {@link LinkedHashMap#LinkedHashMap(Map)}
*/
@NotNull
@Contract(value = "_ -> new", pure = true)
@Deprecated
public static <K, V> LinkedHashMap<K, V> newLinkedHashMap(@NotNull Map<? extends K, ? extends V> map) {
return new LinkedHashMap<K, V>(map);
}
@NotNull
@Contract(value = "_,_ -> new", pure = true)
public static <K, V> LinkedHashMap<K,V> newLinkedHashMap(@NotNull Pair<? extends K, ? extends V> first, @NotNull Pair<? extends K, ? extends V>... entries) {
@@ -249,16 +208,6 @@ public class ContainerUtilRt {
return copy(new TreeSet<T>(), elements);
}
/**
* @deprecated Use {@link TreeSet#TreeSet(Comparator)}
*/
@Deprecated
@NotNull
@Contract(value = "_ -> new", pure = true)
public static <T> TreeSet<T> newTreeSet(@Nullable Comparator<? super T> comparator) {
return new TreeSet<T>(comparator);
}
/**
* A variant of {@link Collections#emptyList()},
* except that {@link #toArray()} here does not create garbage {@code new Object[0]} constantly.
@@ -340,16 +289,6 @@ public class ContainerUtilRt {
return (List<T>)EmptyList.INSTANCE;
}
/**
* @deprecated use {@link #addIfNotNull(Collection, Object)}
*/
@Deprecated
public static <T> void addIfNotNull(@Nullable T element, @NotNull Collection<? super T> result) {
if (element != null) {
result.add(element);
}
}
public static <T> void addIfNotNull(@NotNull Collection<? super T> result, @Nullable T element) {
if (element != null) {
result.add(element);
@@ -448,16 +387,6 @@ public class ContainerUtilRt {
return collection.toArray(array);
}
/**
* @deprecated use {@link Collection#toArray(Object[])} instead
*/
@Deprecated
@NotNull
@Contract(pure=true)
public static <T> T[] toArray(@NotNull Collection<? extends T> c, @NotNull T[] sample) {
return c.toArray(sample);
}
@Contract(pure=true)
public static <T, L extends List<T>> T getLastItem(@Nullable L list, @Nullable T def) {
return isEmpty(list) ? def : list.get(list.size() - 1);
@@ -10,8 +10,7 @@ import java.util.Map;
/**
* Non thread safe version of {@link UserDataHolderBase}.
*/
@SuppressWarnings("deprecation")
public class UnprotectedUserDataHolder implements UserDataHolder, UserDataHolderUnprotected {
public class UnprotectedUserDataHolder implements UserDataHolder {
private Map<Key, Object> myUserData;
@@ -32,15 +31,4 @@ public class UnprotectedUserDataHolder implements UserDataHolder, UserDataHolder
if (myUserData == null) myUserData = new HashMap<>();
myUserData.put(key, value);
}
@Nullable
@Override
public <T> T getUserDataUnprotected(@NotNull Key<T> key) {
return getUserData(key);
}
@Override
public <T> void putUserDataUnprotected(@NotNull Key<T> key, @Nullable T value) {
putUserData(key, value);
}
}
@@ -1,32 +0,0 @@
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.openapi.util;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* Like UserDataHolder, but stores data in non-thread-safe way.
* Should not be accessed across threads.
*
* @deprecated use {@link UserDataHolder}. <br/>
* This interface is extended only by {@link com.intellij.lang.PsiBuilder} which is used in a single thread always.
* {@link UserDataHolder} doesn't make any restrictions on thread-safety, so it's now used in PsiBuilder instead,
* and this interface is left for binary compatibility.
*/
@SuppressWarnings("DeprecatedIsStillUsed")
@Deprecated
public interface UserDataHolderUnprotected {
/**
* @deprecated use {@link UserDataHolder}
*/
@Deprecated
@Nullable
<T> T getUserDataUnprotected(@NotNull Key<T> key);
/**
* @deprecated use {@link UserDataHolder}
*/
@Deprecated
<T> void putUserDataUnprotected(@NotNull Key<T> key, @Nullable T value);
}
@@ -92,16 +92,6 @@ public class ContainerUtil extends ContainerUtilRt {
return new LinkedHashMap<>();
}
/**
* @deprecated Use {@link LinkedHashMap#LinkedHashMap(int)}
*/
@NotNull
@Contract(pure=true)
@Deprecated
public static <K, V> LinkedHashMap<K, V> newLinkedHashMap(int capacity) {
return new LinkedHashMap<>(capacity);
}
/**
* @deprecated Use {@link LinkedHashMap#LinkedHashMap(Map)}
*/
@@ -2982,7 +2972,6 @@ public class ContainerUtil extends ContainerUtilRt {
@Contract(value = " -> new", pure = true)
@NotNull
public static <K,V> Map<K,V> createSoftValueMap() {
//noinspection deprecation
return new SoftValueHashMap<>(canonicalStrategy());
}
@@ -16,17 +16,15 @@
package com.intellij.util.containers;
import com.intellij.reference.SoftReference;
import com.intellij.util.DeprecatedMethodException;
import gnu.trove.TObjectHashingStrategy;
import org.jetbrains.annotations.NotNull;
import java.lang.ref.ReferenceQueue;
/**
* @deprecated use {@link ContainerUtil#createSoftValueMap()} instead
* Use {@link ContainerUtil#createSoftValueMap()} instead
*/
@Deprecated
public final class SoftValueHashMap<K,V> extends RefValueHashMap<K,V>{
final class SoftValueHashMap<K,V> extends RefValueHashMap<K,V>{
private static class MySoftReference<K, T> extends SoftReference<T> implements MyReference<K, T> {
private final K key;
@@ -42,9 +40,6 @@ public final class SoftValueHashMap<K,V> extends RefValueHashMap<K,V>{
}
}
public SoftValueHashMap() {
DeprecatedMethodException.report("Use ContainerUtil#createSoftValueMap() instead");
}
SoftValueHashMap(@NotNull TObjectHashingStrategy<K> strategy) {
super(strategy);
@@ -230,17 +230,6 @@ public class InjectorUtils {
}
}
/**
* @deprecated use {@link InjectorUtils#registerSupport(LanguageInjectionSupport, boolean, PsiElement, Language)} instead
*/
@Deprecated
public static void registerSupport(@NotNull LanguageInjectionSupport support, boolean settingsAvailable, @NotNull MultiHostRegistrar registrar) {
LOG.warn("use {@link InjectorUtils#registerSupport(org.intellij.plugins.intelliLang.inject.LanguageInjectionSupport, boolean, com.intellij.psi.PsiElement, com.intellij.lang.Language)} instead");
putInjectedFileUserData(registrar, LanguageInjectionSupport.INJECTOR_SUPPORT, support);
if (settingsAvailable) {
putInjectedFileUserData(registrar, LanguageInjectionSupport.SETTINGS_EDITOR, support);
}
}
public static <T> void putInjectedFileUserData(@NotNull PsiElement element, @NotNull Language language, @NotNull Key<T> key, @Nullable T value) {
InjectedLanguageUtil.putInjectedFileUserData(element, language, key, value);