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


目录
相关文章
|
8月前
|
Scala
【已解决】Specifying keys via field positions is only valid for tuple data types. Type: GenericType<scala
【已解决】Specifying keys via field positions is only valid for tuple data types. Type: GenericType<scala
72 0
|
数据库 OceanBase
RuntimeError: 'PluginContext' object has no attribute 'set_variable'
RuntimeError: 'PluginContext' object has no attribute 'set_variable'
124 2
YOLO V5出现RuntimeError: result type Float can‘t be cast to the desired output type long int解决方法
YOLO V5出现RuntimeError: result type Float can‘t be cast to the desired output type long int解决方法
735 0
|
PyTorch TensorFlow 算法框架/工具
TensorflowConv2D:AttributeError: ‘int‘ object has no attribute ‘lower‘
TensorflowConv2D:AttributeError: ‘int‘ object has no attribute ‘lower‘
285 0
TensorflowConv2D:AttributeError: ‘int‘ object has no attribute ‘lower‘
解决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问题
TypeError: sequence item 0: expected string, int found
TypeError: sequence item 0: expected string, int found
【TP5.1】variable type error: array
【TP5.1】variable type error: array
194 0
【TP5.1】variable type error: array
成功解决DataConversionWarning: A column-vector y was passed when a 1d array was expected. Please change
成功解决DataConversionWarning: A column-vector y was passed when a 1d array was expected. Please change