I have the following code which is forking fine:
private <X extends SomeInterface<MyImplementation>> void test(String fqcn)
{
Class<X> c = (Class<X>)Class.forName(fqcn).asSubclass(SomeInterface.class);
...
}
However, I get a type safety warning
Type safety: Unchecked cast from Class<capture#2-of ? extends SomeInterface> to Class<X>
and wondering how to fix it?