Supported Values for @SuppressWarnings(转)
Update July 2011: This list has been reviewed and made current with the most recent Eclipse 3.7 release.
If you are a Java developer and use the new @SuppressWarnings annotation in your code from time-to-time to suppress compiler warnings you, like me, have wondered probably about a million times already just exactly what are the supported valuesthat can be used with this annotation.
The reason the list isn’t easy to find is because it’s compiler specific, which means Sun may have a different set of supported values than say IBM, GCJ or Apache Harmony.
Fortunately for us, the Eclipse folks have documented the values they support (as of Eclipse 3.7), here they are for reference:
- 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
- finally to suppress warnings relative to finally block that don’t return
- 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)
- nls to suppress warnings relative to non-nls string literals
- null to suppress warnings relative to null analysis
- rawtypes to suppress warnings relative to un-specific types when using generics on class params
- 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
- 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
TIP: For the folks that haven’t used @SuppressWarnings before, the syntax looks like this:
@SuppressWarnings(“unused”)
and can be placed above almost any piece of code that is causing a compiler warning to popup for your class.
Update #1: Thanks to Pierre for the addition of the ‘rawtypes’ argument and description.
Supported Values for @SuppressWarnings(转)的更多相关文章
- @SuppressWarnings的使用、作用、用法
在java编译过程中会出现很多警告,有很多是安全的,但是每次编译有很多警告影响我们对error的过滤和修改,我们可以在代码中加上 @SuppressWarnings(“XXXX”) 来解决 例如:@S ...
- (转)@SuppressWarnings的使用、作用、用法
在java编译过程中会出现很多警告,有很多是安全的,但是每次编译有很多警告影响我们对error的过滤和修改,我们可以在代码中加上 @SuppressWarnings(“XXXX”) 来解决 例如:@S ...
- JavaSE: SuppressWarnings[转]
在java编译过程中会出现很多警告,有很多是安全的,但是每次编译有很多警告影响我们对error的过滤和修改,我们可以在代码中加上 @SuppressWarnings(“XXXX”) 来解决 例如:@S ...
- Checkstyle:整洁你的代码
内容 Checkstyle简介 下载 Checkstyle的几种使用方式 1) 与Ant结合使用 2) 通过CLI使用 3)在IDE上使用插件 4)在Maven上使用插件 Checkstyle配置 配 ...
- windows消息机制详解(转载)
消息,就是指Windows发出的一个通知,告诉应用程序某个事情发生了.例如,单击鼠标.改变窗口尺寸.按下键盘上的一个键都会使Windows发送一个消息给应用程序.消息本身是作为一个记录传递给应用程序的 ...
- Spark中决策树源码分析
1.Example 使用Spark MLlib中决策树分类器API,训练出一个决策树模型,使用Python开发. """ Decision Tree Classifica ...
- HibernateUtil工具类
import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import org.slf4j.Logger; ...
- springboot+druid
最近项目需要搭建新工程,打算使用微服务的形式搭建便于后期拓展.看了一圈发现springboot易于搭建,配置简单,强化注解功能,"just run". Spring Boot ma ...
- PostgreSQL的OGG -- bucardo
bucardo是PostgreSQL数据库中实现双向同步的软件,可以实现PostgreSQL数据库的双master的方案,不过bucardo中的同步都是异步的,它是通过触发器记录变化,程序是perl写 ...
随机推荐
- 【NOI】2017 蚯蚓排队(BZOJ 4943,LOJ 2303) 模拟+hash
[题目]#2303. 「NOI2017」蚯蚓排队 [题意]给定n条长度不超过6的蚯蚓,初始各自在一个队伍.m次操作:1.将i号蚯蚓和j号蚯蚓的队伍合并(保证i为队尾,j为队首).2.将i号蚯蚓和它后面 ...
- supperset (python 2.7.12 + mysql)记录
网上看到superset,比较感兴趣,虚机上搭一下,记录操作过程. 版本信息:CentOS 6.6 + python 2.7.12 + mysql 5.1.73 + setuptools 36.5.0 ...
- LEARN HOW TO HACK
出处:https://www.hackerone.com/hacker101 什么是HACKER101? https://hacker101.com/Hacker101是一个视频,资源和实践活动的集合 ...
- IPsec学习笔记
IPsec是什么 IPsec(IP Security)是一系列为IP通信提供安全性的协议和服务的集合,工作在IP层,可以为上层协议和应用提供透明的安全服务.IPsec提供两种安全机制:认证和加密. 认 ...
- 浅谈js设计模式 — 命令模式
命令模式最常见的应用场景是:有时候需要向某些对象发送请求,但是并不知道请求的接收者是谁,也不知道被请求的操作是什么.此时希望用一种松耦合的方式来设计程序,使得请求发送者和请求接收者能够消除彼此之间的耦 ...
- 洛谷P3383线性筛素数
传送门 代码中体现在那个 $ break $ $ prime $ 数组 中的素数是递增的,当 $ i $ 能整除 $ prime[j ] $ ,那么 $ iprime[j+1] $ 这个合数肯定被 $ ...
- linux下cpu物理个数、多核、超线程判断解析
在Linux体系中,供给了proc文件体系显示体系的软硬件信息.若是想懂得体系中CPU的供给商和相干设备信息,则可以经由过程/proc/cpuinfo文件获得.本文章针对该文件进行简单的总结. 基于指 ...
- Vue(SPA) WebPack模块化打包、SEO优化(Vue SSR服务端同构直出)、全浏览器兼容完整解决方案
白驹过隙,时光荏苒 大概去年这个时候写了angular 结合webpack的一套前端方案,今年此时祭出vue2结合webpack的一套前端方案. 明年的这个时候我又是在做什么... 读在最前面: 1. ...
- 【LOJ】#2523. 「HAOI2018」奇怪的背包
题解 复杂度怎么算也要2s的题怎么0.5s就跑完了,迷啊 这个题简直算完复杂度不敢写,写了就赚飞了好吧 根据裴蜀定理,显然选出的数和P的gcd是w的约数 我们考虑枚举\(P\)的约数,上限当然是\(\ ...
- Codeforces 1028E Restore Array 构造
我发现我构造题真的不会写, 想了好久才想出来.. 我们先把n = 2, 所有数字相等, 所有数字等于0的都特判掉. 找到一个b[ i ] > b[ i - 1 ]的位置把它移到最后一个位置, 并 ...