New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion: Sonar S1130 "throws" declarations should not be superfluous #1061
Comments
That sounds reasonable to me: not declaring unchecked exceptions would follow the style that we try to have elsewhere in the biojava library. As a note: there's a school of thought (see blogpost) that believes that checked exceptions are evil and that one should convert everything to unchecked and declare the unchecked exceptions in signatures for documentation purposes. In any case, I'm not saying we should do that with BioJava now, it would quite a disruptive change. |
Do you agree that I submit a PR to you soon on this subject? For information, fixes will be made by our solution which automatically resolves defects in java applications. |
Yes, we'd be happy to review a PR. |
Regarding the link you indicated, i consider that checked exceptions give meaning to methods. Of course, as in many areas, there are always supporters and detractors. It seems to me that the article bears witness to a very personal conviction and another person could perfectly well find contradictory scenarios. Personally, I'm very comfortable with checked exceptions and I don't find that managing these exceptions is so restrictive. Everyone sees noon at his door. |
Hi,
After suggesting that you correct this type of defect automatically (#1051 ), we are offering another code smell correction.
In your project it seems that some methods throw runtime exceptions that it is not useful to declare because it inherits for example from the RuntimeException class.
https://rules.sonarsource.com/java/RSPEC-1130
If this is of interest to you we can push code changes to you in the form of a PR.
Below are examples of the changes made by our software to correct this rule.
The text was updated successfully, but these errors were encountered: