本文介绍了结合多个@燮pressWarnings注解 - Eclipse的靛蓝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
所以,问题是能够使每个项目并不需要它自己的结合multple警告燮pressions @燮pressWarnings
注释。
So the issue is being able to combine multple warning suppressions so that each item doesn't need it's own @SuppressWarnings
annotation.
因此,例如:
public class Example
public Example() {
GO go = new GO(); // unused
....
List<String> list = ( List<String> ) go.getList(); // unchecked
}
...
// getters/setters/other methods
}
现在不是有两个 @燮pressWarnings
我想有一个在类级别为这两个警告,所以像这样的:
Now instead of having two @SuppressWarnings
I want to have one at the class level for those two warnings, so like this:
@SuppressWarnings( "unused", "unchecked" )
public class Example
public Example() {
GO go = new GO(); // unused - suppressed
....
List<String> list = ( List<String> ) go.getList(); // unchecked - suppressed
}
...
// getters/setters/other methods
}
但是,这不是一个有效的语法,有没有办法做到这一点?
But that is not a valid syntax, is there a way to do this?
推荐答案
使用下列内容: @燮pressWarnings({未使用,未})
这篇关于结合多个@燮pressWarnings注解 - Eclipse的靛蓝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!