@SuppressWarnings 使用
@SuppressWarnings 注解参数取决于你的ide,并非java提供
IDEA 使用
参考 https://www.jetbrains.com/help/idea/2019.2/disabling-and-enabling-inspections.html#suppress-in-editor
在编辑器中取消检查
将插入符号放在突出显示的字符串上并按Alt+Enter。
单击要抑制的检查旁边的,然后选择必要的抑制操作。
Eclipse 使用
参考 https://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-suppress_warnings.htm
参数 | 描述 |
---|---|
all | to suppress all warnings (抑制所有警告) |
boxing | to suppress warnings relative to boxing/unboxing operations (抑制装箱、拆箱操作时候的警告) |
cast | to suppress warnings relative to cast operations (抑制映射相关的警告) |
dep-ann | to suppress warnings relative to deprecated annotation (抑制启用注释的警告) |
deprecation | to suppress warnings relative to deprecation (抑制过期方法警告) |
fallthrough | to suppress warnings relative to missing breaks in switch statements (抑制确在switch中缺失breaks的警告) |
finally | to suppress warnings relative to finally block that don’t return (抑制finally模块没有返回的警告) |
hiding | to suppress warnings relative to locals that hide variable(抑制相对于隐藏变量的局部变量的警告) |
incomplete-switch | to suppress warnings relative to missing entries in a switch statement (enum case)(忽略没有完整的switch语句) |
nls | to suppress warnings relative to non-nls string literals( 忽略非nls格式的字符) |
null | to suppress warnings relative to null analysis( 忽略对null的操作) |
rawtypes | to suppress warnings relative to un-specific types when using generics on class params( 使用generics时忽略没有指定相应的类型) |
restriction | to suppress warnings relative to usage of discouraged or forbidden references( 抑制禁止使用劝阻或禁止引用的警告) |
serial | to suppress warnings relative to missing serialVersionUID field for a serializable class( 忽略在serializable类中没有声明serialVersionUID变量) |
static-access | to suppress warnings relative to incorrect static access( 抑制不正确的静态访问方式警告) |
synthetic-access | to suppress warnings relative to unoptimized access from inner classes( 抑制子类没有按最优方法访问内部类的警告) |
unchecked | to suppress warnings relative to unchecked operations( 抑制没有进行类型检查操作的警告) |
unqualified-field-access | to suppress warnings relative to field access unqualified( 抑制没有权限访问的域的警告) |
unused | to suppress warnings relative to unused code( 抑制没被使用过的代码的警告) |
@SuppressWarnings 使用相关推荐
- 注解@SuppressWarnings(unused)
注解@SuppressWarnings()是用来忽略警告的,内部参数不同,忽略的警告不同. unused这个参数是屏蔽:定义的变量在代码中并未使用且无法访问. java在编译的时候会出现这样的警告,加 ...
- Java凝视Override、Deprecated、SuppressWarnings具体解释
一.什么是凝视 说起凝视,得先提一提什么是元数据(metadata).所谓元数据就是数据的数据.也就是说,元数据是描写叙述数据的.就象数据表中的字段一样,每一个字段描写叙述了这个字段下的数据的含义.而 ...
- Java 注解用法详解——@SuppressWarnings
转自: https://www.cnblogs.com/fsjohnhuang/p/4040785.html Java魔法堂:注解用法详解--@SuppressWarnings 一.前言 编码时我们总 ...
- Spring注解之 @SuppressWarnings注解
简介:java.lang.SuppressWarnings是J2SE5.0中标准的Annotation之一.可以标注在类.字段.方法.参数.构造方法,以及局部变量上. 作用:告诉编译器忽略指定的警告, ...
- @SuppressWarnings注解用法
@SuppressWarnings注解主要用在取消一些编译器产生的警告对代码左侧行列的遮挡,有时候这会挡住我们断点调试时打的断点. 如图所示: 这时候我们在方法上加上@SuppressWarnings ...
- Java魔法堂:注解用法详解——@SuppressWarnings
一.前言 编码时我们总会发现如下变量未被使用的警告提示: 上述代码编译通过且可以运行,但每行前面的"感叹号"就严重阻碍了我们判断该行是否设置的断点了.这时我们可以在方法前添加 @S ...
- 1.4 @SuppressWarnings:抑制编译器警告
Java 中的 @SuppressWarnings 注解指示被该注解修饰的程序元素(以及该程序元素中的所有子元素)取消显示指定的编译器警告,且会一直作用于该程序元素的所有子元素.例如,使用 @Supp ...
- java最后一个注解@SuppressWarnings
@SuppressWarnings注解 简介:java.lang.SuppressWarnings是J2SE5.0中标准的Annotation之一.可以标注在类.字段.方法.参数.构造方法,以及局部变 ...
- Java注释Override、Deprecated、SuppressWarnings详解
http://blog.csdn.net/softwave/article/details/6991913 一.什么是注释 说起注释,得先提一提什么是元数据(metadata).所谓元数据就是数据的数 ...
- @SuppressWarnings 详解
原帖地址:http://gladto.iteye.com/blog/728634 背景知识: 从JDK5开始提供名为Annotation(注释)的功能,它被定义为JSR-175规范.注释 ...
最新文章
- vs2015配置opencv3.3
- 右键助手1.0正式版
- BZOJ 4422 (线段树、DP、扫描线、差分)
- Java集合篇:Stack
- 【Mybatis框架】从零开始学Mybatis框架——使用示例
- 大数据在医疗保健中的真正愿景
- BZOJ 1146: [CTSC2008]网络管理Network( 树链剖分 + 树状数组套主席树 )
- python 程序停止打印日志_停止 Spring Boot 服务的几种优雅姿势
- java 反射调用方法_java的反射机制,以及通过反射获取方法,变量等操作
- TutorialsTeacher 中文系列教程【翻译完成】
- 归纳推理测试没做完_天气热,教你用寒天粉做果冻,清凉爽滑,5秒吃完一盘没问题...
- xugang 记录一个.NET 程序员的成长 asp.net水晶报表的一些问题
- Canvas对画布及文字控制基础API学习
- MySQL数据库 单表数据记录查询
- 惠普m132nw清零方法_惠普132nw硒鼓型号怎么加墨 惠普132硒鼓芯片清零
- Android studio - UI 界面设计(仿问卷星登陆注册界面)
- 使用 ASP.NET 制作一个音乐网站
- 【申博攻略】一.北交计算机学院学术型博士“申请-考核”攻略(招生简章篇)
- 必备的7种公关能力(收藏)
- win10 oracle11g 乱码,小编教你解决win10系统出现汉字乱码的处理办法