From 2ff14d81173263c4dbcc0864b1d3deb74c8da1ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yann=20C=C3=A9bron?= Date: Thu, 13 Jun 2019 12:26:27 +0200 Subject: [PATCH] [analysis-api] fix deprecation problems GitOrigin-RevId: 254a9e802a41aa8ca762684ee3011b00ce68d9a8 --- .../HighlightDisplayLevel.java | 2 +- .../intellij/codeInspection/HTMLComposer.java | 2 +- .../codeInspection/ProblemHighlightType.java | 3 ++- .../codeInspection/reference/RefElement.java | 3 +++ .../codeInspection/reference/RefFile.java | 4 ++++ .../lang/annotation/HighlightSeverity.java | 8 +++++--- .../problems/WolfTheProblemSolver.java | 3 +++ .../scope/packageSet/NamedScopesHolder.java | 3 +++ .../scope/packageSet/PackageSetBase.java | 18 ++---------------- 9 files changed, 24 insertions(+), 22 deletions(-) diff --git a/platform/analysis-api/src/com/intellij/codeHighlighting/HighlightDisplayLevel.java b/platform/analysis-api/src/com/intellij/codeHighlighting/HighlightDisplayLevel.java index 8e2a5cd717d3..d5838d6ff066 100644 --- a/platform/analysis-api/src/com/intellij/codeHighlighting/HighlightDisplayLevel.java +++ b/platform/analysis-api/src/com/intellij/codeHighlighting/HighlightDisplayLevel.java @@ -42,7 +42,7 @@ public class HighlightDisplayLevel { private static final TextAttributesKey DO_NOT_SHOW_KEY = TextAttributesKey.createTextAttributesKey("DO_NOT_SHOW"); public static final HighlightDisplayLevel DO_NOT_SHOW = new HighlightDisplayLevel(HighlightSeverity.INFORMATION, createIconByMask(JBColor.gray)); /** - * use #WEAK_WARNING instead + * @deprecated use {@link #WEAK_WARNING} instead */ @Deprecated public static final HighlightDisplayLevel INFO = new HighlightDisplayLevel(HighlightSeverity.INFO, createIconByKey(DO_NOT_SHOW_KEY)); diff --git a/platform/analysis-api/src/com/intellij/codeInspection/HTMLComposer.java b/platform/analysis-api/src/com/intellij/codeInspection/HTMLComposer.java index ba9b1df22165..c09466806afc 100644 --- a/platform/analysis-api/src/com/intellij/codeInspection/HTMLComposer.java +++ b/platform/analysis-api/src/com/intellij/codeInspection/HTMLComposer.java @@ -51,7 +51,7 @@ public abstract class HTMLComposer { public abstract void startListItem(@NonNls StringBuffer buf); /** - * Use css for indentations + * @deprecated Use CSS for indentations */ @Deprecated public static void appendAfterHeaderIndention(@NonNls StringBuffer buf) { diff --git a/platform/analysis-api/src/com/intellij/codeInspection/ProblemHighlightType.java b/platform/analysis-api/src/com/intellij/codeInspection/ProblemHighlightType.java index 07bbd9521f2f..31cc9795d9fc 100644 --- a/platform/analysis-api/src/com/intellij/codeInspection/ProblemHighlightType.java +++ b/platform/analysis-api/src/com/intellij/codeInspection/ProblemHighlightType.java @@ -34,7 +34,8 @@ public enum ProblemHighlightType { /** * Enforces {@link com.intellij.codeHighlighting.HighlightDisplayLevel#INFO} severity level. - * use #WEAK_WARNING instead + * + * @deprecated use {@link #WEAK_WARNING} instead */ @Deprecated INFO, diff --git a/platform/analysis-api/src/com/intellij/codeInspection/reference/RefElement.java b/platform/analysis-api/src/com/intellij/codeInspection/reference/RefElement.java index 3dd69aeff563..b62efafb752a 100644 --- a/platform/analysis-api/src/com/intellij/codeInspection/reference/RefElement.java +++ b/platform/analysis-api/src/com/intellij/codeInspection/reference/RefElement.java @@ -45,6 +45,9 @@ public interface RefElement extends RefEntity { throw new UnsupportedOperationException(); } + /** + * @deprecated use {@link #getPsiElement()} + */ @Deprecated default PsiElement getElement() { return getPsiElement(); diff --git a/platform/analysis-api/src/com/intellij/codeInspection/reference/RefFile.java b/platform/analysis-api/src/com/intellij/codeInspection/reference/RefFile.java index 098fd9710cb4..4ec04008640c 100644 --- a/platform/analysis-api/src/com/intellij/codeInspection/reference/RefFile.java +++ b/platform/analysis-api/src/com/intellij/codeInspection/reference/RefFile.java @@ -33,6 +33,10 @@ public interface RefFile extends RefElement { return getElement(); } + + /** + * @deprecated use {@link #getPsiElement()} + */ @Deprecated @Override default PsiFile getElement() { diff --git a/platform/analysis-api/src/com/intellij/lang/annotation/HighlightSeverity.java b/platform/analysis-api/src/com/intellij/lang/annotation/HighlightSeverity.java index 2ed9a487534e..97a924fff346 100644 --- a/platform/analysis-api/src/com/intellij/lang/annotation/HighlightSeverity.java +++ b/platform/analysis-api/src/com/intellij/lang/annotation/HighlightSeverity.java @@ -1,4 +1,4 @@ -// 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. +// 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.lang.annotation; import com.intellij.openapi.util.DefaultJDOMExternalizer; @@ -29,6 +29,8 @@ public class HighlightSeverity implements Comparable { /** * The standard severity level for 'weak' :) warning annotations. + * + * @deprecated use {@link #WEAK_WARNING} */ @Deprecated @SuppressWarnings("DeprecatedIsStillUsed") @@ -49,8 +51,8 @@ public class HighlightSeverity implements Comparable { /** * Standard severity levels. */ - @SuppressWarnings("deprecation") - public static final HighlightSeverity[] DEFAULT_SEVERITIES = {INFORMATION, GENERIC_SERVER_ERROR_OR_WARNING, INFO, WEAK_WARNING, WARNING, ERROR}; + public static final HighlightSeverity[] DEFAULT_SEVERITIES = + {INFORMATION, GENERIC_SERVER_ERROR_OR_WARNING, INFO, WEAK_WARNING, WARNING, ERROR}; /** * Creates a new highlighting severity level with the specified name and value. diff --git a/platform/analysis-api/src/com/intellij/problems/WolfTheProblemSolver.java b/platform/analysis-api/src/com/intellij/problems/WolfTheProblemSolver.java index f320cd935206..0f6010a569f8 100644 --- a/platform/analysis-api/src/com/intellij/problems/WolfTheProblemSolver.java +++ b/platform/analysis-api/src/com/intellij/problems/WolfTheProblemSolver.java @@ -55,6 +55,9 @@ public abstract class WolfTheProblemSolver { */ public abstract void clearProblemsFromExternalSource(@NotNull VirtualFile file, @NotNull Object source); + /** + * @deprecated use {@link com.intellij.problems.ProblemListener} directly + */ @Deprecated public abstract static class ProblemListener implements com.intellij.problems.ProblemListener { @Override diff --git a/platform/analysis-api/src/com/intellij/psi/search/scope/packageSet/NamedScopesHolder.java b/platform/analysis-api/src/com/intellij/psi/search/scope/packageSet/NamedScopesHolder.java index 41f50c220167..6213515b9af5 100644 --- a/platform/analysis-api/src/com/intellij/psi/search/scope/packageSet/NamedScopesHolder.java +++ b/platform/analysis-api/src/com/intellij/psi/search/scope/packageSet/NamedScopesHolder.java @@ -53,6 +53,9 @@ public abstract class NamedScopesHolder implements PersistentStateComponent myScopeListeners = ContainerUtil.createLockFreeCopyOnWriteList(); + /** + * @deprecated use {@link #addScopeListener(ScopeListener, Disposable)} instead + */ @Deprecated public void addScopeListener(@NotNull ScopeListener scopeListener) { myScopeListeners.add(scopeListener); diff --git a/platform/analysis-api/src/com/intellij/psi/search/scope/packageSet/PackageSetBase.java b/platform/analysis-api/src/com/intellij/psi/search/scope/packageSet/PackageSetBase.java index bae344cd9eb0..faa9283b1ce0 100644 --- a/platform/analysis-api/src/com/intellij/psi/search/scope/packageSet/PackageSetBase.java +++ b/platform/analysis-api/src/com/intellij/psi/search/scope/packageSet/PackageSetBase.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2011 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. - */ +// 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.psi.search.scope.packageSet; import com.intellij.openapi.project.Project; @@ -24,7 +10,7 @@ import org.jetbrains.annotations.Nullable; public abstract class PackageSetBase implements PackageSet { /** - * @see PackageSetBase#contains(VirtualFile, Project, NamedScopesHolder) + * @deprecated use {@link PackageSetBase#contains(VirtualFile, Project, NamedScopesHolder)} instead */ @Deprecated public abstract boolean contains(@NotNull VirtualFile file, NamedScopesHolder holder);