Skip to content

Cleanup: remove unnecessary throws declarations from methods#3220

Merged
hazendaz merged 3 commits intospotbugs:masterfrom
JuditKnoll:remove_ex
Dec 4, 2024
Merged

Cleanup: remove unnecessary throws declarations from methods#3220
hazendaz merged 3 commits intospotbugs:masterfrom
JuditKnoll:remove_ex

Conversation

@JuditKnoll
Copy link
Copy Markdown
Collaborator

@JuditKnoll JuditKnoll commented Dec 3, 2024

Removing unnecessary throws declarations from methods, where the method body doesn't throw the listed exception, or a more general exception already listed.

See the issues in SonarCloud.

FindbugsPlugin.getDefault().logException(e, "Error performing SpotBugs results update");
} catch (CoreException e) {
FindbugsPlugin.getDefault().logException(e, "Error performing SpotBugs results update");
}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The IOException was catched from the FindbugsPlugin.storeBugCollection() method, which does not throw this exception. Also, the two catch blocks are the same.

@hazendaz hazendaz self-assigned this Dec 4, 2024
@hazendaz hazendaz added this to the SpotBugs 4.9.0 milestone Dec 4, 2024
@hazendaz hazendaz merged commit 811962e into spotbugs:master Dec 4, 2024
@JuditKnoll JuditKnoll deleted the remove_ex branch December 5, 2024 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants