前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >[搞事情]Type parameter ‘T‘ hides visible type ‘org.apache.poi.ss.formula.functions.T‘

[搞事情]Type parameter ‘T‘ hides visible type ‘org.apache.poi.ss.formula.functions.T‘

作者头像
九转成圣
发布2024-04-10 17:02:05
560
发布2024-04-10 17:02:05
举报
文章被收录于专栏:csdncsdn
代码语言:javascript
复制
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"包下,不得不感叹这名字是起的真随意呀[此处省略一万匹羊驼],来看看这个一万头羊驼的类或接口长傻样

代码语言:javascript
复制
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移除一万匹羊驼

代码语言:javascript
复制
<dependency>
     <groupId>org.apache.poi</groupId>
     <artifactId>poi-ooxml</artifactId>
 </dependency>

解决办法2泛型参数改成其他名字,T是由class的意思,我也不知道改成啥好了,也不知道用C合不合适,也就是class的意思,词穷了,欢迎评论区留言

本文参与?腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2024-04-10,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客?前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与?腾讯云自媒体分享计划? ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
http://www.vxiaotou.com