IDEADEV-41634: Groovy: NPE at GenericInlineHandler​.​invoke​()
authorMaxim Medvedev <maxim.medvedev@jetbrains.com>
Mon, 30 Nov 2009 14:53:56 +0000 (17:53 +0300)
committerMaxim Medvedev <maxim.medvedev@jetbrains.com>
Mon, 30 Nov 2009 14:53:56 +0000 (17:53 +0300)
plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/inline/GroovyInlineHandler.java

index 8e0e3d0816c5babe23e955095f2fcce57a2978cd..b39489fabbcc54e22660f526b6ce63ab0024ab61 100644 (file)
@@ -26,6 +26,7 @@ import com.intellij.refactoring.HelpID;
 import com.intellij.refactoring.util.CommonRefactoringUtil;
 import org.jetbrains.annotations.Nullable;
 import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrVariable;
+import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.GrTypeDefinition;
 import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrMethod;
 import org.jetbrains.plugins.groovy.lang.psi.api.util.GrVariableDeclarationOwner;
 import org.jetbrains.plugins.groovy.refactoring.GroovyRefactoringBundle;
@@ -50,6 +51,9 @@ public class GroovyInlineHandler implements InlineHandler {
         String message = GroovyRefactoringBundle.message("wrong.element.to.inline");
         CommonRefactoringUtil.showErrorHint(element.getProject(), editor, message, INLINE_REFACTORING, HelpID.INLINE_VARIABLE);
       }
+      if (element instanceof GrTypeDefinition) {
+        return null;      //todo inline to anonymous class, push members from super class
+      }
     }
 
     if (element instanceof PsiMember) {