mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 03:21:12 +07:00
[java-refactoring] Better vararg handling in change signature
1. Properly handle non-vararg call sites 2. Update callsites when vararg type was changed to non-vararg or vice versa (without reordering, etc.) Fixes IDEA-318626 Change signature incorrectly wraps/unwraps arguments when changing between varargs and arrays GitOrigin-RevId: 3372a144be4363fef2c40e8968a07d8ed6b916a6
This commit is contained in:
committed by
intellij-monorepo-bot
parent
04f87958b9
commit
be6a068d76
@@ -0,0 +1,8 @@
|
||||
public class X
|
||||
{
|
||||
void doSo<caret>mething(int x, String[] args) { /* ... */ }
|
||||
|
||||
void use() {
|
||||
doSomething(0, new String[]{"one", "two"});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
public class X
|
||||
{
|
||||
void doSomething(int x, String... args) { /* ... */ }
|
||||
|
||||
void use() {
|
||||
doSomething(0, "one", "two");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
class X {
|
||||
<caret>X(String... args) {}
|
||||
|
||||
X(int x) {
|
||||
this();
|
||||
}
|
||||
}
|
||||
class Y extends X {}
|
||||
@@ -0,0 +1,12 @@
|
||||
class X {
|
||||
X(String[] args) {}
|
||||
|
||||
X(int x) {
|
||||
this(new String[]{});
|
||||
}
|
||||
}
|
||||
class Y extends X {
|
||||
Y() {
|
||||
super(new String[]{});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
public enum X
|
||||
{
|
||||
A(0, "foo", "bar"),
|
||||
B(0, new String[]{"one", "two"});
|
||||
|
||||
<caret>X(int x, String... args) { /* ... */ }
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
public enum X
|
||||
{
|
||||
A(0, new String[]{"foo", "bar"}),
|
||||
B(0, new String[]{"one", "two"});
|
||||
|
||||
X(int x, String[] args) { /* ... */ }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
public class X
|
||||
{
|
||||
void doSo<caret>mething(int x, String... args) { /* ... */ }
|
||||
|
||||
void use() {
|
||||
doSomething(0, "foo", "bar");
|
||||
doSomething(0, new String[]{"one", "two"});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
public class X
|
||||
{
|
||||
void doSome<caret>thing(int x, String... args) { /* ... */ }
|
||||
|
||||
void use() {
|
||||
doSomething(0, "foo", "bar");
|
||||
doSomething(0, new String[]{"one", "two"});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
public class X
|
||||
{
|
||||
void doSomething(String[] args, int x) { /* ... */ }
|
||||
|
||||
void use() {
|
||||
doSomething(new String[]{"foo", "bar"}, 0);
|
||||
doSomething(new String[]{"one", "two"}, 0);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
public class X
|
||||
{
|
||||
void doSomething(int x, String[] args) { /* ... */ }
|
||||
|
||||
void use() {
|
||||
doSomething(0, new String[]{"foo", "bar"});
|
||||
doSomething(0, new String[]{"one", "two"});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user