Skip to content

Remove unused throws exception on close #28

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

Merged
merged 1 commit into from
Apr 3, 2025

Conversation

ggivo
Copy link
Contributor

@ggivo ggivo commented Mar 25, 2025

AzureTokenAuthConfigBuilder.close method can not throw an exception.
Removing the throws clause no need to enforce exception handling.

@ggivo ggivo requested a review from atakavci March 25, 2025 16:29
Copy link
Collaborator

@atakavci atakavci left a comment

Choose a reason for hiding this comment

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

looks good, thanks

Copy link
Collaborator

@atakavci atakavci left a comment

Choose a reason for hiding this comment

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

on a second look, this is part of AutoClosable interface, so i think we should keep it.

@ggivo
Copy link
Contributor Author

ggivo commented Apr 3, 2025

@atakavci
I think it should be removed. It is following the recommendations for implementing Autoclosable.
e.g if the implementation can not throw an exception remove it from the method signature

http://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html#close--

While this interface method is declared to throw Exception, implementers are strongly encouraged to declare concrete implementations of the close method to throw more specific exceptions, or to throw no exception at all if the close operation cannot fail.

Copy link
Collaborator

@atakavci atakavci left a comment

Choose a reason for hiding this comment

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

LGTM

@atakavci atakavci merged commit 4f00b3b into redis:main Apr 3, 2025
2 of 3 checks passed
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