mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
fix delegation to abstract method (EA-29618 - NPE: DelegateWithDefaultParamValueIntentionAction.invoke)
This commit is contained in:
+8
@@ -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);
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// "Generate delegated method with default parameter value" "true"
|
||||
abstract class Test {
|
||||
abstract int foo(int i<caret>i, boolean... args);
|
||||
}
|
||||
+3
-2
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user