This is an automated email from the ASF dual-hosted git repository. ddanielr pushed a commit to branch 2.1 in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/2.1 by this push: new 01ccb96472 Fix Illegal Reflective Access Warning in Shell (#4427) 01ccb96472 is described below commit 01ccb9647269bbf216043721afa298721dd80699 Author: Daniel Roberts <ddani...@gmail.com> AuthorDate: Mon Apr 1 10:58:18 2024 -0400 Fix Illegal Reflective Access Warning in Shell (#4427) Jline 3.24.1 throws an illegal reflective access warning when starting an accumulo shell using java 11. Updates jline to use 3.25.1 which includes the fix. --- pom.xml | 2 +- .../apache/accumulo/shell/commands/HistoryCommandTest.java | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index fb747c50a8..fbffd60171 100644 --- a/pom.xml +++ b/pom.xml @@ -624,7 +624,7 @@ <dependency> <groupId>org.jline</groupId> <artifactId>jline</artifactId> - <version>3.24.1</version> + <version>3.25.1</version> </dependency> <dependency> <groupId>org.latencyutils</groupId> diff --git a/shell/src/test/java/org/apache/accumulo/shell/commands/HistoryCommandTest.java b/shell/src/test/java/org/apache/accumulo/shell/commands/HistoryCommandTest.java index 4228eaa7e2..6e45768f8f 100644 --- a/shell/src/test/java/org/apache/accumulo/shell/commands/HistoryCommandTest.java +++ b/shell/src/test/java/org/apache/accumulo/shell/commands/HistoryCommandTest.java @@ -18,6 +18,7 @@ */ package org.apache.accumulo.shell.commands; +import static java.nio.charset.StandardCharsets.UTF_8; import static org.easymock.EasyMock.createMock; import static org.easymock.EasyMock.expect; import static org.easymock.EasyMock.replay; @@ -38,7 +39,7 @@ import org.jline.reader.LineReaderBuilder; import org.jline.reader.impl.DefaultExpander; import org.jline.reader.impl.history.DefaultHistory; import org.jline.terminal.Terminal; -import org.jline.terminal.TerminalBuilder; +import org.jline.terminal.impl.ExternalTerminal; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -69,8 +70,8 @@ public class HistoryCommandTest { baos = new ByteArrayOutputStream(); String input = String.format("!1%n"); // Construct a platform dependent new-line - terminal = TerminalBuilder.builder().system(false) - .streams(new ByteArrayInputStream(input.getBytes()), baos).build(); + terminal = new ExternalTerminal("shell", "ansi", new ByteArrayInputStream(input.getBytes()), + baos, UTF_8); reader = LineReaderBuilder.builder().history(history).terminal(terminal).build(); shell = new Shell(reader); @@ -80,8 +81,8 @@ public class HistoryCommandTest { public void testCorrectNumbering() throws IOException { command.execute("", cl, shell); terminal.writer().flush(); - - assertTrue(baos.toString().contains("2: bar")); + assertTrue(baos.toString().contains("2: bar"), + "History order is not correct: " + baos.toString()); } @Test