Eclipse显示有关checkstyle SuppresWarnings的警告

Jur*_*urn 5 java eclipse checkstyle suppress-warnings

在我的Eclipse(Kepler 4.3)中,我安装了Checkstyle并使用适当的文件(通过Jenkins进行验证)。尽管如此,我的Eclipse编辑器仍会警告我@SuppressWarnings("checkstyle:parameternumber")

parameternumber值存在于Checkstyle中,因为某些开发人员没有此问题。但是,我们比较了环境,无法弄清差异。这里有人知道如何解决此问题吗?

public class MyClass {

@SuppressWarnings("checkstyle:parameternumber")
public MyClass(...multiple paramters...){
/*Implementation*/
}
Run Code Online (Sandbox Code Playgroud)

当我删除它@SuppresWarnings时,我从Eclipse收到一个Checkstyle警告,提示我正在使用许多参数。因此,它确实认识到我认为的事实。

Krz*_*soń 6

您需要禁用 Eclipse 检查中的名称@SuppressWarnings,您可以像PMD一样执行此操作(需要完全相同的步骤):

要让 Eclipse 不标记 @SuppressWarnings("PMD") 注释,请查看菜单标题 Java -> Compiler -> Errors/Warnings -> Annotations -> Unhandled Warning Token。