type parameters of <T>T cannot be determined; no unique maximal instance exists for type variable T with upper bounds int,java.lang.Object

简介:

今天在进行代码检查的时候出现下面的异常:

1 type parameters of <T>T cannot be determined; no unique maximal instance exists for type variable T with upper bounds int,java.lang.Object

当时的第一感觉就是代码因为jdk版本太低引起的、

因为最后咨询了配置管理组的同事,确实发现是因为我本地jdk用的是1.7版本,而代码检查机器上用的是jdk1.6版本。因此出现了这个问题。

其实出现这个问题的解决办法很简单:

1.  升级jdk版本

2.    修改代码

第一种升级jdk版本的方式我们就不细说了,说说第二种,原始代码为:

1     public int queryIpCount(String ipAddr) {
2         return getSqlSession().selectOne("IpVerify.queryIpCount", ipAddr);
3     }

修改为:

1     public Integer queryIpCount(String ipAddr) {
2         return getSqlSession().selectOne("IpVerify.queryIpCount", ipAddr);
3     }

也就是将返回类型从int修改为Integer就ok了。

 

参考资料:

Error: type parameters of <T>T cannot be determined during Maven Install


目录
相关文章
|
数据库 OceanBase
RuntimeError: 'PluginContext' object has no attribute 'set_variable'
RuntimeError: 'PluginContext' object has no attribute 'set_variable'
104 2
|
关系型数据库 MySQL C++
Error:E0415 no suitable constructor exists to convert from “int“ to “Rational“
Error:E0415 no suitable constructor exists to convert from “int“ to “Rational“
141 0
Optional int parameter ‘id‘ is present but cannot be translated into a null value due to being ……
Optional int parameter ‘id‘ is present but cannot be translated into a null value due to being ……
266 0
解决Invalid prop: type check failed for prop “model“. Expected Object, got Array问题
解决Invalid prop: type check failed for prop “model“. Expected Object, got Array问题
解决Invalid prop: type check failed for prop “model“. Expected Object, got Array问题
解决办法:Type safety: The expression of type List needs unchecked conversion to conform
解决办法:Type safety: The expression of type List needs unchecked conversion to conform
304 0
TypeError: sequence item 0: expected string, int found
TypeError: sequence item 0: expected string, int found
|
IDE 开发工具
C - error: converting to execution character set:Illegal byte sequence
C - error: converting to execution character set:Illegal byte sequence
1170 0
C - error: converting to execution character set:Illegal byte sequence
成功解决KeyError: “Passing list-likes to .loc or [] with any missing labels is no longer supported. The
成功解决KeyError: “Passing list-likes to .loc or [] with any missing labels is no longer supported. The