【问题标题】:MAJOR: Unused private method should be removed - postConstruct Annotation - false positive主要:应删除未使用的私有方法 - postConstruct Annotation - 误报
【发布时间】:2016-07-06 16:27:04
【问题描述】:

我们使用@PostConstruct 注解设置方法(Spring Dependency Injection (@Autowired))并得到误报:

“应该删除未使用的私有方法”

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

有什么提示吗?

【问题讨论】:

  • 使用@Autowired 注解的方法也是如此。

标签: sonarqube


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-12-02
    • 2020-07-10
    • 2016-01-28
    • 2016-05-22
    • 1970-01-01
    • 2017-03-02
    • 1970-01-01
    相关资源
    最近更新 更多