Skip to content
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

Unchecked exception handling #9637

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

ArvindReddySheelam
Copy link

Refactor validateIconSize method: Remove redundant exception handling and improve JavaDoc

  • Removed unnecessary try-catch blocks for RuntimeException and Exception, which were redundant and unlikely to provide meaningful error information.
  • Added detailed JavaDoc to describe the purpose of the method, the parameters, and the conditions under which a SecurityException is thrown.
  • Added @nonnull annotation to the iconSize parameter to ensure it's not null.
  • Simplified exception message to include the invalid iconSize value for better debugging context.

Description:

This PR refactors the validateIconSize method to address feedback regarding redundant exception handling and code formatting. The following changes have been made:

Redundant Exception Handling Removed: The unnecessary try-catch blocks for RuntimeException and Exception have been removed. The method now focuses solely on throwing a SecurityException when the iconSize does not match the expected pattern.

Enhanced JavaDoc: A Detailed JavaDoc has been added to clarify the method's functionality, including descriptions of the parameters and any exceptions that may be thrown.

@nonnull Annotation: The @nonnull annotation has been added to the iconSize parameter to prevent NullPointerException and ensure the method's input is always valid.

Simplified Exception Message: The exception message now includes the invalid iconSize value to provide better context in the event of an error.

@zbynek
Copy link
Contributor

zbynek commented Aug 21, 2024

Removed unnecessary try-catch blocks for RuntimeException and Exception,
This PR refactors the validateIconSize method

What you're saying is basically that you discarded some changes from your previous PR, but that's not relevant for review of this one.

Here you're just adding Javadoc and documenting that an argument is not null.

Please fix the formatting errors.
Please use the PR template with all the checkboxes.

@daniel-beck
Copy link
Member

Also, do not open a new PR. Update this one.

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.

3 participants