Community
Participate
Working Groups
I don't know exactly how to give a title for this bug, but it is easily reproducible. Take this example source code: --- import java.util.Arrays; public class GenericTest { public static void main(String[] args) { Arrays.asList(GenericTest.class.getConstructors()[0].getParameterTypes()); } } --- It will generate this compilation error: The method asList(T[]) in the type Arrays is not applicable for the arguments (Class<?>[]) This error is wrong. There also a workaround: add an import statement for java.lang.reflect.Constructor import java.lang.reflect.Constructor; Then this piece of code will compile correctly. I discovered this bug because I have a workspace with the open source projects pico-container and jmock in it, and they both use this expression in their test-cases. Sun's javac compiler of jdk1.5.0beta2 compiles this code without problems, even without an import statement.
BTW this bug is in Eclipse version 3.1M1, but I can't select this version when entering a bug report.
Add 1.5 in the title.
This the definition of Arrays.asList: public static <T> List<T> asList(T... a) { return new ArrayList<T>(a); } We do not currently support variable args in method parameters. The 1.5 support in eclipse is constantly improving, please check the release notes for when support has been added.
Vararg support was released a while ago... missed this bug in Later.
.