java – Eclipse显示对存在的checkstyle SuppresWarning的警告

在我的
Eclipse(Kepler 4.3)中,我安装了Checkstyle并使用了正确的文件(验证也通过Jenkins进行).尽管如此,我的Eclipse编辑器给了我所有@SuppressWarnings的警告(“checkstyle:parameternumber”)

参数编号值存在于Checkstyle中,因为一些开发人员没有此问题.然而,我们比较了环境,无法确定我们的不同之处.
有没有人知道如何解决这个问题?

public class MyClass {

@SuppressWarnings("checkstyle:parameternumber")
public MyClass(...multiple paramters...){
/*Implementation*/
}

当我删除这个@SuppresWarnings时,我收到来自Eclipse的Checkstyle警告我正在使用许多参数.所以它确实承认了我的假设.

最佳答案 您需要禁用Eclipse检查@SuppressWarnings中的名称,您可以像
PMD那样执行(需要完全相同的步骤):

To get Eclipse to not flag the @SuppressWarnings(“PMD”) annotation, look under the menu headings Java -> Compiler -> Errors/Warnings -> Annotations -> Unhandled Warning Token.

点赞