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

Refactor ProducerFactory to use constant for repeated exception message #3550

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

kwonyonghyun
Copy link
Contributor

The error message "This factory does not support this method" was hardcoded twice in the production code of the ProducerFactory interface. By introducing the constant FACTORY_DOES_NOT_SUPPORT_METHOD, we eliminate this duplication, improve code maintainability, and ensure consistency. This change is particularly significant as it affects actual production code, not test code. Moreover, while currently used twice, this constant could potentially be reused in other parts of the codebase in the future, further justifying its creation and enhancing the overall code quality and future maintainability of the ProducerFactory and related classes.

@sobychacko
Copy link
Contributor

@kwonyonghyun Thanks for the PR. Could you add your name as an author to the class?

@kwonyonghyun
Copy link
Contributor Author

Done :) I've added my name as an author to the ProducerFactory class.

@sobychacko sobychacko added this to the 3.3.0-RC1 milestone Oct 9, 2024
@sobychacko sobychacko merged commit 16133e2 into spring-projects:main Oct 9, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants