From 1c0532c12fe70ab40f948d3953033ebd6aff08b6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Jul 2026 01:52:19 +0000 Subject: [PATCH 1/2] Bump jline:jline from 0.9.5 to 2.14.6 Bumps [jline:jline](https://github.com/jline/jline2) from 0.9.5 to 2.14.6. - [Changelog](https://github.com/jline/jline2/blob/master/CHANGELOG.md) - [Commits](https://github.com/jline/jline2/commits/jline-2.14.6) --- updated-dependencies: - dependency-name: jline:jline dependency-version: 2.14.6 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- jelly-tags/interaction/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jelly-tags/interaction/pom.xml b/jelly-tags/interaction/pom.xml index 875eb205a..618ee97eb 100644 --- a/jelly-tags/interaction/pom.xml +++ b/jelly-tags/interaction/pom.xml @@ -40,7 +40,7 @@ jline jline - 0.9.5 + 2.14.6 jar From e52e89f6975f9bce45a4b840c24db745dd6ca7ff Mon Sep 17 00:00:00 2001 From: Suraj Rajan Date: Tue, 8 Sep 2026 16:10:19 +0530 Subject: [PATCH 2/2] Migrate interaction tag to JLine 2 API (#107) --- .../jelly/tags/interaction/AskTag.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/jelly-tags/interaction/src/main/java/org/apache/commons/jelly/tags/interaction/AskTag.java b/jelly-tags/interaction/src/main/java/org/apache/commons/jelly/tags/interaction/AskTag.java index 01019a9fe..5e099a68a 100644 --- a/jelly-tags/interaction/src/main/java/org/apache/commons/jelly/tags/interaction/AskTag.java +++ b/jelly-tags/interaction/src/main/java/org/apache/commons/jelly/tags/interaction/AskTag.java @@ -27,9 +27,10 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import jline.ConsoleReader; -import jline.History; -import jline.SimpleCompletor; +import jline.console.ConsoleReader; +import jline.console.completer.StringsCompleter; +import jline.console.history.History; +import jline.console.history.MemoryHistory; /** * Jelly Tag that asks the user a question, and puts his answer into a variable, @@ -42,7 +43,7 @@ public class AskTag extends TagSupport { private static Log logger = LogFactory.getLog(AskTag.class); /** The history of previous user-inputs.*/ - private static History consoleHistory = new History(); + private static History consoleHistory = new MemoryHistory(); /** The question to ask to the user. */ private String question; @@ -105,15 +106,19 @@ public void doTag(final XMLOutput output) { consoleReader.setBellEnabled(false); // add old commands as tab completion history - final List oldCommandsAsList = useHistoryCompletor - ? new ArrayList(consoleHistory.getHistoryList()) : new ArrayList(0); + final List oldCommandsAsList = new ArrayList<>(); + if (useHistoryCompletor) { + for (final History.Entry entry : consoleHistory) { + oldCommandsAsList.add(entry.value().toString()); + } + } // add predefined commands if given if (completor != null && !completor.isEmpty()) { oldCommandsAsList.addAll(completor); } final String[] oldCommands = new String[oldCommandsAsList.size()]; oldCommandsAsList.toArray(oldCommands); - consoleReader.addCompletor (new SimpleCompletor (oldCommands)); + consoleReader.addCompleter(new StringsCompleter(oldCommands)); // read the input! input = consoleReader.readLine();