mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 03:21:12 +07:00
redundant suppression: fix alternative id check (IDEA-227827)
GitOrigin-RevId: b80fe1fcc492f90f26bfd6f337d1c6947820e461
This commit is contained in:
committed by
intellij-monorepo-bot
parent
e882ed1e4f
commit
1bb1545bf7
@@ -0,0 +1,10 @@
|
||||
// "Remove 'boxing' suppression" "false"
|
||||
import java.util.ArrayList;
|
||||
|
||||
class Test {
|
||||
@SuppressWarnings( {"bo<caret>xing"})
|
||||
void doSomething() {
|
||||
final Integer number = 1;
|
||||
System.out.println(number);
|
||||
}
|
||||
}
|
||||
@@ -520,7 +520,7 @@ public class LocalInspectionsPass extends ProgressableTextEditorHighlightingPass
|
||||
@NotNull PsiElement element, boolean ignoreSuppressed) {
|
||||
LocalInspectionTool tool = toolWrapper.getTool();
|
||||
if (ignoreSuppressed && SuppressionUtil.inspectionResultSuppressed(element, tool)) {
|
||||
mySuppressedElements.computeIfAbsent(toolWrapper.getID(), shortName -> new HashSet<>()).add(element);
|
||||
registerSuppressedElements(toolWrapper, element);
|
||||
return;
|
||||
}
|
||||
HighlightInfoType level = ProblemDescriptorUtil.highlightTypeFromDescriptor(descriptor, severity, mySeverityRegistrar);
|
||||
@@ -569,6 +569,15 @@ public class LocalInspectionsPass extends ProgressableTextEditorHighlightingPass
|
||||
injectToHost(outInfos, ilManager, file, documentRange, toolWrapper, element, fixes, info);
|
||||
}
|
||||
|
||||
private void registerSuppressedElements(@NotNull LocalInspectionToolWrapper toolWrapper,
|
||||
@NotNull PsiElement element) {
|
||||
mySuppressedElements.computeIfAbsent(toolWrapper.getID(), shortName -> new HashSet<>()).add(element);
|
||||
String alternativeID = toolWrapper.getAlternativeID();
|
||||
if (alternativeID != null) {
|
||||
mySuppressedElements.computeIfAbsent(alternativeID, shortName -> new HashSet<>()).add(element);
|
||||
}
|
||||
}
|
||||
|
||||
private static void injectToHost(@NotNull List<? super HighlightInfo> outInfos,
|
||||
@NotNull InjectedLanguageManager ilManager,
|
||||
@NotNull PsiFile file,
|
||||
@@ -754,7 +763,7 @@ public class LocalInspectionsPass extends ProgressableTextEditorHighlightingPass
|
||||
@Override
|
||||
public void registerProblem(@NotNull ProblemDescriptor descriptor) {
|
||||
if (host != null && myIgnoreSuppressed && SuppressionUtil.inspectionResultSuppressed(host, tool)) {
|
||||
mySuppressedElements.computeIfAbsent(wrapper.getID(), shortName -> new HashSet<>()).add(host);
|
||||
registerSuppressedElements(wrapper, host);
|
||||
return;
|
||||
}
|
||||
super.registerProblem(descriptor);
|
||||
|
||||
Reference in New Issue
Block a user