mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 01:50:56 +07:00
introduce parameter (IDEA-68498 )
(cherry picked from commit 0250f290f3d031a5d3f95faee8c280d241382040)
This commit is contained in:
@@ -427,6 +427,9 @@ public class IntroduceParameterProcessor extends BaseRefactoringProcessor implem
|
||||
argumentList.add(myParameterInitializer);
|
||||
}
|
||||
else {
|
||||
if (anchorParameter == null) {
|
||||
argumentList.add(myParameterInitializer);
|
||||
}
|
||||
for (int i = 0; i < psiParameters.length; i++) {
|
||||
PsiParameter psiParameter = psiParameters[i];
|
||||
if (!myParametersToRemove.contains(i)) {
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
public class Test {
|
||||
void m(int... ps) {
|
||||
m("asd", ps);
|
||||
}
|
||||
|
||||
void m(final String anObject, int... ps) {
|
||||
System.out.println(anObject);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
public class Test {
|
||||
void m(int... ps) {
|
||||
System.out.println(<selection>"asd"</selection>);
|
||||
}
|
||||
}
|
||||
@@ -280,6 +280,10 @@ public class IntroduceParameterTest extends LightCodeInsightTestCase {
|
||||
doTest(IntroduceParameterRefactoring.REPLACE_FIELDS_WITH_GETTERS_ALL, true, false, true, false);
|
||||
}
|
||||
|
||||
public void testDelegateWithVarargs() throws Exception {
|
||||
doTest(IntroduceParameterRefactoring.REPLACE_FIELDS_WITH_GETTERS_ALL, true, false, true, true);
|
||||
}
|
||||
|
||||
private void doTestThroughHandler() throws Exception {
|
||||
configureByFile("/refactoring/introduceParameter/before" + getTestName(false) + ".java");
|
||||
boolean enabled = true;
|
||||
|
||||
Reference in New Issue
Block a user