我试图抑制 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”注释放在一个或两个类中不会抑制警告。我错过了什么吗?