[英]How to disable warning in Eclipse - 'Class is a raw type. References to generic type Class<T> should be parameterized'
When I compile thrid-party library a number of 'should be parameterized' warnings are generated. 当我编译第三方库时,会生成一些“应该参数化”的警告。 I know how to fix them but I do not want to so I tried to disable all warning/error in Eclipse.
我知道如何修复它们但我不想这样,我试图禁用Eclipse中的所有警告/错误。 However, the warnings are still generated after every warning/error are disable.
但是,在每个警告/错误被禁用后仍会生成警告。 Please help.
请帮忙。
You can add @SuppressWarnings("rawtypes")
to a method, statement or method argument to suppress this warning. 您可以将
@SuppressWarnings("rawtypes")
添加到方法,语句或方法参数中以禁止显示此警告。
As an example a common one in Eclipse plugins is: 举个例子,Eclipse插件中常见的一个是:
@Override
public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter)
You Can change the settings in eclipse: 您可以在eclipse中更改设置:
如果您对由Class
对象建模的Class
的类型不感兴趣,则抑制或忽略警告的替代方法是使用<?>
表示法,如下所示: Class<?>
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.