Supported Values for @SuppressWarnings
来源:互联网 发布:阿里云服务器租用费用 编辑:程序博客网 时间:2024/06/06 15:39
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 alreadyjust exactly what are the supported values that 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.
- Supported Values for @SuppressWarnings
- Supported Values for @SuppressWarnings
- Supported Values for @SuppressWarnings
- Supported Values for @SuppressWarnings & How to use @SuppressWarnings
- Oracle APEX 报错List of Values not supported for this type
- @SuppressWarnings
- @SuppressWarnings
- @SuppressWarnings
- SuppressWarnings
- @SuppressWarnings
- @SuppressWarnings
- @SuppressWarnings
- @SuppressWarnings()
- @SuppressWarnings
- SuppressWarnings
- @suppressWarnings
- @SuppressWarnings
- @suppresswarnings
- svn上传代码
- iOS实现NSURLConnection进行异步下载
- java中数据结构Bitmap查找相等元素
- Oracle DB 诊断数据库
- mathquill 未解决的弊端
- Supported Values for @SuppressWarnings
- UNIX_shell_programming(几道练习题目)
- php array的用法
- jqGrid——合计、默认查询条件、自适应、序号等
- IOS中处理异步连接中的超时
- windows任务定时重启tomcat
- ios排序
- 前端开发必备!Emmet使用手册
- B. Playing Cubes