如何抑制 CheckStyle StrictDuplicate 警告?
我试图抑制 CheckStyle StrictDuplicateCode 警告,但它不起作用。 在我的 Eclipse 项目中,我有两个具有相似字段的类:
public class MyClass {
// CHECKSTYLE:OFF
private String field1;
private String field2;
private String field3;
private String field4;
private String field5;
private String field6;
private String field7;
private String field8;
}
public class MyDuplicateClass {
// CHECKSTYLE:OFF
private String field1;
private String field2;
private String field3;
private String field4;
private String field5;
private String field6;
private String field7;
private String field8;
}
在一个或两个类中添加“CHECKSTYLE:OFF”注释不会抑制警告。 我错过了什么吗?
I am trying to suppress CheckStyle StrictDuplicateCode warning, and it does not work.
In my Eclipse project, I have two classes with similar fields:
public class MyClass {
// CHECKSTYLE:OFF
private String field1;
private String field2;
private String field3;
private String field4;
private String field5;
private String field6;
private String field7;
private String field8;
}
public class MyDuplicateClass {
// CHECKSTYLE:OFF
private String field1;
private String field2;
private String field3;
private String field4;
private String field5;
private String field6;
private String field7;
private String field8;
}
Putting "CHECKSTYLE:OFF" comment in one or both classes does not suppress the warning.
Am I missing something?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保您正确配置了 SuppressionCommentFilter,例如:
Make sure you configured the SuppressionCommentFilter correctly, for example: