diff --git a/java/java-impl/src/com/intellij/codeInspection/deadCode/UnusedDeclarationPresentation.java b/java/java-impl/src/com/intellij/codeInspection/deadCode/UnusedDeclarationPresentation.java index 2853f90278a8..cdd76d872b00 100644 --- a/java/java-impl/src/com/intellij/codeInspection/deadCode/UnusedDeclarationPresentation.java +++ b/java/java-impl/src/com/intellij/codeInspection/deadCode/UnusedDeclarationPresentation.java @@ -684,4 +684,9 @@ public class UnusedDeclarationPresentation extends DefaultInspectionToolPresenta SingleInspectionProfilePanel.readHTML(htmlView, SingleInspectionProfilePanel.toHTML(htmlView, text, false)); return ScrollPaneFactory.createScrollPane(htmlView, true); } + + @Override + public int getProblemsCount(InspectionTree tree) { + return 0; + } } diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionToolPresentation.java b/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionToolPresentation.java index be718f0fb4c6..c447a4f4dd5f 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionToolPresentation.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionToolPresentation.java @@ -114,4 +114,8 @@ public interface InspectionToolPresentation extends ProblemDescriptionsProcessor default boolean isDummy() { return false; } + + default int getProblemsCount(InspectionTree tree) { + return tree.getSelectedDescriptors().length; + } } diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ui/QuickFixPreviewPanelFactory.java b/platform/lang-impl/src/com/intellij/codeInspection/ui/QuickFixPreviewPanelFactory.java index 442defee7642..cf30a35d92f9 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ui/QuickFixPreviewPanelFactory.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ui/QuickFixPreviewPanelFactory.java @@ -82,7 +82,7 @@ public class QuickFixPreviewPanelFactory { setLayout(new BoxLayout(this, BoxLayout.LINE_AXIS)); boolean hasComponents = false; - final int actualProblemCount = myView.getTree().getSelectedDescriptors().length; + final int actualProblemCount = myView.getTree().getContext().getPresentation(myWrapper).getProblemsCount(myView.getTree()); if (actualProblemCount > 1 || (actualProblemCount == 1 && problemCount > 1)) { add(getLabel(actualProblemCount)); hasComponents = true;