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

Document configure only should be called once #1904

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

slominskir
Copy link
Contributor

Fixes #1903

@OneCricketeer
Copy link
Contributor

I don't think a Javadoc comment will save anyone from accidentally calling the configure method more than once.

If the purpose is to prevent that from happening, why not throw IllegalStateException, for example?

@slominskir
Copy link
Contributor Author

Documenting the expected behavior is better than nothing. An Exception is more direct, but also more invasive and risky to implement - that configure method is inherited and overridden all the way up to AbstractKafkaAvroDeserializer and AbstractKafkaAvroSerializer. Where would this Exception be thrown from and how is the called state maintained? I figured just documenting the current behavior was good enough, but throwing an Exception sounds good if someone else wants to spend the time to write it and test it.

@cla-assistant
Copy link

cla-assistant bot commented Sep 25, 2023

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

SpecificAvroSerde configure can only be called once
2 participants