IntelliJ IDEA警告Type parameter ‘T‘ hides visible type ‘org.apache.poi.ss.formula.functions.T‘

问题分析

由于我的代码里引入了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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值