IDEADEV-41635: Groovy: IllegalArgumentException at GrTypeDefinitionImpl​.​add​()...
authorMaxim Medvedev <maxim.medvedev@jetbrains.com>
Mon, 7 Dec 2009 11:33:22 +0000 (14:33 +0300)
committerMaxim Medvedev <maxim.medvedev@jetbrains.com>
Mon, 7 Dec 2009 11:33:22 +0000 (14:33 +0300)
java/java-impl/src/com/intellij/refactoring/inlineSuperClass/InlineSuperClassRefactoringHandler.java

index 67854fc88245267c9591c8ba2c610027dda55871..94e363faeae0d5ab48601bc30228493408977b60 100644 (file)
  */
 package com.intellij.refactoring.inlineSuperClass;
 
+import com.intellij.lang.StdLanguages;
 import com.intellij.openapi.editor.Editor;
 import com.intellij.openapi.project.Project;
 import com.intellij.psi.PsiAnonymousClass;
 import com.intellij.psi.PsiClass;
 import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
 import com.intellij.psi.search.searches.ClassInheritorsSearch;
 import com.intellij.psi.util.PsiTreeUtil;
 import com.intellij.refactoring.inline.JavaInlineActionHandler;
@@ -42,6 +44,7 @@ public class InlineSuperClassRefactoringHandler extends JavaInlineActionHandler
 
   public boolean canInlineElement(PsiElement element) {
     if (!(element instanceof PsiClass)) return false;
+    if (element.getLanguage() != StdLanguages.JAVA) return false;
     Collection<PsiClass> inheritors = ClassInheritorsSearch.search((PsiClass)element).findAll();
     return inheritors.size() > 0;
   }