问题分析
由于我的代码里引入了org.apache.poi.ss.formula.functions.T
类,该类名为T,导致了IDEA警告Type parameter 'T' hides visible type 'org.apache.poi.ss.formula.functions.T'
问题,由于该T是一个具体的类型名称,不是泛型参数。
示例:
class T { // A concrete type T
}
interface B<T> { // warning: The type parameter T is hiding the type T
}
interface A<T> extends B<T> { // warning: The type parameter T is hiding the type T
T getObject();
}
代码里有一个名为T类或接口,或者您使用的T作为具体类型名称,而不是某个地方作为一个类型参数,则会提示The type parameter T is hiding the type T
。
问题解决
只需要删除引入或自定义的具体类型名称为T的类或接口即可。
示例:
interface B<T> {
}
interface A<T> extends B<T> {
T getObject();
}
参考文献:
1.疑难解答“类型参数T隐藏类型T”警告:http://www.uwenku.com/question/p-cezmltye-bda.html