diff --git a/java/java-impl/src/com/intellij/codeInspection/deadCode/DummyEntryPointsPresentation.java b/java/java-impl/src/com/intellij/codeInspection/deadCode/DummyEntryPointsPresentation.java index fc4b3affa993..4b5c2aecfd29 100644 --- a/java/java-impl/src/com/intellij/codeInspection/deadCode/DummyEntryPointsPresentation.java +++ b/java/java-impl/src/com/intellij/codeInspection/deadCode/DummyEntryPointsPresentation.java @@ -28,6 +28,7 @@ import com.intellij.codeInspection.ui.InspectionTreeNode; import com.intellij.codeInspection.util.RefFilter; import com.intellij.openapi.actionSystem.AnActionEvent; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; public class DummyEntryPointsPresentation extends UnusedDeclarationPresentation { private static final RefEntryPointFilter myFilter = new RefEntryPointFilter(); @@ -43,7 +44,7 @@ public class DummyEntryPointsPresentation extends UnusedDeclarationPresentation } @Override - public QuickFixAction[] getQuickFixes(@NotNull final RefEntity[] refElements, InspectionTree tree) { + public QuickFixAction[] getQuickFixes(@NotNull final RefEntity[] refElements, @Nullable InspectionTree tree) { if (myQuickFixActions == null) { myQuickFixActions = new QuickFixAction[]{new MoveEntriesToSuspicious(getToolWrapper())}; } 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 cdd76d872b00..7ed962f81128 100644 --- a/java/java-impl/src/com/intellij/codeInspection/deadCode/UnusedDeclarationPresentation.java +++ b/java/java-impl/src/com/intellij/codeInspection/deadCode/UnusedDeclarationPresentation.java @@ -192,7 +192,7 @@ public class UnusedDeclarationPresentation extends DefaultInspectionToolPresenta } @Override - public QuickFixAction[] getQuickFixes(@NotNull final RefEntity[] refElements, InspectionTree tree) { + public QuickFixAction[] getQuickFixes(@NotNull final RefEntity[] refElements, @Nullable InspectionTree tree) { boolean showFixes = false; for (RefEntity element : refElements) { if (!getIgnoredRefElements().contains(element) && element.isValid()) { @@ -202,7 +202,7 @@ public class UnusedDeclarationPresentation extends DefaultInspectionToolPresenta } if (showFixes) { - final TreePath[] paths = tree.getSelectionPaths(); + final TreePath[] paths = tree != null ? tree.getSelectionPaths() : null; if (paths != null) { long count = Arrays.stream(paths).map(TreePath::getLastPathComponent) .filter(component -> component instanceof ProblemDescriptionNode).count();