Java 中有效的@SuppressWarnings 警告名称列表是什么? [英] What is the list of valid @SuppressWarnings warning names in Java?
本文介绍了Java 中有效的@SuppressWarnings 警告名称列表是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Java 中有效的 @SuppressWarnings
警告名称列表是什么?
What is the list of valid @SuppressWarnings
warning names in Java?
@SuppressWarnings("")
中 ("")
之间的位.
推荐答案
这取决于您的 IDE 或编译器.
It depends on your IDE or compiler.
这是 Eclipse Galileo 的列表:
Here is a list for Eclipse Galileo:
- all 取消所有警告
- 装箱以抑制与装箱/拆箱操作相关的警告
- 强制转换以抑制与强制转换操作相关的警告
- dep-ann 抑制与已弃用注释相关的警告
- 弃用以抑制与弃用相关的警告
- fallthrough 抑制与缺少 switch 中断相关的警告声明
- finally 抑制与 finally 块相关的警告返回
- 隐藏以抑制与隐藏变量的本地人相关的警告
- incomplete-switch 抑制与缺失条目相关的警告在 switch 语句中(枚举大小写)
- nls 抑制与非 nls 字符串文字相关的警告
- null 抑制与 null 分析相关的警告
- restriction 抑制与使用不鼓励或禁止引用
- serial 抑制与缺少 serialVersionUID 相关的警告可序列化类的字段
- static-access 抑制与错误静态相关的警告访问
- synthetic-access 抑制与未优化相关的警告从内部类访问
- unchecked 取消与未选中操作相关的警告
- unqualified-field-access 抑制与字段相关的警告访问不合格
- unused 抑制与未使用代码相关的警告
- 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
- 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
列表 为 Indigo 添加:
List for Indigo adds:
- javadoc 抑制与 javadoc 警告相关的警告
- rawtypes 抑制与使用原始类型相关的警告
- static-method 抑制与可以声明为静态的方法相关的警告
- super 抑制与覆盖没有超级调用的方法相关的警告
- javadoc to suppress warnings relative to javadoc warnings
- rawtypes to suppress warnings relative to usage of raw types
- static-method to suppress warnings relative to methods that could be declared as static
- super to suppress warnings relative to overriding a method without super invocations
列表为朱诺添加:
- resource 抑制与 Closeable 类型资源的使用相关的警告
- sync-override 用于在覆盖同步方法时抑制由于缺少同步而导致的警告
- resource to suppress warnings relative to usage of resources of type Closeable
- sync-override to suppress warnings because of missing synchronize when overriding a synchronized method
Kepler 和 Luna 使用与 Juno 相同的令牌列表(list).
Kepler and Luna use the same token list as Juno (list).
其他人会相似但有所不同.
Others will be similar but vary.
这篇关于Java 中有效的@SuppressWarnings 警告名称列表是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文