EA-18066
authorAlexey Kudravtsev <cdr@intellij.com>
Mon, 7 Jun 2010 13:42:28 +0000 (17:42 +0400)
committerAlexey Kudravtsev <cdr@intellij.com>
Wed, 9 Jun 2010 09:12:42 +0000 (13:12 +0400)
platform/lang-impl/src/com/intellij/find/actions/ShowUsagesAction.java

index eabacdfa1123ad3c0199e0e2e73876212c496dfe..e03ad8f5276609d57de1acff30e2260a559df153 100644 (file)
@@ -202,9 +202,7 @@ public class ShowUsagesAction extends AnAction {
     final List<Usage> usages = new ArrayList<Usage>();
     final Set<UsageNode> visibleNodes = new LinkedHashSet<UsageNode>();
     Processor<Usage> collect = new Processor<Usage>() {
-      final UsageTarget[] myUsageTarget = new UsageTarget[] {
-        new PsiElement2UsageTargetAdapter(handler.getPsiElement())
-      };
+      final UsageTarget[] myUsageTarget = {new PsiElement2UsageTargetAdapter(handler.getPsiElement())};
 
       public boolean process(@NotNull Usage usage) {
         synchronized (usages) {
@@ -387,7 +385,9 @@ public class ShowUsagesAction extends AnAction {
         if (!(element instanceof UsageNode)) return element.toString();
         UsageNode node = (UsageNode)element;
         GroupNode group = (GroupNode)node.getParent();
-        return node.getUsage().getPresentation().getPlainText() + group.toString();
+        Usage usage = node.getUsage();
+        if (usage == NullUsage.INSTANCE) return "";
+        return usage.getPresentation().getPlainText() + group.toString();
       }
 
       protected void selectElement(Object element, String selectedText) {