From d6677139fa01a882287de42e54881e7840deac34 Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Mon, 11 May 2015 18:09:58 +0200 Subject: [PATCH] cleanup --- .../intellij/ide/actions/SearchEverywhereAction.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/ide/actions/SearchEverywhereAction.java b/platform/lang-impl/src/com/intellij/ide/actions/SearchEverywhereAction.java index 6eed5b02158b..9a100f4e0610 100644 --- a/platform/lang-impl/src/com/intellij/ide/actions/SearchEverywhereAction.java +++ b/platform/lang-impl/src/com/intellij/ide/actions/SearchEverywhereAction.java @@ -486,7 +486,9 @@ public class SearchEverywhereAction extends AnAction implements CustomComponentA } private void doNavigate(final int index) { - final Project project = CommonDataKeys.PROJECT.getData(DataManager.getInstance().getDataContext(getField().getTextEditor())); + final DataManager dataManager = DataManager.getInstance(); + if (dataManager == null) return; + final Project project = CommonDataKeys.PROJECT.getData(dataManager.getDataContext(getField().getTextEditor())); final Executor executor = ourShiftIsPressed.get() ? DefaultRunExecutor.getRunExecutorInstance() : ExecutorRegistry.getInstance().getExecutorById(ToolWindowId.DEBUG); @@ -575,7 +577,7 @@ public class SearchEverywhereAction extends AnAction implements CustomComponentA } if (isRunConfiguration(value)) { - ((ChooseRunConfigurationPopup.ItemWrapper)value).perform(project, executor, DataManager.getInstance().getDataContext(c)); + ((ChooseRunConfigurationPopup.ItemWrapper)value).perform(project, executor, dataManager.getDataContext(c)); } else { GotoActionAction.openOptionOrPerformAction(value, pattern, project, c, event); if (isToolWindowAction(value)) return; @@ -1074,7 +1076,7 @@ public class SearchEverywhereAction extends AnAction implements CustomComponentA PsiElement file; myLocationString = null; String pattern = "*" + myPopupField.getText(); - Matcher matcher = NameUtil.buildMatcher(pattern, 0, true, true, pattern.toLowerCase().equals(pattern)); + Matcher matcher = NameUtil.buildMatcher(pattern, 0, true, true); if (isMoreItem(index)) { cmp = More.get(isSelected); } else if (value instanceof VirtualFile @@ -1281,7 +1283,7 @@ public class SearchEverywhereAction extends AnAction implements CustomComponentA enum WidgetID {CLASSES, FILES, ACTIONS, SETTINGS, SYMBOLS, RUN_CONFIGURATIONS} - @SuppressWarnings("SSBasedInspection") + @SuppressWarnings({"SSBasedInspection", "unchecked"}) private class CalcThread implements Runnable { private final Project project; private final String pattern;