Sonar Methods should not be empty at the constructor

给你一囗甜甜゛ 提交于 2019-12-03 17:39:33

问题


I updated my Sonar to Version 5.1.2, and the issue Methods should not be empty appears on this code:

public User() {}

public User (String login) {
   this.login = login;
}

It seems to be a bug. Am I right? Because this didn't happen before.


回答1:


I found this jira, It's a Sonar's Bug.

https://jira.sonarsource.com/browse/SONARJAVA-1138




回答2:


It really seems to be unexpected behavior. I think it was the ticket response above what caused it. I'm trying to talk to the developer to set the S1186 rule. If you want to follow:

https://jira.sonarsource.com/browse/SONARJAVA-1138



来源:https://stackoverflow.com/questions/32618188/sonar-methods-should-not-be-empty-at-the-constructor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!