Title: Suggestion: Sonar S1130 "throws" declarations should not be superfluous · Issue #1061 · biojava/biojava · GitHub
Open Graph Title: Suggestion: Sonar S1130 "throws" declarations should not be superfluous · Issue #1061 · biojava/biojava
X Title: Suggestion: Sonar S1130 "throws" declarations should not be superfluous · Issue #1061 · biojava/biojava
Description: 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...
Open Graph Description: 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 ...
X Description: 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 ...
Opengraph URL: https://github.com/biojava/biojava/issues/1061
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Suggestion: Sonar S1130 \"throws\" declarations should not be superfluous","articleBody":"Hi,\r\n\r\nAfter suggesting that you correct this type of defect automatically (https://github.com/biojava/biojava/issues/1051 ), we are offering another code smell correction. \r\n\r\nIn 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.\r\n\r\nhttps://rules.sonarsource.com/java/RSPEC-1130\r\n\r\nIf this is of interest to you we can push code changes to you in the form of a PR.\r\n\r\nBelow are examples of the changes made by our software to correct this rule.\r\n\r\n\r\n org\\biojava\\nbio\\aaproperties\\xml\\AminoAcidCompositionTable.java\r\n @@ -133,5 +133,5 @@\r\n\t * \tthrown if AminoAcidCompositionTable.computeMolecularWeight(ElementTable) is not called before this method\r\n\t */\r\n -\tpublic double getMolecularWeight(Character aaSymbol) throws NullPointerException{\r\n +\tpublic double getMolecularWeight(Character aaSymbol) {\r\n\t\tif(this.aaSymbol2MolecularWeight == null){\r\n\t\t\tthrow new NullPointerException(\"Please call AminoAcidCompositionTable.computeMolecularWeight(ElementTable) before this method\");\r\n\r\n org\\biojava\\nbio\\alignment\\io\\StockholmFileParser.java\r\n @@ -284,5 +284,5 @@\r\n\t * if unexpected format is encountered\r\n\t */\r\n -\tpublic StockholmStructure parse(String filename) throws IOException, ParserException {\r\n +\tpublic StockholmStructure parse(String filename) throws IOException {\r\n\t\tInputStream inStream = new InputStreamProvider().getInputStream(filename);\r\n\t\tStockholmStructure structure = parse(inStream);\r\n","author":{"url":"https://github.com/jlerbsc","@type":"Person","name":"jlerbsc"},"datePublished":"2023-05-10T13:41:09.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/1061/biojava/issues/1061"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:6c412c24-2e1b-0bc0-8a5a-eb9439fae302 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 82EC:2641E2:56BA62:6E0369:69744433 |
| html-safe-nonce | 7421046bcbcfe7d66b835d18cc02926b31b8fcf71d68f4c8621dc20486e31be9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MkVDOjI2NDFFMjo1NkJBNjI6NkUwMzY5OjY5NzQ0NDMzIiwidmlzaXRvcl9pZCI6Ijc0MjY4NzQyMTYzMDc5Mjc1NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 07867f44421b60345d461051aff529d0fdd119879411d2a3351fbf23f84b1803 |
| hovercard-subject-tag | issue:1703964589 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/biojava/biojava/1061/issue_layout |
| twitter:image | https://opengraph.githubassets.com/41c6adf58737e1b892fc1beb0ed316260a3a980289d9818683a37968007a730b/biojava/biojava/issues/1061 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/41c6adf58737e1b892fc1beb0ed316260a3a980289d9818683a37968007a730b/biojava/biojava/issues/1061 |
| og:image:alt | 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 ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jlerbsc |
| hostname | github.com |
| expected-hostname | github.com |
| None | e0b95d743b7672c9ac0e1032d5f117950182dc164a83434a7db86510e8f0b37c |
| turbo-cache-control | no-preview |
| go-import | github.com/biojava/biojava git https://github.com/biojava/biojava.git |
| octolytics-dimension-user_id | 237402 |
| octolytics-dimension-user_login | biojava |
| octolytics-dimension-repository_id | 9199359 |
| octolytics-dimension-repository_nwo | biojava/biojava |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 9199359 |
| octolytics-dimension-repository_network_root_nwo | biojava/biojava |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 56fe7e2e8de6e57740bca50402351ea656f7a4bf |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width