class Test1<T> {
Test1(Class<T> type) {}
}
class Test2 extends Test1<Class> {
Test2() {
super(Class.class);
}
}
This works, but, I am warned about use of a raw generic type in "Test1<Class>
". I understand that, but, changing it to "Class<?>
" (which should be equivalent?) gives a compiler error in the call to super() -- Class.class is apparently of type "Class<Class>
" instead of "Class<Class<?>>
".
Variants on these all seem to result in a compile error.
Can anyone see how to resolve this, such that I am always using a type param with Class, and hence don't get an IDE warning? It seems better that way, even if it works as-is. I am open to changes in the structure of these two classes two as long as it preserves the basic intent: Test2 is a special type of Test1, specialized for "Class" objects.