deprecate some methods to reduce an unhealthy zoo a little

GitOrigin-RevId: 21ab084116b2ebbe3ec6a511404a349266f108d1
This commit is contained in:
Alexey Kudravtsev
2019-11-22 12:44:30 +00:00
committed by intellij-monorepo-bot
parent 564277bd2f
commit e342ce6bd1
5 changed files with 20 additions and 11 deletions
@@ -46,7 +46,7 @@ public class OfflineInspectionResultViewTest extends TestSourceBasedTestCase {
HighlightDisplayKey key = HighlightDisplayKey.find(UnusedDeclarationInspectionBase.SHORT_NAME);
if (key == null) {
HighlightDisplayKey.register(UnusedDeclarationInspectionBase.SHORT_NAME);
HighlightDisplayKey.register(UnusedDeclarationInspectionBase.SHORT_NAME, UnusedDeclarationInspectionBase.DISPLAY_NAME, UnusedDeclarationInspectionBase.SHORT_NAME);
}
final InspectionProfileImpl profile = new InspectionProfileImpl("test") {
@@ -4,6 +4,7 @@ package com.intellij.codeInsight.daemon;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.Computable;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -35,6 +36,12 @@ public class HighlightDisplayKey {
return null;
}
/**
* @deprecated Use {@link #register(String, String, String)} instead
*/
@Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2020.2")
@Nullable
public static HighlightDisplayKey register(@NonNls @NotNull final String name) {
final HighlightDisplayKey key = find(name);
@@ -42,23 +49,29 @@ public class HighlightDisplayKey {
LOG.error("Key with name '" + name + "' already registered with display name: " + getDisplayNameByKey(key));
return null;
}
return new HighlightDisplayKey(name);
return new HighlightDisplayKey(name, name);
}
/**
* @see #register(String, Computable)
* @deprecated Use {@link #register(String, String, String)} instead
*/
@Deprecated
@Nullable
@ApiStatus.ScheduledForRemoval(inVersion = "2020.2")
public static HighlightDisplayKey register(@NonNls @NotNull final String name, @NotNull final String displayName) {
return register(name, displayName, name);
}
/**
* @deprecated Use {@link #register(String, Computable, String)} instead
*/
@Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2020.2")
@Nullable
public static HighlightDisplayKey register(@NonNls @NotNull final String name, @NotNull Computable<String> displayName) {
return register(name, displayName, name);
}
/**
* @see #register(String, Computable, String)
*/
@@ -137,10 +150,6 @@ public class HighlightDisplayKey {
}
private HighlightDisplayKey(@NonNls @NotNull final String name) {
this(name, name);
}
public HighlightDisplayKey(@NonNls @NotNull final String name, @NonNls @NotNull final String ID) {
myName = name;
myID = ID;
@@ -542,7 +542,7 @@ public class InspectionProfileImpl extends NewInspectionProfile {
((LocalInspectionToolWrapper)toolWrapper).getAlternativeID());
}
else {
key = HighlightDisplayKey.register(shortName, computable);
key = HighlightDisplayKey.register(shortName, computable, shortName);
}
}
@@ -155,7 +155,7 @@ public class InspectionTestUtil {
final String shortName = toolWrapper.getShortName();
final HighlightDisplayKey key = HighlightDisplayKey.find(shortName);
if (key == null){
HighlightDisplayKey.register(shortName);
HighlightDisplayKey.register(shortName, toolWrapper.getDisplayName(), toolWrapper.getID());
}
globalContext.doInspections(scope);
@@ -253,7 +253,7 @@ public class DomHighlightingLiteTest extends DomTestCase {
final String shortName = inspection.getShortName();
HighlightDisplayKey key = HighlightDisplayKey.find(shortName);
if (key == null) {
HighlightDisplayKey.register(shortName);
HighlightDisplayKey.register(shortName, shortName, inspection.getID());
}
}