我想禁止 IntelliJ(2021.1,也在 2020.2 上测试)中对匹配特定模式的所有字段的“未使用声明”检查。我能够抑制使用“代码模式”的方法的警告,但字段似乎没有受到影响。
由于项目规模,我确实需要使用模式来避免向每个相关字段添加注释。
这是我的测试课:
public class TestInspection {
public static final String SUPPRESSED_NAME = "test";
public static final String CONSTANT_NAME = "importantConstant";
public void testSuppressedMethod() {
}
public void testMethod() {
}
}
以下是警告:我想删除第一个警告(字段'SUPPRESSED_NAME')
有没有人有任何想法?