LindaSummer commented on code in PR #5857:
URL: https://github.com/apache/gravitino/pull/5857#discussion_r1885991713
##########
clients/cli/src/main/java/org/apache/gravitino/cli/commands/CreateTag.java:
##########
@@ -52,11 +52,17 @@ public CreateTag(
/** Create tags. */
@Override
public void handle() {
- boolean hasOnlyOneTag = tags.length == 1;
- if (hasOnlyOneTag) {
- handleOnlyOneTag();
- } else {
- handleMultipleTags();
+ int tagCount = (tags != null ? tags.length : 0);
+ switch (tagCount) {
+ case 0:
+ System.err.println(ErrorMessages.TAG_EMPTY);
+ break;
+ case 1:
+ handleOnlyOneTag();
+ break;
+ default:
+ handleMultipleTags();
+ break;
Review Comment:
Hi @justinmclean ,
Thanks very much for your suggestion! 😊
I will fix the CI failure and refactor to a if else statement.
Best Regards,
Edward
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]