Failed
org.eclipse.jdt.core.tests.compiler.regression.MethodVerifyTest.test330435 - 10 (from org.eclipse.jdt.core.tests.compiler.regression.TestAll)
Error Message
test330435 - Eclipse found error(s) but Javac did not find any. ----------- Expected ------------ ------------ but was ------------ ----------\n 1. ERROR in X.java (at line 3)\n String[] a = A.asList(args).toArray(new String[0]);\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n Type mismatch: cannot convert from Object[] to String[]\n ----------\n --------- Difference is ---------- expected:<[]> but was:<[----------\n 1. ERROR in X.java (at line 3)\n String[] a = A.asList(args).toArray(new String[0]);\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n Type mismatch: cannot convert from Object[] to String[]\n ----------\n ]>
Stacktrace
junit.framework.ComparisonFailure: test330435 - Eclipse found error(s) but Javac did not find any. ----------- Expected ------------ ------------ but was ------------ ----------\n 1. ERROR in X.java (at line 3)\n String[] a = A.asList(args).toArray(new String[0]);\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n Type mismatch: cannot convert from Object[] to String[]\n ----------\n --------- Difference is ---------- expected:<[]> but was:<[----------\n 1. ERROR in X.java (at line 3)\n String[] a = A.asList(args).toArray(new String[0]);\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n Type mismatch: cannot convert from Object[] to String[]\n ----------\n ]> at org.eclipse.jdt.core.tests.compiler.regression.MethodVerifyTest.test330435(MethodVerifyTest.java:12264)
Standard Output
org.eclipse.jdt.core.tests.compiler.regression.MethodVerifyTest#test330435 - 10 X.java [ public class X { String[] foo(Object[] args) { String[] a = A.asList(args).toArray(new String[0]); return a; } } ] Full results sent to /tmp/comptest/run.1584245034298/10.0.2_20200315_040443.txt
Standard Error
--- javac err: --- A.java:2: warning: [unchecked] Possible heap pollution from parameterized vararg type T public static <T> B<T> asList(T... tab) { ^ where T is a type-variable: T extends Object declared in method <T>asList(T...) 1 warning ----------------------------------------