ballerina-lang icon indicating copy to clipboard operation
ballerina-lang copied to clipboard

[Refactoring] Exceptions in "throws" clauses should not be superfluous

Open f-schnabel opened this issue 1 year ago • 1 comments
trafficstars

Purpose

Superfluous exceptions within throws clauses have negative effects on the readability and maintainability of the code. An exception in a throws clause is superfluous if it is:

  • listed multiple times
  • a subclass of another listed exception
  • not actually thrown by any execution path of the method

https://sonarcloud.io/organizations/ballerina-platform/rules?open=java%3AS1130&rule_key=java%3AS1130

Approach

Describe how you are implementing the solutions along with the design details.

Samples

Provide high-level details about the samples related to this feature.

Remarks

List any other known issues, related PRs, TODO items, or any other notes related to the PR.

Check List

  • [x] Read the Contributing Guide
  • [ ] Updated Change Log
  • [ ] Checked Tooling Support (#<Issue Number>)
  • [ ] Added necessary tests
    • [ ] Unit Tests
    • [ ] Spec Conformance Tests
    • [ ] Integration Tests
    • [ ] Ballerina By Example Tests
  • [ ] Increased Test Coverage
  • [ ] Added necessary documentation
    • [ ] API documentation
    • [ ] Module documentation in Module.md files
    • [ ] Ballerina By Examples

f-schnabel avatar Jun 18 '24 18:06 f-schnabel

Codecov Report

Attention: Patch coverage is 44.44444% with 15 lines in your changes missing coverage. Please review.

Project coverage is 77.32%. Comparing base (9ba8c66) to head (2afb0f1). Report is 247 commits behind head on master.

Files Patch % Lines
...rc/main/java/io/ballerina/cli/cmd/ToolCommand.java 0.00% 3 Missing :warning:
.../io/ballerina/trigger/BallerinaTriggerService.java 0.00% 2 Missing :warning:
...erina/shell/parser/trials/DualTreeParserTrial.java 0.00% 1 Missing :warning:
.../io/ballerina/runtime/internal/values/XmlItem.java 0.00% 1 Missing :warning:
...in/java/io/ballerina/cli/cmd/DeprecateCommand.java 0.00% 1 Missing :warning:
...rc/main/java/io/ballerina/cli/cmd/PushCommand.java 50.00% 1 Missing :warning:
.../main/java/io/ballerina/cli/cmd/SearchCommand.java 0.00% 1 Missing :warning:
.../java/io/ballerina/cli/task/RunBuildToolsTask.java 0.00% 1 Missing :warning:
...ava/io/ballerina/projects/BuildToolResolution.java 0.00% 1 Missing :warning:
.../internal/repositories/MavenPackageRepository.java 0.00% 1 Missing :warning:
... and 2 more
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #42946      +/-   ##
============================================
+ Coverage     77.29%   77.32%   +0.02%     
+ Complexity    51358    51356       -2     
============================================
  Files          2932     2932              
  Lines        204536   204467      -69     
  Branches      26698    26713      +15     
============================================
- Hits         158105   158094      -11     
+ Misses        37835    37776      -59     
- Partials       8596     8597       +1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jun 19 '24 13:06 codecov[bot]

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

github-actions[bot] avatar Jul 20 '24 19:07 github-actions[bot]

Closed PR due to inactivity for more than 18 days.

github-actions[bot] avatar Jul 23 '24 19:07 github-actions[bot]

@MaryamZi @gimantha FYI

keizer619 avatar Sep 06 '24 09:09 keizer619

We will consider the PR (https://github.com/ballerina-platform/ballerina-lang/pull/43256) as the active open PR and will keep this one closed

gimantha avatar Sep 06 '24 09:09 gimantha