From a90508fbca065f3e6ba1ef09a5e00bd60a330e01 Mon Sep 17 00:00:00 2001 From: Nikolay Chashnikov Date: Fri, 10 Sep 2021 19:06:21 +0300 Subject: [PATCH] [java] API cleanup: remove deprecated API (IDEA-271555) GitOrigin-RevId: 78ca994b689a03aba22eee5e05385bc726e03e85 --- .../FacetBasedPackagingElementType.java | 13 ----- .../openapi/compiler/DummyCompileContext.java | 11 ---- .../packaging/artifacts/ArtifactType.java | 10 ---- .../elements/PackagingElementType.java | 10 ---- ...ractPatternBasedConfigurationProducer.java | 12 ----- .../configurations/JavaParameters.java | 7 --- .../library/DownloadableLibraryType.java | 39 +------------- .../ProjectWizardStepFactoryImpl.java | 2 +- .../ui/configuration/ConfigurationError.java | 20 ------- .../roots/ui/configuration/JdkComboBox.java | 54 +------------------ .../ProjectStructureProblemDescription.java | 36 ------------- .../ProjectStructureProblemsHolderImpl.java | 10 +++- .../intention/QuickFixFactory.java | 8 --- .../compiler/RemoveElementQuickFix.java | 36 ------------- .../impl/config/QuickFixFactoryImpl.java | 13 ----- .../templates/ForIndexedPostfixTemplate.java | 10 ---- .../ide/util/SuperMethodWarningUtil.java | 15 +----- .../memberPullUp/JavaPullUpHandler.java | 7 --- .../memberPushDown/JavaPushDownHandler.java | 7 --- .../refactoring/psi/MyUsageViewUtil.java | 25 --------- .../duplicates/MethodDuplicatesHandler.java | 7 --- .../com/intellij/pom/java/LanguageLevel.java | 8 --- .../psi/augment/PsiAugmentProvider.java | 10 ---- .../psi/impl/PsiElementFinderImpl.java | 11 ---- 24 files changed, 12 insertions(+), 369 deletions(-) delete mode 100644 java/java-analysis-impl/src/com/intellij/codeInspection/compiler/RemoveElementQuickFix.java delete mode 100644 java/java-impl/src/com/intellij/refactoring/psi/MyUsageViewUtil.java diff --git a/java/compiler/impl/src/com/intellij/packaging/impl/elements/FacetBasedPackagingElementType.java b/java/compiler/impl/src/com/intellij/packaging/impl/elements/FacetBasedPackagingElementType.java index 753840619b8f..28627621672b 100644 --- a/java/compiler/impl/src/com/intellij/packaging/impl/elements/FacetBasedPackagingElementType.java +++ b/java/compiler/impl/src/com/intellij/packaging/impl/elements/FacetBasedPackagingElementType.java @@ -14,7 +14,6 @@ import com.intellij.packaging.elements.CompositePackagingElement; import com.intellij.packaging.elements.PackagingElement; import com.intellij.packaging.elements.PackagingElementType; import com.intellij.packaging.ui.ArtifactEditorContext; -import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.Nls; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; @@ -28,18 +27,6 @@ import java.util.function.Supplier; public abstract class FacetBasedPackagingElementType, F extends Facet> extends PackagingElementType { private final FacetTypeId myFacetType; - /** - * @deprecated This constructor is meant to provide the binary compatibility with the external plugins. - * Please use the constructor that accepts a messagePointer for {@link PackagingElementType#myPresentableName} - */ - @Deprecated - @ApiStatus.ScheduledForRemoval(inVersion = "2021.3") - protected FacetBasedPackagingElementType(@NotNull @NonNls String id, - @NotNull @Nls(capitalization = Nls.Capitalization.Title) String presentableName, - FacetTypeId facetType) { - this(id, () -> presentableName, facetType); - } - protected FacetBasedPackagingElementType(@NotNull @NonNls String id, @NotNull Supplier<@Nls(capitalization = Nls.Capitalization.Title) String> presentableName, FacetTypeId facetType) { diff --git a/java/compiler/openapi/src/com/intellij/openapi/compiler/DummyCompileContext.java b/java/compiler/openapi/src/com/intellij/openapi/compiler/DummyCompileContext.java index 6aff55e39eb2..8ed9b539f040 100644 --- a/java/compiler/openapi/src/com/intellij/openapi/compiler/DummyCompileContext.java +++ b/java/compiler/openapi/src/com/intellij/openapi/compiler/DummyCompileContext.java @@ -48,17 +48,6 @@ public class DummyCompileContext implements CompileContext { myProject = project; } - /** - * @deprecated use {@link #create(Project)} instead - * @return - */ - @Deprecated - @ApiStatus.ScheduledForRemoval(inVersion = "2021.3") - @NotNull - public static DummyCompileContext getInstance() { - return new DummyCompileContext(ProjectManager.getInstance().getDefaultProject()); - } - @NotNull public static DummyCompileContext create(@NotNull Project project) { return new DummyCompileContext(project); diff --git a/java/compiler/openapi/src/com/intellij/packaging/artifacts/ArtifactType.java b/java/compiler/openapi/src/com/intellij/packaging/artifacts/ArtifactType.java index ec8eb323f742..c4ac6d2e5e3d 100644 --- a/java/compiler/openapi/src/com/intellij/packaging/artifacts/ArtifactType.java +++ b/java/compiler/openapi/src/com/intellij/packaging/artifacts/ArtifactType.java @@ -21,16 +21,6 @@ public abstract class ArtifactType { private final String myId; private final Supplier<@Nls(capitalization = Nls.Capitalization.Sentence) String> myTitle; - /** - * @deprecated This constructor is meant to provide the binary compatibility with the external plugins. - * Please use the constructor that accepts a messagePointer for {@link ArtifactType#myTitle} - */ - @Deprecated - @ApiStatus.ScheduledForRemoval(inVersion = "2021.3") - protected ArtifactType(@NonNls String id, @Nls(capitalization = Nls.Capitalization.Sentence) String title) { - this(id, () -> title); - } - protected ArtifactType(@NonNls String id, Supplier<@Nls(capitalization = Nls.Capitalization.Sentence) String> title) { myId = id; myTitle = title; diff --git a/java/compiler/openapi/src/com/intellij/packaging/elements/PackagingElementType.java b/java/compiler/openapi/src/com/intellij/packaging/elements/PackagingElementType.java index a6e7d4fd9626..f61aee8a0681 100644 --- a/java/compiler/openapi/src/com/intellij/packaging/elements/PackagingElementType.java +++ b/java/compiler/openapi/src/com/intellij/packaging/elements/PackagingElementType.java @@ -17,16 +17,6 @@ public abstract class PackagingElementType> { private final String myId; private final Supplier<@Nls(capitalization = Nls.Capitalization.Title) String> myPresentableName; - /** - * @deprecated This constructor is meant to provide the binary compatibility with the external plugins. - * Please use the constructor that accepts a messagePointer for {@link PackagingElementType#myPresentableName} - */ - @Deprecated - @ApiStatus.ScheduledForRemoval(inVersion = "2021.3") - protected PackagingElementType(@NotNull @NonNls String id, @NotNull @Nls(capitalization = Nls.Capitalization.Title) String presentableName) { - this(id, () -> presentableName); - } - protected PackagingElementType(@NotNull @NonNls String id, @NotNull Supplier<@Nls(capitalization = Nls.Capitalization.Title) String> presentableName) { myId = id; myPresentableName = presentableName; diff --git a/java/execution/impl/src/com/intellij/execution/testframework/AbstractPatternBasedConfigurationProducer.java b/java/execution/impl/src/com/intellij/execution/testframework/AbstractPatternBasedConfigurationProducer.java index 6726ce43f9c5..9726e299aac4 100644 --- a/java/execution/impl/src/com/intellij/execution/testframework/AbstractPatternBasedConfigurationProducer.java +++ b/java/execution/impl/src/com/intellij/execution/testframework/AbstractPatternBasedConfigurationProducer.java @@ -3,14 +3,12 @@ package com.intellij.execution.testframework; import com.intellij.execution.JavaTestConfigurationBase; import com.intellij.execution.actions.ConfigurationContext; -import com.intellij.execution.configurations.ConfigurationType; import com.intellij.openapi.actionSystem.CommonDataKeys; import com.intellij.openapi.actionSystem.DataContext; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiMethod; import com.intellij.psi.search.PsiElementProcessor; import com.intellij.psi.util.PsiTreeUtil; -import org.jetbrains.annotations.ApiStatus; import java.util.Iterator; import java.util.LinkedHashSet; @@ -18,17 +16,7 @@ import java.util.Objects; import java.util.Set; public abstract class AbstractPatternBasedConfigurationProducer extends AbstractJavaTestConfigurationProducer implements Cloneable { - /** - * @deprecated Override {@link #getConfigurationFactory()}. - */ - @Deprecated - @ApiStatus.ScheduledForRemoval(inVersion = "2021.3") - public AbstractPatternBasedConfigurationProducer(ConfigurationType configurationType) { - super(configurationType); - } - protected AbstractPatternBasedConfigurationProducer() { - super(); } public boolean isConfiguredFromContext(ConfigurationContext context, Set patterns) { diff --git a/java/execution/openapi/src/com/intellij/execution/configurations/JavaParameters.java b/java/execution/openapi/src/com/intellij/execution/configurations/JavaParameters.java index 090e0a91dfac..3e91940956d9 100644 --- a/java/execution/openapi/src/com/intellij/execution/configurations/JavaParameters.java +++ b/java/execution/openapi/src/com/intellij/execution/configurations/JavaParameters.java @@ -117,13 +117,6 @@ public class JavaParameters extends SimpleJavaParameters { configureByModule(module, classPathType, getValidJdkToRunModule(module, (classPathType & TESTS_ONLY) == 0)); } - /** @deprecated use {@link #getValidJdkToRunModule(Module, boolean)} instead */ - @Deprecated - @ApiStatus.ScheduledForRemoval(inVersion = "2021.3") - public static Sdk getModuleJdk(final Module module) throws CantRunException { - return getValidJdkToRunModule(module, false); - } - @NotNull public static Sdk getValidJdkToRunModule(final Module module, boolean productionOnly) throws CantRunException { Sdk jdk = getJdkToRunModule(module, productionOnly); diff --git a/java/idea-ui/src/com/intellij/framework/library/DownloadableLibraryType.java b/java/idea-ui/src/com/intellij/framework/library/DownloadableLibraryType.java index 3af988b5b3da..bfacd653664a 100644 --- a/java/idea-ui/src/com/intellij/framework/library/DownloadableLibraryType.java +++ b/java/idea-ui/src/com/intellij/framework/library/DownloadableLibraryType.java @@ -15,7 +15,6 @@ */ package com.intellij.framework.library; -import com.intellij.diagnostic.PluginException; import com.intellij.ide.JavaUiBundle; import com.intellij.openapi.project.Project; import com.intellij.openapi.roots.libraries.*; @@ -33,7 +32,6 @@ import java.util.List; import java.util.function.Supplier; public abstract class DownloadableLibraryType extends LibraryType { - private final Icon myIcon; private final Supplier<@Nls(capitalization = Nls.Capitalization.Title) String> myLibraryCategoryName; private final DownloadableLibraryDescription myLibraryDescription; @@ -50,20 +48,6 @@ public abstract class DownloadableLibraryType extends LibraryType libraryCategoryName, libraryTypeId, groupId, localUrls); } - /** - * @deprecated The constructor is meant to maintain the binary compatibility with external plugins. - * Please use the constructors with a messagePointer for {@link DownloadableLibraryType#myLibraryCategoryName} - */ - @Deprecated - @ApiStatus.ScheduledForRemoval(inVersion = "2021.3") - public DownloadableLibraryType(@NotNull @Nls(capitalization = Nls.Capitalization.Title) String libraryCategoryName, - @NotNull String libraryTypeId, - @NotNull String groupId, - @Nullable Icon icon, - URL @NotNull ... localUrls) { - this(() -> libraryCategoryName, libraryTypeId, groupId, icon, localUrls); - } - /** * Creates instance of library type. You also must override {@link #getLibraryTypeIcon()} method and return non-null value * from it. @@ -77,19 +61,6 @@ public abstract class DownloadableLibraryType extends LibraryType libraryCategoryName, - @NotNull String libraryTypeId, - @NotNull String groupId, - @Nullable Icon icon, - URL @NotNull ... localUrls) { super(new PersistentLibraryKind<>(libraryTypeId) { @NotNull @Override @@ -99,7 +70,6 @@ public abstract class DownloadableLibraryType extends LibraryType { @Deprecated public JdkComboBox(@NotNull final ProjectSdksModel jdkModel, @Nullable Condition filter) { - this(jdkModel, filter, getSdkFilter(filter), filter, false); - } - - /** - * @deprecated since {@link #setSetupButton} methods are deprecated, use the - * more specific constructor to pass all parameters - * - * The {@param addSuggestedItems} is ignored (it was not actively used) and - * it is no longer possible to have {@link SuggestedJdkItem} as a selected - * item of that ComboBox. The implementation will take care about turning a - * suggested SDKs into {@link Sdk}s - */ - @Deprecated - @ApiStatus.ScheduledForRemoval(inVersion = "2021.3") - @SuppressWarnings("unused") - public JdkComboBox(@NotNull final ProjectSdksModel jdkModel, - @Nullable Condition sdkTypeFilter, - @Nullable Condition filter, - @Nullable Condition creationFilter, - boolean addSuggestedItems) { - this(null, jdkModel, sdkTypeFilter, filter, creationFilter, null); + this(null, jdkModel, filter, getSdkFilter(filter), filter, null); } /** @@ -501,37 +480,6 @@ public class JdkComboBox extends SdkComboBoxBase { } } - /** - * @deprecated this type is never visible from the {@link #getSelectedItem()} method, - * it is kept here for binary compatibility - */ - @Deprecated - @ApiStatus.ScheduledForRemoval(inVersion = "2021.3") - public static class SuggestedJdkItem extends JdkComboBoxItem { - private final SdkType mySdkType; - private final String myPath; - - SuggestedJdkItem(@NotNull SdkType sdkType, @NotNull String path) { - mySdkType = sdkType; - myPath = path; - } - - @NotNull - public SdkType getSdkType() { - return mySdkType; - } - - @NotNull - public String getPath() { - return myPath; - } - - @Override - public String toString() { - return myPath; - } - } - /** * @deprecated Use the {@link JdkComboBox} API to manage shown items, * this call is ignored diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/daemon/ProjectStructureProblemDescription.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/daemon/ProjectStructureProblemDescription.java index b1e8dc89becb..e267c8ec5dec 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/daemon/ProjectStructureProblemDescription.java +++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/daemon/ProjectStructureProblemDescription.java @@ -15,14 +15,11 @@ */ package com.intellij.openapi.roots.ui.configuration.projectRoot.daemon; -import com.intellij.openapi.util.NlsContexts.DetailedDescription; import com.intellij.openapi.util.NlsSafe; import com.intellij.openapi.util.text.HtmlChunk; import com.intellij.openapi.util.text.StringUtil; -import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.Nls; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import java.util.List; @@ -60,39 +57,6 @@ public class ProjectStructureProblemDescription { myCanShowPlace = canShowPlace; } - /** - * @deprecated use the constructor with {@link HtmlChunk} for description. - */ - @Deprecated - @ApiStatus.ScheduledForRemoval(inVersion = "2021.3") - public ProjectStructureProblemDescription(@NotNull @Nls(capitalization = Nls.Capitalization.Sentence) String message, - @Nullable @DetailedDescription String description, - @NotNull PlaceInProjectStructure place, - @NotNull ProjectStructureProblemType problemType, - @NotNull List fixes) { - this(message, description, place, problemType, ProblemLevel.PROJECT, fixes, true); - } - - /** - * @deprecated use the constructor with {@link HtmlChunk} for description. - */ - @Deprecated - @ApiStatus.ScheduledForRemoval(inVersion = "2021.3") - public ProjectStructureProblemDescription(@NotNull @Nls(capitalization = Nls.Capitalization.Sentence) String message, - @Nullable @DetailedDescription String description, - @NotNull PlaceInProjectStructure place, - @NotNull ProjectStructureProblemType problemType, - @NotNull ProblemLevel level, - @NotNull List fixes, final boolean canShowPlace) { - this(message, - description != null ? HtmlChunk.raw(description) : HtmlChunk.empty(), - place, - problemType, - level, - fixes, - canShowPlace); - } - public ProblemLevel getProblemLevel() { return myProblemLevel; } diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/daemon/ProjectStructureProblemsHolderImpl.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/daemon/ProjectStructureProblemsHolderImpl.java index c373b7aabfe3..14b95c9b2023 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/daemon/ProjectStructureProblemsHolderImpl.java +++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/daemon/ProjectStructureProblemsHolderImpl.java @@ -1,9 +1,9 @@ package com.intellij.openapi.roots.ui.configuration.projectRoot.daemon; import com.intellij.ide.JavaUiBundle; -import com.intellij.lang.LangBundle; import com.intellij.openapi.util.NlsContexts; import com.intellij.openapi.util.text.HtmlBuilder; +import com.intellij.openapi.util.text.HtmlChunk; import com.intellij.util.SmartList; import com.intellij.xml.util.XmlStringUtil; import org.jetbrains.annotations.Nls; @@ -23,7 +23,13 @@ public class ProjectStructureProblemsHolderImpl implements ProjectStructureProbl @NotNull PlaceInProjectStructure place, @Nullable ConfigurationErrorQuickFix fix) { final List fixes = fix != null ? Collections.singletonList(fix) : Collections.emptyList(); - registerProblem(new ProjectStructureProblemDescription(message, description, place, problemType, fixes)); + registerProblem(new ProjectStructureProblemDescription(message, + description != null ? HtmlChunk.raw(description) : HtmlChunk.empty(), + place, + problemType, + ProjectStructureProblemDescription.ProblemLevel.PROJECT, + fixes, + true)); } @Override diff --git a/java/java-analysis-api/src/com/intellij/codeInsight/intention/QuickFixFactory.java b/java/java-analysis-api/src/com/intellij/codeInsight/intention/QuickFixFactory.java index 747ef0309e77..c412fea1a0e7 100644 --- a/java/java-analysis-api/src/com/intellij/codeInsight/intention/QuickFixFactory.java +++ b/java/java-analysis-api/src/com/intellij/codeInsight/intention/QuickFixFactory.java @@ -361,14 +361,6 @@ public abstract class QuickFixFactory { @NotNull public abstract IntentionAction createInitializeFinalFieldInConstructorFix(@NotNull PsiField field); - /** - * @deprecated use {@link #createDeleteFix(PsiElement)} on {@link PsiReferenceParameterList} instead. - */ - @Deprecated - @ApiStatus.ScheduledForRemoval(inVersion = "2021.3") - @NotNull - public abstract IntentionAction createRemoveTypeArgumentsFix(@NotNull PsiElement variable); - @NotNull public abstract IntentionAction createChangeClassSignatureFromUsageFix(@NotNull PsiClass owner, @NotNull PsiReferenceParameterList parameterList); diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/compiler/RemoveElementQuickFix.java b/java/java-analysis-impl/src/com/intellij/codeInspection/compiler/RemoveElementQuickFix.java deleted file mode 100644 index 1aa76158317b..000000000000 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/compiler/RemoveElementQuickFix.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2000-2019 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.codeInspection.compiler; - -import com.intellij.codeInspection.LocalQuickFix; -import com.intellij.codeInspection.ProblemDescriptor; -import com.intellij.codeInspection.util.IntentionFamilyName; -import com.intellij.openapi.project.Project; -import com.intellij.psi.PsiElement; -import org.jetbrains.annotations.ApiStatus; -import org.jetbrains.annotations.Nls; -import org.jetbrains.annotations.NotNull; - -/** @deprecated use {@link com.intellij.codeInsight.intention.QuickFixFactory#createDeleteFix} */ -@Deprecated -@ApiStatus.ScheduledForRemoval(inVersion = "2021.3") -public class RemoveElementQuickFix implements LocalQuickFix { - private final @IntentionFamilyName String myName; - - public RemoveElementQuickFix(@NotNull @Nls final String name) { - myName = name; - } - - @NotNull - @Override - public String getFamilyName() { - return myName; - } - - @Override - public void applyFix(@NotNull final Project project, @NotNull final ProblemDescriptor descriptor) { - final PsiElement element = descriptor.getPsiElement(); - if (element != null) { - element.delete(); - } - } -} \ No newline at end of file diff --git a/java/java-impl/src/com/intellij/codeInsight/intention/impl/config/QuickFixFactoryImpl.java b/java/java-impl/src/com/intellij/codeInsight/intention/impl/config/QuickFixFactoryImpl.java index 45cdc393f752..f6d8ac526c9b 100644 --- a/java/java-impl/src/com/intellij/codeInsight/intention/impl/config/QuickFixFactoryImpl.java +++ b/java/java-impl/src/com/intellij/codeInsight/intention/impl/config/QuickFixFactoryImpl.java @@ -607,19 +607,6 @@ public final class QuickFixFactoryImpl extends QuickFixFactory { return new InitializeFinalFieldInConstructorFix(field); } - @NotNull - @Override - public IntentionAction createRemoveTypeArgumentsFix(@NotNull PsiElement variable) { - final PsiVariable psiVariable = (PsiVariable)variable; - final PsiTypeElement typeElement = psiVariable.getTypeElement(); - assert typeElement != null; - final PsiJavaCodeReferenceElement referenceElement = typeElement.getInnermostComponentReferenceElement(); - assert referenceElement != null; - final PsiReferenceParameterList parameterList = referenceElement.getParameterList(); - assert parameterList != null; - return PriorityIntentionActionWrapper.highPriority(createDeleteFix(parameterList)); - } - @NotNull @Override public IntentionAction createChangeClassSignatureFromUsageFix(@NotNull PsiClass owner, @NotNull PsiReferenceParameterList parameterList) { diff --git a/java/java-impl/src/com/intellij/codeInsight/template/postfix/templates/ForIndexedPostfixTemplate.java b/java/java-impl/src/com/intellij/codeInsight/template/postfix/templates/ForIndexedPostfixTemplate.java index f3ae0fb03b16..3cc08b11b884 100644 --- a/java/java-impl/src/com/intellij/codeInsight/template/postfix/templates/ForIndexedPostfixTemplate.java +++ b/java/java-impl/src/com/intellij/codeInsight/template/postfix/templates/ForIndexedPostfixTemplate.java @@ -7,28 +7,18 @@ import com.intellij.codeInsight.template.impl.TextExpression; import com.intellij.codeInsight.template.macro.SuggestVariableNameMacro; import com.intellij.codeInsight.template.postfix.templates.editable.JavaEditablePostfixTemplate; import com.intellij.codeInsight.template.postfix.templates.editable.JavaPostfixTemplateExpressionCondition; -import com.intellij.codeInsight.template.postfix.util.JavaPostfixTemplatesUtils; -import com.intellij.openapi.util.Condition; import com.intellij.pom.java.LanguageLevel; import com.intellij.psi.CommonClassNames; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiExpression; import com.intellij.psi.PsiType; import com.intellij.util.containers.ContainerUtil; -import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import static com.intellij.codeInsight.template.postfix.util.JavaPostfixTemplatesUtils.*; public abstract class ForIndexedPostfixTemplate extends JavaEditablePostfixTemplate { - /** - * @deprecated use {@link JavaPostfixTemplatesUtils} - */ - @Deprecated @ApiStatus.ScheduledForRemoval(inVersion = "2021.3") - public static final Condition IS_NUMBER_OR_ARRAY_OR_ITERABLE = - element -> IS_ITERABLE_OR_ARRAY.value(element) || IS_NUMBER.value(element); - protected ForIndexedPostfixTemplate(@NotNull String templateName, @NotNull String templateText, @NotNull String example, @NotNull JavaPostfixTemplateProvider provider) { super(templateName, templateText, example, diff --git a/java/java-impl/src/com/intellij/ide/util/SuperMethodWarningUtil.java b/java/java-impl/src/com/intellij/ide/util/SuperMethodWarningUtil.java index 6d5c5b990885..ba61b41c87ad 100644 --- a/java/java-impl/src/com/intellij/ide/util/SuperMethodWarningUtil.java +++ b/java/java-impl/src/com/intellij/ide/util/SuperMethodWarningUtil.java @@ -31,7 +31,6 @@ import com.intellij.refactoring.RefactoringBundle; import com.intellij.util.ArrayUtilRt; import com.intellij.util.ObjectUtils; import com.intellij.util.containers.ContainerUtil; -import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.Nls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -127,18 +126,6 @@ public final class SuperMethodWarningUtil { public static PsiMethod checkSuperMethod(@NotNull PsiMethod method) { - return checkSuperMethod(method, RefactoringBundle.message("to.refactor")); - } - - /** - * @deprecated Use {@link SuperMethodWarningUtil#checkSuperMethod(PsiMethod)} instead. - * - * Custom action word doesn't work well with translations thus is replaced with "refactor" - */ - @Deprecated - @ApiStatus.ScheduledForRemoval(inVersion = "2021.3") - public static PsiMethod checkSuperMethod(@NotNull PsiMethod method, - @SuppressWarnings("unused") @NotNull String actionString) { ApplicationManager.getApplication().assertIsDispatchThread(); PsiClass aClass = method.getContainingClass(); if (aClass == null) return method; @@ -152,7 +139,7 @@ public final class SuperMethodWarningUtil { int useSuperMethod = showDialog( method.getProject(), - actionString, + RefactoringBundle.message("to.refactor"), DescriptiveNameUtil.getDescriptiveName(method), containingClass.isInterface() || superMethod.hasModifierProperty(PsiModifier.ABSTRACT), containingClass.isInterface(), diff --git a/java/java-impl/src/com/intellij/refactoring/memberPullUp/JavaPullUpHandler.java b/java/java-impl/src/com/intellij/refactoring/memberPullUp/JavaPullUpHandler.java index 4e0662cf584a..8b745283ea48 100644 --- a/java/java-impl/src/com/intellij/refactoring/memberPullUp/JavaPullUpHandler.java +++ b/java/java-impl/src/com/intellij/refactoring/memberPullUp/JavaPullUpHandler.java @@ -29,18 +29,11 @@ import com.intellij.refactoring.util.classMembers.MemberInfo; import com.intellij.refactoring.util.classMembers.MemberInfoStorage; import com.intellij.util.SmartList; import com.intellij.util.containers.MultiMap; -import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import java.util.List; public class JavaPullUpHandler implements RefactoringActionHandler, PullUpDialog.Callback, ElementsHandler, ContextAwareActionHandler { - /** - * @deprecated Use {@link #getRefactoringName()} instead - */ - @Deprecated @ApiStatus.ScheduledForRemoval(inVersion = "2021.3") - public static final String REFACTORING_NAME = "Pull Members Up"; - private PsiClass mySubclass; private Project myProject; diff --git a/java/java-impl/src/com/intellij/refactoring/memberPushDown/JavaPushDownHandler.java b/java/java-impl/src/com/intellij/refactoring/memberPushDown/JavaPushDownHandler.java index 27f4daec40fd..bd13973b61d8 100644 --- a/java/java-impl/src/com/intellij/refactoring/memberPushDown/JavaPushDownHandler.java +++ b/java/java-impl/src/com/intellij/refactoring/memberPushDown/JavaPushDownHandler.java @@ -37,7 +37,6 @@ import com.intellij.refactoring.lang.ElementsHandler; import com.intellij.refactoring.util.CommonRefactoringUtil; import com.intellij.refactoring.util.classMembers.MemberInfo; import com.intellij.refactoring.util.classMembers.MemberInfoStorage; -import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; @@ -47,12 +46,6 @@ import java.util.List; * @author dsl */ public class JavaPushDownHandler implements RefactoringActionHandler, ElementsHandler, ContextAwareActionHandler { - /** - * @deprecated Use {@link #getRefactoringName()} instead - */ - @Deprecated @ApiStatus.ScheduledForRemoval(inVersion = "2021.3") - public static final String REFACTORING_NAME = "Push Members Down"; - @Override public boolean isAvailableForQuickList(@NotNull Editor editor, @NotNull PsiFile file, @NotNull DataContext dataContext) { final List elements = getElements(editor, file, Ref.create(), true); diff --git a/java/java-impl/src/com/intellij/refactoring/psi/MyUsageViewUtil.java b/java/java-impl/src/com/intellij/refactoring/psi/MyUsageViewUtil.java deleted file mode 100644 index d30919ab31e5..000000000000 --- a/java/java-impl/src/com/intellij/refactoring/psi/MyUsageViewUtil.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2000-2020 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.refactoring.psi; - - -import org.jetbrains.annotations.ApiStatus; - -/** - * @deprecated use message choice format directly - */ -@Deprecated -@ApiStatus.ScheduledForRemoval(inVersion = "2021.3") -public final class MyUsageViewUtil { - - public static String getUsageCountInfo(int usagesCount, int filesCount, String referenceWord) { - if (filesCount > 0) { - final String files = filesCount != 1 ? " files " : " file "; - if (usagesCount > 1) { - referenceWord += "s"; - } - return "( " + usagesCount + " " + referenceWord + " in " + filesCount + files + ")"; - } else { - return "( Not found )"; - } - } -} diff --git a/java/java-impl/src/com/intellij/refactoring/util/duplicates/MethodDuplicatesHandler.java b/java/java-impl/src/com/intellij/refactoring/util/duplicates/MethodDuplicatesHandler.java index 622996201568..c7b9f65cf100 100644 --- a/java/java-impl/src/com/intellij/refactoring/util/duplicates/MethodDuplicatesHandler.java +++ b/java/java-impl/src/com/intellij/refactoring/util/duplicates/MethodDuplicatesHandler.java @@ -53,7 +53,6 @@ import com.intellij.refactoring.RefactoringBundle; import com.intellij.refactoring.actions.RefactoringActionContextUtil; import com.intellij.refactoring.extractMethod.InputVariables; import com.intellij.refactoring.util.CommonRefactoringUtil; -import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -63,12 +62,6 @@ import java.util.*; * @author dsl */ public class MethodDuplicatesHandler implements RefactoringActionHandler, ContextAwareActionHandler { - /** - * @deprecated Use {@link #getRefactoringName()} instead - */ - @Deprecated - @ApiStatus.ScheduledForRemoval(inVersion = "2021.3") - public static final String REFACTORING_NAME = "Replace Code Duplicates"; private static final Logger LOG = Logger.getInstance(MethodDuplicatesHandler.class); @Override diff --git a/java/java-psi-api/src/com/intellij/pom/java/LanguageLevel.java b/java/java-psi-api/src/com/intellij/pom/java/LanguageLevel.java index b81976ef4c84..7187053135cc 100644 --- a/java/java-psi-api/src/com/intellij/pom/java/LanguageLevel.java +++ b/java/java-psi-api/src/com/intellij/pom/java/LanguageLevel.java @@ -7,7 +7,6 @@ import com.intellij.openapi.roots.LanguageLevelModuleExtension; import com.intellij.openapi.roots.LanguageLevelProjectExtension; import com.intellij.openapi.util.Key; import com.intellij.util.lang.JavaVersion; -import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.Nls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -96,13 +95,6 @@ public enum LanguageLevel { return myVersion; } - /** @deprecated use {@link org.jetbrains.jps.model.java.JpsJavaSdkType#complianceOption(JavaVersion)} */ - @Deprecated - @ApiStatus.ScheduledForRemoval(inVersion = "2020.3") - public String getCompilerComplianceDefaultOption() { - return myVersion.feature <= 8 ? "1." + myVersion.feature : String.valueOf(myVersion.feature); - } - /** See {@link JavaVersion#parse(String)} for supported formats. */ @Nullable public static LanguageLevel parse(@Nullable String compilerComplianceOption) { diff --git a/java/java-psi-api/src/com/intellij/psi/augment/PsiAugmentProvider.java b/java/java-psi-api/src/com/intellij/psi/augment/PsiAugmentProvider.java index 6affe47a4c81..a93e18a6ff37 100644 --- a/java/java-psi-api/src/com/intellij/psi/augment/PsiAugmentProvider.java +++ b/java/java-psi-api/src/com/intellij/psi/augment/PsiAugmentProvider.java @@ -117,16 +117,6 @@ public abstract class PsiAugmentProvider { // - /** - * @deprecated use {@link #collectAugments(PsiElement, Class, String)} - */ - @NotNull - @Deprecated - @ApiStatus.ScheduledForRemoval(inVersion = "2021.3") - public static List collectAugments(@NotNull PsiElement element, @NotNull Class type) { - return collectAugments(element, type, null); - } - @NotNull public static List collectAugments(@NotNull PsiElement element, @NotNull Class type, @Nullable String nameHint) { diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/PsiElementFinderImpl.java b/java/java-psi-impl/src/com/intellij/psi/impl/PsiElementFinderImpl.java index 06de952de5b4..4c0bc783d5af 100644 --- a/java/java-psi-impl/src/com/intellij/psi/impl/PsiElementFinderImpl.java +++ b/java/java-psi-impl/src/com/intellij/psi/impl/PsiElementFinderImpl.java @@ -17,7 +17,6 @@ import com.intellij.psi.stubs.StubTreeLoader; import com.intellij.psi.util.PsiClassUtil; import com.intellij.util.Processor; import com.intellij.util.containers.ContainerUtil; -import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -33,16 +32,6 @@ public final class PsiElementFinderImpl extends PsiElementFinder implements Dumb myFileManager = JavaFileManager.getInstance(project); } - /** - * @deprecated use {@link #PsiElementFinderImpl(Project)} - */ - @Deprecated - @ApiStatus.ScheduledForRemoval(inVersion = "2021.3") - public PsiElementFinderImpl(Project project, JavaFileManager javaFileManager) { - myProject = project; - myFileManager = javaFileManager; - } - @Override public PsiClass findClass(@NotNull String qualifiedName, @NotNull GlobalSearchScope scope) { if (skipIndices()) {