Skip to content

Conversation

JuditKnoll
Copy link
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.

@@ -367,8 +367,6 @@ private void updateBugCollection(Project findBugsProject, Reporter bugReporter,
// props
st.newPoint("storeBugCollection");
FindbugsPlugin.storeBugCollection(project, resultCollection, monitor);
} catch (IOException e) {
FindbugsPlugin.getDefault().logException(e, "Error performing SpotBugs results update");
} catch (CoreException e) {
FindbugsPlugin.getDefault().logException(e, "Error performing SpotBugs results update");
}
Copy link
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
15 checks passed
@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