IDEA-69795 (Quickfix "Remove explicit array creation" breaks code)

This commit is contained in:
Bas Leijdekkers
2011-05-20 17:33:37 +02:00
parent e49630a434
commit 417fb950bb
4 changed files with 44 additions and 2 deletions
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<problems>
<problem>
<file>Test.java</file>
<line>10</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Redundant array creation</problem_class>
<description>Redundant array creation for calling varargs method</description>
</problem>
</problems>
@@ -0,0 +1,18 @@
class Test {
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(new A[]{a});
}
public static <T> C<T> asC(T... ts) {
return null;
}
class C<T> {}
}