don't use java smart pointer anchors for groovy (EA-64991 - INRE: FileBasedIndexImpl...
authorpeter <peter@jetbrains.com>
Wed, 18 Feb 2015 12:31:12 +0000 (13:31 +0100)
committerpeter <peter@jetbrains.com>
Wed, 18 Feb 2015 15:18:46 +0000 (16:18 +0100)
java/java-impl/src/com/intellij/psi/impl/smartPointers/AnchorElementInfoFactory.java

index a3ed29f87dddcd535b9a6d22ddb5a808944eae49..cace22fa1571f106cc2db8f71d5c1956d2853c26 100644 (file)
@@ -15,6 +15,7 @@
  */
 package com.intellij.psi.impl.smartPointers;
 
+import com.intellij.lang.java.JavaLanguage;
 import com.intellij.psi.*;
 import com.intellij.psi.impl.source.PsiFileWithStubSupport;
 import com.intellij.psi.stubs.IStubElementType;
@@ -53,6 +54,10 @@ public class AnchorElementInfoFactory implements SmartPointerElementInfoFactory
 
   @Nullable
   static PsiElement getAnchor(PsiElement element) {
+    if (!element.getLanguage().isKindOf(JavaLanguage.INSTANCE)) {
+      return null;
+    }
+    
     PsiUtilCore.ensureValid(element);
     PsiElement anchor = null;
     if (element instanceof PsiClass) {