Error Log: type parameters of <T>T cannot be determined; no unique maximal instance exists for ...
来源:互联网 发布:php 开源 api文档工具 编辑:程序博客网 时间:2024/06/06 15:52
测试环境Maven编译工程时候报以下错误:
type parameters of <T>T cannot be determined; no unique maximal instance exists for type variable T with upper bounds int,java.lang.Object
而开发环境却编译正常,经查代码:
public <T> T selectOne(String statement);public int countXXX() {...return selectOne("YYY");}
发现countXXX()的返回类型int与selectOne的返回类型定义不一致。
网上有“升级Java版本”的解决方案。不过,这样的代码毕竟不严谨,一旦出现null,必然报错。
我的解决方案是修改代码,尽量不要报异常:
public int countXXX() {...Integer count = selectOne("YYY");return count == null ? -1 : count.intValue();}另外,也可以将countXXX()的返回类型int,修改为Integer。
0 0
- Error Log: type parameters of <T>T cannot be determined; no unique maximal instance exists for ...
- error C3225: generic type argument for 'T' cannot be 'System::Collections::Generic::KeyValuePair ^',
- log-error set to '/usr/local/mysql/log/mysqld.log', however file don't exists
- Error---Uri can't be resolved to a type
- No unique bean of type
- No unique bean of type
- Instance member cannot be used on type
- (SystemJS) Can't resolve all parameters for
- error: couldn't parse contents of '/Users/.../Info.plist': The data couldn’t be read because...
- error: couldn't parse contents of '/Users/.../Info.plist': The data couldn’t be read because...
- No enclosing instance of type 异常
- android No enclosing instance of type
- No enclosing instance of type * is accessible.
- No enclosing instance of type is accessible.
- the type List is not generic; it cannot be parameterized with arguments<T>解决办法
- The type List is not generic; it cannot be parameterized with arguments<T>
- Class Error: mysqli.isn't exists!
- 戴尔电脑 出现的问题 The AC power adapter wattage and type cannot be determined.
- 数据交换平台的双内存设计
- SqlServer连接异常java.sql.SQLException: Network error IOException: Connection refused: connect
- UVA - 140 Bandwidth
- Spring中的两种AOP织入方式
- 通过创建 ControlTemplate 自定义现有控件的外观
- Error Log: type parameters of <T>T cannot be determined; no unique maximal instance exists for ...
- 动态调用webservice
- android常用工具类 得到apk版本号和版本名字
- G++编译错误 no matching function for call to '_tag_data_value::StringAddLen(std::string, int, int)
- R语言处理缺失数据的高级方法
- Web 前端性能测试工具推荐
- socket编程
- usage of concat layer
- pdf转换器免费版下载使用