从Class中取消选中

时间:2014-03-13 15:02:25

标签: java class generics unchecked-cast

我有这段代码:

public DriverExtensionFactory(
        Class<? extends AbstractNetworkInterface> serviceClass) {
    super((Class<AbstractNetworkInterface>) serviceClass);
}

它告诉我

Type safety: Unchecked cast from Class<capture#1-of ? extends AbstractNetworkInterface>
to Class<AbstractNetworkInterface>

我该如何以正确的方式解决这个问题?

谢谢!

修改

超类代码:

public AbstractExtensionFactory(Class<T> serviceClass) {
    service = serviceClass;
}

0 个答案:

没有答案