Files
openide/java/java-tests/testData/inspection/redundantArrayForVarargs/Generic.java
Fabrice Tiercelin c2b459a91e [java-inspections] IDEA-289267 Change highlight to unused code on RedundantArrayForVarargsCall and RedundantLambdaParameterType
Also, new tests

GitOrigin-RevId: 5dbb45fc400ba8de0a360e05a4eaf0aee07e0e83
2023-06-16 20:28:52 +00:00

23 lines
499 B
Java

class Generic {
class A {}
class B extends A {}
void f() {
B b = new B();
C<A> l = asC(new A[]{b});
A a = new A();
C<A> m = asC(<warning descr="Redundant array creation for calling varargs method">new A[]</warning>{a});
}
public static <T> C<T> asC(T... ts) {
return null;
}
class C<T> {}
void m() {
System.out.println(String.format("%s %s", <warning descr="Redundant array creation for calling varargs method">new Object[] </warning>{"Z", "X"}));
}
}