public void m3(List<T> list, T t) {
}
idea 报Type parameter ‘T’ hides visible type ‘org.apache.poi.ss.formula.functions.T’ 啥意思?就是说有一个具体的类或者接口了,在包"org.apache.poi.ss.formula.functions"包下,不得不感叹这名字是起的真随意呀[此处省略一万匹羊驼],来看看这个一万头羊驼的类或接口长傻样
package org.apache.poi.ss.formula.functions;
import org.apache.poi.ss.formula.eval.AreaEval;
import org.apache.poi.ss.formula.eval.ErrorEval;
import org.apache.poi.ss.formula.eval.RefEval;
import org.apache.poi.ss.formula.eval.StringEval;
import org.apache.poi.ss.formula.eval.ValueEval;
/**
* Implementation of Excel T() function
* <p>
* If the argument is a text or error value it is returned unmodified. All other argument types
* cause an empty string result. If the argument is an area, the first (top-left) cell is used
* (regardless of the coordinates of the evaluating formula cell).
*/
public final class T extends Fixed1ArgFunction {
public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0) {
ValueEval arg = arg0;
if (arg instanceof RefEval) {
// always use the first sheet
RefEval re = (RefEval)arg;
arg = re.getInnerValueEval(re.getFirstSheetIndex());
} else if (arg instanceof AreaEval) {
// when the arg is an area, choose the top left cell
arg = ((AreaEval) arg).getRelativeValue(0, 0);
}
if (arg instanceof StringEval) {
// Text values are returned unmodified
return arg;
}
if (arg instanceof ErrorEval) {
// Error values also returned unmodified
return arg;
}
// for all other argument types the result is empty string
return StringEval.EMPTY_INSTANCE;
}
}
解决办法1移除一万匹羊驼
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
</dependency>
解决办法2泛型参数改成其他名字,T是由class的意思,我也不知道改成啥好了,也不知道用C合不合适,也就是class的意思,词穷了,欢迎评论区留言