schema-registry
schema-registry copied to clipboard
Document configure only should be called once
Fixes https://github.com/confluentinc/schema-registry/issues/1903
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?
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.
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.