mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
varargs: prefer object for primitive varargs only
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
class XY {
|
||||
public static void foo(Object... x) { }
|
||||
public static void foo(Object a, Object... x) { }
|
||||
|
||||
public static void main(String[] args) {
|
||||
<ref>foo("a");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
class XY {
|
||||
public static void foo(Object... x) { }
|
||||
public static void foo(Object a, Object o, Object... x) { }
|
||||
|
||||
public static void main(String[] args) {
|
||||
<ref>foo("a", "b");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class XY {
|
||||
private void f(Object... bs) {}
|
||||
|
||||
private void f(int... is) {}
|
||||
|
||||
public static void main(String[] args) {
|
||||
<ref>f();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class XY {
|
||||
private void f(String... bs) {}
|
||||
|
||||
private void f(int... is) {}
|
||||
|
||||
public static void main(String[] args) {
|
||||
<ref>f();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
|
||||
class XY {
|
||||
public static void foo(String... x) { }
|
||||
public static void foo(Object a, Object... x) { }
|
||||
|
||||
public static void main(String[] args) {
|
||||
<ref>foo("a");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
class XY {
|
||||
public static void foo(String... x) { }
|
||||
public static void foo(Object a, String... x) { }
|
||||
|
||||
public static void main(String[] args) {
|
||||
<ref>foo("a");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
class XY {
|
||||
public static void foo(String... x) { }
|
||||
public static void foo(String a, String... x) { }
|
||||
|
||||
public static void main(String[] args) {
|
||||
<ref>foo("a");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user