From 2ca363c8d8db37e056e6dc160a640664686f78d7 Mon Sep 17 00:00:00 2001 From: Dmitry Batkovich Date: Tue, 12 Mar 2019 15:02:41 +0300 Subject: [PATCH] cleanup --- .../intellij/codeInspection/ui/InspectionResultsView.java | 2 +- .../src/com/intellij/codeInspection/ui/InspectionTree.java | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsView.java b/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsView.java index 5d038dfd5a4f..7a412b5b2a68 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsView.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsView.java @@ -112,7 +112,7 @@ public class InspectionResultsView extends JPanel implements Disposable, DataPro myScope = globalInspectionContext.getCurrentScope(); myGlobalInspectionContext = globalInspectionContext; myProvider = provider; - myTree = new InspectionTree(globalInspectionContext, this); + myTree = new InspectionTree(this); mySplitter = new OnePixelSplitter(false, AnalysisUIOptions.getInstance(globalInspectionContext.getProject()).SPLITTER_PROPORTION); mySplitter.setFirstComponent(ScrollPaneFactory.createScrollPane(myTree, SideBorder.LEFT)); diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionTree.java b/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionTree.java index b5f099d39b97..38c1bf0af2ac 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionTree.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionTree.java @@ -66,8 +66,7 @@ public class InspectionTree extends Tree { private final OccurenceNavigator myOccurenceNavigator = new MyOccurrenceNavigator(); private final InspectionResultsView myView; - public InspectionTree(@NotNull GlobalInspectionContextImpl context, - @NotNull InspectionResultsView view) { + public InspectionTree(@NotNull InspectionResultsView view) { myView = view; myModel = new InspectionTreeModel(); Disposer.register(view, myModel); @@ -93,7 +92,7 @@ public class InspectionTree extends Tree { @Override public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_ENTER) { - if (myView != null && !myView.isDisposed()) { + if (!myView.isDisposed()) { OpenSourceUtil.openSourcesFrom(DataManager.getInstance().getDataContext(myView), false); } } @@ -114,7 +113,7 @@ public class InspectionTree extends Tree { EdtInvocationManager.getInstance().invokeLater(() -> { expandPath(new TreePath(myModel.getRoot())); SmartExpander.installOn(InspectionTree.this); - if (myView != null && !myView.isDisposed()) { + if (!myView.isDisposed()) { myView.syncRightPanel(); } });