解决Type safety: The expression of type List needs unchecked conversion to conform to

在方法前加上这句话就可以了@SuppressWarnings("unchecked")

例如:

@SuppressWarnings("unchecked") 
public List<TMrTraceLog> findMrTraceLog(String mrClass,String mrNo) {
return this.mrTraceLogDao.findMrTraceLog(mrClass, mrNo);
}

jdk1.5以后支持泛型后,提倡用使用 这种方式定义:List<String>,Map<String> ,若你还是使用List ,Map 这种方式来定义,

    eclipse,或者myeclipse 就会抛出“警告”,也就是一个带黄色的感叹号。如果这个时候你不想看见这种提示,就可以使用上面的注解。

J2SE 提供的最后一个批注是 @SuppressWarnings。该批注的作用是给编译器一条指令, 告诉它对被批注的代码元素内部的某些警告保持静默。
关键字 用途
deprecation  

使用了不赞成使用的类或方法时的警告

unchecked    

执行了未检查的转换时的警告,例如当使用集合时没有用泛型 (Generics) 来指定集合保存的类型。

fallthrough   

当 Switch 程序块直接通往下一种情况而没有 Break 时的警告。

path       

在类路径、源文件路径等中有不存在的路径时的警告。

serial      

当在可序列化的类上缺少 serialVersionUID 定义时的警告。

finally       

任何 finally 子句不能正常完成时的警告。

all            关于以上所有情况的警告。   
 

解决Type safety: The expression of type List needs的更多相关文章

  1. 【hibernate postgresql】注解@TypeDef/@Enumerated/数据库字段gender为枚举类型,从前台接受到实体后进行保存报错:org.postgresql.util.PSQLException: ERROR: column "gender" is of type gender but expression is of type character varying

    数据库字段gender为枚举类型,从前台接受到实体后进行保存报错:org.postgresql.util.PSQLException: ERROR: column "gender" ...

  2. paip . 解决spring No unique bean of type [com.mijie.homi.search.service.index.MoodUserIndexService]

    paip . 解决spring No unique bean of type   [com.mijie.homi.search.service.index.MoodUserIndexService] ...

  3. block中出现此种报错: Incompatible block pointer types initializing 'float (^__strong)(float, float)' with an expression of type 'int (^)(float, float)'

    当block(代码块)的返回值是float时,应注意的地方:定义的返回值类型一定要与return的返回值类型一样 我们以两个数的四则运算来举例 在main.m文件中的四则运算中,我采用两种返回值类型( ...

  4. The expression of type Integer is unboxed into int

    问题:The expression of type Integer is unboxed into int 原因:java的包装类,方法里面要的是Integer,传入的参数确实int类型 解决方案: ...

  5. Type Safety and Type Inference

    Swift is a type-safe language. A type safe language encourages you to be clear about the types of va ...

  6. windows7下解决caffe check failed registry.count(type) == 1(0 vs. 1) unknown layer type问题

    在Windows7下调用vs2013生成的Caffe静态库时经常会提示Check failed: registry.count(type) == 1 (0 vs. 1) Unknown layer t ...

  7. error C2275: 'SOCKET' : illegal use of this type as an expression

    在VC中编译xxx.c文件出现错误error C2275 illegal use of this type as an expression 问题在于C99之前要求所有的声明必须放在函数块的起始部分, ...

  8. [TypeScript] Increase TypeScript's type safety with noImplicitAny

    TypeScript tries to infer as much about your code as it can. But sometimes there really is not enoug ...

  9. Golang报错:Cannot convert expression of type interface{} to type []byte

    在使用golang实现后端登录逻辑的时候,碰到下面的问题:Cannot convert expression of type interface{} to type []byte 首先介绍下问题出现的 ...

随机推荐

  1. 对爱奇艺PC Web主站来说,良好的SEO能够帮助其获得更多的搜索流量,因而页面上一些非常重要的内容仍然需要依靠服务端进行渲染,由于另外开发一套基于Node的SSR后台成本较高,而乐趣(基于java和velocity模板引擎)平台作为渲染系统已经十分成熟且运行稳定,在充分试验后,我们决定在Uniqy中使用服务端同步与客户端浏览器异步二次渲染相结合的方式,结合Vue2.0提供的 slot插槽机制,很

    https://mp.weixin.qq.com/s/eB20BoqzENO_oNk8eDg4Eg 干货|爱奇艺PC Web新框架实践 原创: 前端研发团队 爱奇艺技术产品团队 昨天      

  2. queue hardware os

    Computer Science An Overview 11th Edition Queues are often used as the underlying structure of a buf ...

  3. The Concept of a Process

    COMPPUTER SCIENCE AN OVERVIEW 11th Edition One of the most fundamental concepts of modern operating ...

  4. Guideline 2.1 - Information Needed

    For information about testing your app and preparing it for review, please see Technical Note TN2431 ...

  5. 【python-opencv】22-直方图

    直方图目录: 22.1 直方图的计算,绘制与分析 22.1.1 统计直方图 22.1.2 绘制直方图 22.1.3 使用掩膜(遮罩) 22.2 直方图均衡化 22.2.1 OpenCV中的直方图均衡化 ...

  6. 借用HTML5 插入视频。音频

    HTML5 规定了一种通过 video 元素来包含视频的标准方法. 插入视频 <video width="320" height="240" contro ...

  7. oracle(九)索引扫描

    (1)索引唯一扫描(index unique scan) (2)索引范围扫描(index range scan) (3)索引全扫描(index full scan) (4)索引快速扫描(index f ...

  8. python-面向对象-08_多态

    多态 目标 多态 面向对象三大特性 封装 根据 职责 将 属性 和 方法 封装 到一个抽象的 类 中 定义类的准则 继承 实现代码的重用,相同的代码不需要重复的编写 设计类的技巧 子类针对自己特有的需 ...

  9. OC导航栏跳转指定界面

    方法一: [self.navigationController popToViewController:[self.navigationController.viewControllers objec ...

  10. .NET数据挖掘与机器学习开源框架

    1.    数据挖掘与机器学习开源框架 1.1 框架概述 1.1.1 AForge.NET AForge.NET是一个专门为开发者和研究者基于C#框架设计的,他包括计算机视觉与人工智能,图像处理,神经 ...