Community
Participate
Working Groups
Build ID: I20070625-1500 Steps To Reproduce: package test; public class Test { void test() { B b = new C(); Class<? extends B> cb = C.class; YYY<C> y = new XXX(); Class<? extends YYY<C>> cy = XXX.class; YYY<? extends B> yb = new XXX(); Class<? extends YYY<? extends B>> ybc = XXX.class; Class<? extends YYY> ybb = yb.getClass(); Class<? extends YYY<?>> ybb2 = yb.getClass(); Class<? extends YYY<? extends B>> ybb3 = yb.getClass(); } } class Obj {} class B extends Obj {} class C extends B {} class ZZZ<T extends Obj> {} class YYY<T extends B> extends ZZZ<T> {} class XXX extends YYY<C> {} More information: This code also does not work with my sun jdk. I feel that there is something wrong, not quite sure what. I think that assignments to 'ybb2' and 'ybb3' should work, but they don't.
This is the right behavior. We conform to the JLS, and match javac behavior. The problem comes from the raw type in wildcard upper bound capture coming from #getClass() invocations. Added GenericTypeTest#test1425
Verified for 3.5M4