Community
Participate
Working Groups
Compile the code below and execute Test. You get a stacktrace like the following: Exception in thread "main" java.lang.ClassCastException: [LType; at SubWorker.doit(X.java:1) at Test.main(X.java:17) class Type { } class SubType extends Type { } class Worker<T extends Type> { public void doit(T... ts) {} } class SubWorker extends Worker<SubType> { public void doit(SubType... ts) {} } class Test { public static void main(String args[]) { SubType s = new SubType(); Worker<SubType> w = new SubWorker(); w.doit(s,s); Worker<SubType> w2 = new Worker<SubType>(); w2.doit(s,s); } }
*** This bug has been marked as a duplicate of 99260 ***