This is an automated email from the ASF dual-hosted git repository.

cmccabe pushed a commit to branch metashell
in repository https://gitbox.apache.org/repos/asf/kafka.git

commit f8f5d0df60491d80b0df38b7e00065d2ef4d4e6c
Author: Colin Patrick McCabe <[email protected]>
AuthorDate: Thu Feb 11 09:55:09 2021 -0800

    Update shell/src/main/java/org/apache/kafka/shell/CommandUtils.java
    
    Co-authored-by: Igor Soarez <[email protected]>
---
 shell/src/main/java/org/apache/kafka/shell/CommandUtils.java | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/shell/src/main/java/org/apache/kafka/shell/CommandUtils.java 
b/shell/src/main/java/org/apache/kafka/shell/CommandUtils.java
index 8e5bc21..0639172 100644
--- a/shell/src/main/java/org/apache/kafka/shell/CommandUtils.java
+++ b/shell/src/main/java/org/apache/kafka/shell/CommandUtils.java
@@ -58,10 +58,7 @@ public final class CommandUtils {
      */
     public static void completeCommand(String commandPrefix, List<Candidate> 
candidates) {
         String command = Commands.TYPES.ceilingKey(commandPrefix);
-        while (true) {
-            if (command == null || !command.startsWith(commandPrefix)) {
-                return;
-            }
+        while (command != null && command.startsWith(commandPrefix)) {
             candidates.add(new Candidate(command));
             command = Commands.TYPES.higherKey(command);
         }

Reply via email to