Community
Participate
Working Groups
Build ID: Build id: 20090619-0625 Steps To Reproduce: Eclipse 3.4, Netbeans 6.7, and javac (1.6) will compile this, but Eclipse 3.5 Galileo wont. public class Test { public WWorkflow<? extends Workflow> getMainWorkflow(){ return get(WWorkflow.class, null); } public <T, W extends WrapperLogic<? super T>> W get(Class<W> wrapperClass, T entity) { return null; } } public class Workflow { } public class WWorkflow<T extends Workflow> extends WrapperLogic<T> { } public abstract class WrapperLogic<WRAPPED> { private WRAPPED wrapped; } More information:
(In reply to comment #0) Some observations: Deleting "super T" from the signature of get() makes this code fragment compilable. The problem is initially caused by the fact that WWorkflow.class has a raw type: it doesn't specify the parameter <T> of WWorkflow. This seems to put the compiler into a different mode of type checking (haven't looked into sources). Compare this: class Clazz<T> { } WWorkflow<? extends Workflow> getMainWorkflow2(){ return get(new Clazz<WWorkflow<Workflow>>(), null); } public <T, W extends WrapperLogic<? super T>> W get(Clazz<W> desc, T entity) { return null; } The only difference is: using Clazz instead of Class we can create a value of the exact deeply parameterized type. -> Compiles fine even with the "super T" part.
*** This bug has been marked as a duplicate of bug 277643 ***
Verified for 3.6M1