mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-09 20:42:52 +07:00
find method duplicates: respect varargs mix with constants/params; empty args list (IDEA-56076)
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
class A {
|
||||
void bar(int i){
|
||||
method(1);
|
||||
method(i, "a");
|
||||
method(1, "a", "b");
|
||||
}
|
||||
|
||||
void m<caret>(String... args) {
|
||||
method(1, args);
|
||||
}
|
||||
|
||||
void method(int i, String... args) {
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
class A {
|
||||
void bar(int i){
|
||||
m(new String[0]);
|
||||
method(i, "a");
|
||||
m("a", "b");
|
||||
}
|
||||
|
||||
void m(String... args) {
|
||||
method(1, args);
|
||||
}
|
||||
|
||||
void method(int i, String... args) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
class A {
|
||||
void bar(int i){
|
||||
method(i);
|
||||
method(i, "a");
|
||||
method(i, "a", "b");
|
||||
}
|
||||
|
||||
void m<caret>(int i, String... args) {
|
||||
method(i, args);
|
||||
}
|
||||
|
||||
void method(int i, String... args) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
class A {
|
||||
void bar(int i){
|
||||
m(i, new String[0]);
|
||||
m(i, "a");
|
||||
m(i, "a", "b");
|
||||
}
|
||||
|
||||
void m(int i, String... args) {
|
||||
method(i, args);
|
||||
}
|
||||
|
||||
void method(int i, String... args) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
class A {
|
||||
{
|
||||
method(1);
|
||||
method(1, "a");
|
||||
method(1, "a", "b");
|
||||
}
|
||||
|
||||
void m<caret>(String... args) {
|
||||
method(1, args);
|
||||
}
|
||||
|
||||
void method(int i, String... args) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
class A {
|
||||
{
|
||||
m(new String[0]);
|
||||
m("a");
|
||||
m("a", "b");
|
||||
}
|
||||
|
||||
void m(String... args) {
|
||||
method(1, args);
|
||||
}
|
||||
|
||||
void method(int i, String... args) {
|
||||
}
|
||||
}
|
||||
@@ -74,5 +74,15 @@ public class FindMethodDuplicatesMiscTest extends FindMethodDuplicatesBaseTest {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testVarargsAccess() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIncorrectVarargsAccess() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testVarVarargsAccess() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user