主要:应删除未使用的私有方法 - postConstruct 注释 - 误报

MAJOR: Unused private method should be removed - postConstruct Annotation - false positive

我们使用 @PostConstruct 设置方法注释(Spring 依赖注入(@Autowired))并得到误报:

"Unused private method should be removed"

@PostConstruct
private void setupAbc() {
...
}

有什么提示吗?

该规则将跳过带注释的私有未使用方法,它将在 sonar-java-plugin 版本 3.6 中修复。 https://jira.sonarsource.com/browse/SONARJAVA-1179