MINOR: Rename ambiguous method name#19875
Conversation
|
Hi @hgh1472 , thanks for the patch! I guess the naming came from the fact that this throws only under a certain condition (if the group id is empty), therefore "maybeThrow...", makes sense? That being said, we can surely improve readability like you're suggesting, but being explicit about the condition I would say (otherwise I don't see much gain between maybeThrow vs throwIf). So something like Also, we should change consistently on the |
|
@lianetm Thanks for the reply! |
|
@lianetm |
|
Thanks for the update! Just a nit, (Sorry I suggested the empty myself initially, mixing empty optional vs empty string) |
|
@lianetm |
exactly, it's checking that it's defined because those APIs require a groupId (and if it's defined we know already it will be non-empty because that's enforced in the consumer constructor) |
|
@lianetm |
While reading through the code, I found the method name to be somewhat
ambiguous and not fully descriptive of its purpose.
So I renamed the method to make its purpose clearer and more
self-explanatory. If there was another reason for the original naming,
I’d be happy to hear about it.
Reviewers: Lianet Magrans lmagrans@confluent.io