fix delegation to abstract method (EA-29618 - NPE: DelegateWithDefaultParamValueIntentionAction.invoke)

This commit is contained in:
anna
2011-09-09 10:54:30 +02:00
parent 7ff91a3d92
commit 32e09dafb3
4 changed files with 21 additions and 3 deletions
@@ -0,0 +1,8 @@
// "Generate delegated method with default parameter value" "true"
abstract class Test {
int foo(boolean... args) {
return foo(<caret>, args);
}
abstract int foo(int ii, boolean... args);
}
@@ -0,0 +1,4 @@
// "Generate delegated method with default parameter value" "true"
abstract class Test {
abstract int foo(int i<caret>i, boolean... args);
}
@@ -15,6 +15,7 @@
*/
package com.intellij.codeInsight.daemon.quickFix;
import com.intellij.codeInsight.template.TemplateManager;
import com.intellij.codeInsight.template.impl.TemplateManagerImpl;
import com.intellij.codeInsight.template.impl.TemplateState;
@@ -26,7 +27,7 @@ public class DelegateWithDefaultParamValueTest extends LightQuickFixTestCase {
protected void doAction(String text, boolean actionShouldBeAvailable, String testFullPath, String testName)
throws Exception {
try {
((TemplateManagerImpl)TemplateManagerImpl.getInstance(getProject())).setTemplateTesting(true);
((TemplateManagerImpl)TemplateManager.getInstance(getProject())).setTemplateTesting(true);
super.doAction(text, actionShouldBeAvailable, testFullPath, testName);
if (actionShouldBeAvailable) {
@@ -35,7 +36,7 @@ public class DelegateWithDefaultParamValueTest extends LightQuickFixTestCase {
state.gotoEnd(false);
}
} finally {
((TemplateManagerImpl)TemplateManagerImpl.getInstance(getProject())).setTemplateTesting(false);
((TemplateManagerImpl)TemplateManager.getInstance(getProject())).setTemplateTesting(false);
}
}