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

apkhmv pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/main by this push:
     new d593e6487a IGNITE-21824 Revert workaround for jline bug (#3647)
d593e6487a is described below

commit d593e6487aa36a806bab075d19c8b831ca096a28
Author: Vadim Pakhnushev <8614891+valep...@users.noreply.github.com>
AuthorDate: Wed Apr 24 15:27:12 2024 +0300

    IGNITE-21824 Revert workaround for jline bug (#3647)
---
 gradle/libs.versions.toml                          |  2 +-
 .../core/repl/executor/IgnitePicocliCommands.java  | 34 ----------------------
 2 files changed, 1 insertion(+), 35 deletions(-)

diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index b423f3a60f..881e96a4f2 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -29,7 +29,7 @@ netty = "4.1.108.Final"
 javapoet = "1.13.0"
 javax = "1.3.2"
 jetbrainsAnnotations = "24.1.0"
-jline = "3.25.1"
+jline = "3.26.1"
 jmh = "1.37"
 junit5 = "5.10.2"
 junitPioneer = "2.2.0"
diff --git 
a/modules/cli/src/main/java/org/apache/ignite/internal/cli/core/repl/executor/IgnitePicocliCommands.java
 
b/modules/cli/src/main/java/org/apache/ignite/internal/cli/core/repl/executor/IgnitePicocliCommands.java
index 914d1a2492..b760c2bb3c 100644
--- 
a/modules/cli/src/main/java/org/apache/ignite/internal/cli/core/repl/executor/IgnitePicocliCommands.java
+++ 
b/modules/cli/src/main/java/org/apache/ignite/internal/cli/core/repl/executor/IgnitePicocliCommands.java
@@ -19,7 +19,6 @@ package org.apache.ignite.internal.cli.core.repl.executor;
 
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -221,8 +220,6 @@ public class IgnitePicocliCommands implements 
CommandRegistry {
                     candidates.add(staticCandidate(c));
                 }
             }
-
-            sortCandidates(candidates);
         }
 
         private Candidate dynamicCandidate(String one) {
@@ -236,36 +233,5 @@ public class IgnitePicocliCommands implements 
CommandRegistry {
         private Candidate staticCandidate(String one) {
             return new Candidate(one, one, null, null, null, null, true, 10);
         }
-
-        /**
-         * When custom sort order is used, sort candidates list and reassign 
sort order according to candidates order.
-         * TODO https://issues.apache.org/jira/browse/IGNITE-21824
-         *
-         * @param candidates List of candidates.
-         */
-        private void sortCandidates(List<Candidate> candidates) {
-            boolean customOrder = candidates.stream().anyMatch(c -> c.sort() 
!= 0);
-            if (!customOrder) {
-                return;
-            }
-            Collections.sort(candidates);
-            List<Candidate> newCandidates = new ArrayList<>(candidates.size());
-            for (int i = 0; i < candidates.size(); i++) {
-                Candidate candidate = candidates.get(i);
-                Candidate newCandidate = new Candidate(
-                        candidate.value(),
-                        candidate.displ(),
-                        candidate.group(),
-                        candidate.descr(),
-                        candidate.suffix(),
-                        candidate.key(),
-                        candidate.complete(),
-                        i // override sort order
-                );
-                newCandidates.add(newCandidate);
-            }
-            candidates.clear();
-            candidates.addAll(newCandidates);
-        }
     }
 }

Reply via email to