在java编译过程中会出现很多警告,有很多是安全的,但是每次编译有很多警告影响我们对error的过滤和修改,我们可以在代码中加上
@SuppressWarnings(“XXXX”) 来解决
例如:@SuppressWarnings("deprecation")表示不显示使用了不赞成使用的类或方法时的警告
下面列出了可选用的类型:
Update #1: All these annotations are still valid in Eclipse 3.4 and 3.5, there have been no new SuppressWarning arguments added in those versions of the JDT compiler.
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,