From c75ef6b7b22d08f314bd1e0e6d15397833f47b4a Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Sat, 1 Jul 2023 01:32:25 +0300 Subject: [PATCH 1/6] Use Objects.hashCode instead of Objects.hash to avoid vararg array creation (fixes #849) --- reader/src/main/java/org/jline/reader/Candidate.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reader/src/main/java/org/jline/reader/Candidate.java b/reader/src/main/java/org/jline/reader/Candidate.java index 65a816cb6..b27dd668f 100644 --- a/reader/src/main/java/org/jline/reader/Candidate.java +++ b/reader/src/main/java/org/jline/reader/Candidate.java @@ -188,7 +188,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(value); + return Objects.hashCode(value); } @Override From 689facf1a7decf3d22eb0b9cce8e49ea661b0c6f Mon Sep 17 00:00:00 2001 From: Janne Valkealahti Date: Fri, 28 Jul 2023 13:14:29 +0100 Subject: [PATCH 2/6] Fix TerminalProvider sorting - Change provider sorting so that it uses provider name instead of provider object itself. This fixes getting a proper sorting list index to compare the order. Uses null check in case provider wrongly gives name as null. - Fixes #846, #852 --- terminal/src/main/java/org/jline/terminal/TerminalBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terminal/src/main/java/org/jline/terminal/TerminalBuilder.java b/terminal/src/main/java/org/jline/terminal/TerminalBuilder.java index 7dbbd7d67..f587c9cc0 100644 --- a/terminal/src/main/java/org/jline/terminal/TerminalBuilder.java +++ b/terminal/src/main/java/org/jline/terminal/TerminalBuilder.java @@ -404,7 +404,7 @@ private Terminal doBuild() throws IOException { List order = Arrays.asList( System.getProperty(PROP_PROVIDERS, PROP_PROVIDERS_DEFAULT).split(",")); providers.sort(Comparator.comparing(l -> { - int idx = order.indexOf(l); + int idx = order.indexOf(l.name()); return idx >= 0 ? idx : Integer.MAX_VALUE; })); From 56efd75d69efd1487363e8d341feb37a6cc2cd1e Mon Sep 17 00:00:00 2001 From: Guillaume Nodet Date: Mon, 31 Jul 2023 16:36:02 +0200 Subject: [PATCH 3/6] Fix shell output going to stderr rather than stdout (fixes #845) --- terminal/src/main/java/org/jline/terminal/TerminalBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terminal/src/main/java/org/jline/terminal/TerminalBuilder.java b/terminal/src/main/java/org/jline/terminal/TerminalBuilder.java index f587c9cc0..dc57b1802 100644 --- a/terminal/src/main/java/org/jline/terminal/TerminalBuilder.java +++ b/terminal/src/main/java/org/jline/terminal/TerminalBuilder.java @@ -559,7 +559,7 @@ private Terminal doBuild() throws IOException { color ? Terminal.TYPE_DUMB_COLOR : Terminal.TYPE_DUMB, new FileInputStream(FileDescriptor.in), new FileOutputStream( - console == TerminalProvider.Stream.Output ? FileDescriptor.out : FileDescriptor.err), + console == TerminalProvider.Stream.Error ? FileDescriptor.err : FileDescriptor.out), encoding, signalHandler); } From 2428bb6577cb104df567bcc20a49b30b68461c41 Mon Sep 17 00:00:00 2001 From: Guillaume Nodet Date: Mon, 31 Jul 2023 16:36:52 +0200 Subject: [PATCH 4/6] Fix detection of utilities (fixes #839) --- .../main/java/org/jline/utils/OSUtils.java | 84 +++++++++---------- 1 file changed, 39 insertions(+), 45 deletions(-) diff --git a/terminal/src/main/java/org/jline/utils/OSUtils.java b/terminal/src/main/java/org/jline/utils/OSUtils.java index de7c4ea99..3c061b378 100644 --- a/terminal/src/main/java/org/jline/utils/OSUtils.java +++ b/terminal/src/main/java/org/jline/utils/OSUtils.java @@ -46,54 +46,48 @@ public class OSUtils { public static String TEST_COMMAND; static { - String tty; - String stty; - String sttyfopt; - String infocmp; - String test; - if (OSUtils.IS_CYGWIN || OSUtils.IS_MSYSTEM) { - tty = null; - stty = null; - sttyfopt = null; - infocmp = null; - test = null; - String path = System.getenv("PATH"); - if (path != null) { - String[] paths = path.split(";"); - for (String p : paths) { - if (tty == null && new File(p, "tty.exe").exists()) { - tty = new File(p, "tty.exe").getAbsolutePath(); - } - if (stty == null && new File(p, "stty.exe").exists()) { - stty = new File(p, "stty.exe").getAbsolutePath(); - } - if (infocmp == null && new File(p, "infocmp.exe").exists()) { - infocmp = new File(p, "infocmp.exe").getAbsolutePath(); - } - if (test == null && new File(p, "test.exe").exists()) { - test = new File(p, "test.exe").getAbsolutePath(); - } + boolean cygwinOrMsys = OSUtils.IS_CYGWIN || OSUtils.IS_MSYSTEM; + String suffix = cygwinOrMsys ? ".exe" : ""; + String tty = null; + String stty = null; + String sttyfopt = null; + String infocmp = null; + String test = null; + String path = System.getenv("PATH"); + if (path != null) { + String[] paths = path.split(File.pathSeparator); + for (String p : paths) { + File ttyFile = new File(p, "tty" + suffix); + if (tty == null && ttyFile.canExecute()) { + tty = ttyFile.getAbsolutePath(); + } + File sttyFile = new File(p, "stty" + suffix); + if (stty == null && sttyFile.canExecute()) { + stty = sttyFile.getAbsolutePath(); + } + File infocmpFile = new File(p, "infocmp" + suffix); + if (infocmp == null && infocmpFile.canExecute()) { + infocmp = infocmpFile.getAbsolutePath(); + } + File testFile = new File(p, "test" + suffix); + if (test == null && testFile.canExecute()) { + test = testFile.getAbsolutePath(); } } - if (tty == null) { - tty = "tty.exe"; - } - if (stty == null) { - stty = "stty.exe"; - } - if (infocmp == null) { - infocmp = "infocmp.exe"; - } - if (test == null) { - test = "test.exe"; - } - } else { - tty = "tty"; - stty = IS_OSX ? "/bin/stty" : "stty"; - sttyfopt = IS_OSX ? "-f" : "-F"; - infocmp = "infocmp"; - test = "/bin/test"; } + if (tty == null) { + tty = "tty" + suffix; + } + if (stty == null) { + stty = "stty" + suffix; + } + if (infocmp == null) { + infocmp = "infocmp" + suffix; + } + if (test == null) { + test = "test" + suffix; + } + sttyfopt = IS_OSX ? "-f" : "-F"; TTY_COMMAND = tty; STTY_COMMAND = stty; STTY_F_OPTION = sttyfopt; From f85d23cef59cc087bb0160525ef91daa8a95626e Mon Sep 17 00:00:00 2001 From: Guillaume Nodet Date: Tue, 1 Aug 2023 10:21:45 +0200 Subject: [PATCH 5/6] Add a warning when using the ExecTerminalProvider on recent JDKs --- .../terminal/impl/exec/ExecTerminalProvider.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/terminal/src/main/java/org/jline/terminal/impl/exec/ExecTerminalProvider.java b/terminal/src/main/java/org/jline/terminal/impl/exec/ExecTerminalProvider.java index cd3f4e3b1..ed6c9e646 100644 --- a/terminal/src/main/java/org/jline/terminal/impl/exec/ExecTerminalProvider.java +++ b/terminal/src/main/java/org/jline/terminal/impl/exec/ExecTerminalProvider.java @@ -25,10 +25,13 @@ import org.jline.terminal.spi.Pty; import org.jline.terminal.spi.TerminalProvider; import org.jline.utils.ExecHelper; +import org.jline.utils.Log; import org.jline.utils.OSUtils; public class ExecTerminalProvider implements TerminalProvider { + private static boolean warned; + public String name() { return "exec"; } @@ -142,11 +145,21 @@ public String systemStreamName(Stream stream) { return result.trim(); } } catch (Throwable t) { + if ("java.lang.reflect.InaccessibleObjectException" + .equals(t.getClass().getName()) + && !warned) { + Log.warn( + "The ExecTerminalProvider requires the JVM options: '--add-opens java.base/java.lang=ALL-UNNAMED'"); + warned = true; + } // ignore } return null; } + /** + * This requires --add-opens java.base/java.lang=ALL-UNNAMED + */ private ProcessBuilder.Redirect getRedirect(FileDescriptor fd) throws ReflectiveOperationException { // This is not really allowed, but this is the only way to redirect the output or error stream // to the input. This is definitely not something you'd usually want to do, but in the case of From f57822f6dd61c4059db401670d5ec289eb7618cb Mon Sep 17 00:00:00 2001 From: Guillaume Nodet Date: Tue, 1 Aug 2023 11:35:45 +0200 Subject: [PATCH 6/6] Support building on JDK 21 --- .../java/org/jline/builtins/Completers.java | 1 + .../main/java/org/jline/builtins/Nano.java | 1 + .../main/java/org/jline/builtins/Tmux.java | 1 + .../java/org/jline/console/impl/Builtins.java | 1 + .../jline/console/impl/ConsoleEngineImpl.java | 2 +- .../console/impl/SystemRegistryImpl.java | 1 + .../org/jline/widget/AutopairWidgets.java | 1 + .../jline/widget/AutosuggestionWidgets.java | 1 + .../java/org/jline/widget/TailTipWidgets.java | 1 + .../java/org/jline/script/GroovyCommand.java | 1 + pom.xml | 24 +++++++++++++------ .../org/jline/reader/impl/LineReaderImpl.java | 4 +++- .../java/org/jline/reader/impl/UndoTree.java | 1 + .../reader/impl/history/DefaultHistory.java | 1 + .../jline/builtins/telnet/ConnectionData.java | 1 + .../builtins/telnet/ConnectionManager.java | 1 + .../java/org/jline/terminal/Attributes.java | 1 + .../main/java/org/jline/terminal/Size.java | 1 + .../jline/terminal/impl/AbstractTerminal.java | 4 +++- .../impl/AbstractWindowsTerminal.java | 1 + .../org/jline/terminal/impl/DumbTerminal.java | 1 + .../jline/terminal/impl/ExternalTerminal.java | 1 + .../terminal/impl/LineDisciplineTerminal.java | 1 + .../jline/terminal/impl/PosixPtyTerminal.java | 1 + .../jline/terminal/impl/PosixSysTerminal.java | 1 + .../java/org/jline/utils/ColorPalette.java | 1 + .../main/java/org/jline/utils/Display.java | 1 + .../src/main/java/org/jline/utils/Status.java | 1 + 28 files changed, 48 insertions(+), 10 deletions(-) diff --git a/builtins/src/main/java/org/jline/builtins/Completers.java b/builtins/src/main/java/org/jline/builtins/Completers.java index f29212d99..f133ad8f2 100644 --- a/builtins/src/main/java/org/jline/builtins/Completers.java +++ b/builtins/src/main/java/org/jline/builtins/Completers.java @@ -446,6 +446,7 @@ public TreeCompleter(Node... nodes) { this(Arrays.asList(nodes)); } + @SuppressWarnings("this-escape") public TreeCompleter(List nodes) { StringBuilder sb = new StringBuilder(); addRoots(sb, nodes); diff --git a/builtins/src/main/java/org/jline/builtins/Nano.java b/builtins/src/main/java/org/jline/builtins/Nano.java index 8a2642ba4..caae9d5a0 100644 --- a/builtins/src/main/java/org/jline/builtins/Nano.java +++ b/builtins/src/main/java/org/jline/builtins/Nano.java @@ -1551,6 +1551,7 @@ public Nano(Terminal terminal, Path root, Options opts) { this(terminal, root, opts, null); } + @SuppressWarnings("this-escape") public Nano(Terminal terminal, Path root, Options opts, ConfigurationPath configPath) { this.terminal = terminal; this.windowsTerminal = terminal.getClass().getSimpleName().endsWith("WinSysTerminal"); diff --git a/builtins/src/main/java/org/jline/builtins/Tmux.java b/builtins/src/main/java/org/jline/builtins/Tmux.java index bf06deed2..486c616f1 100644 --- a/builtins/src/main/java/org/jline/builtins/Tmux.java +++ b/builtins/src/main/java/org/jline/builtins/Tmux.java @@ -428,6 +428,7 @@ public void resizePane(Options opt, int adjust) { } } + @SuppressWarnings("this-escape") public Tmux(Terminal terminal, PrintStream err, Consumer runner) throws IOException { this.terminal = terminal; this.err = err; diff --git a/console/src/main/java/org/jline/console/impl/Builtins.java b/console/src/main/java/org/jline/console/impl/Builtins.java index 57e44bcf0..3351f56a7 100644 --- a/console/src/main/java/org/jline/console/impl/Builtins.java +++ b/console/src/main/java/org/jline/console/impl/Builtins.java @@ -74,6 +74,7 @@ public Builtins(Supplier workDir, ConfigurationPath configPath, Function commands, Supplier workDir, diff --git a/console/src/main/java/org/jline/console/impl/ConsoleEngineImpl.java b/console/src/main/java/org/jline/console/impl/ConsoleEngineImpl.java index e0641a192..f3f8d2682 100644 --- a/console/src/main/java/org/jline/console/impl/ConsoleEngineImpl.java +++ b/console/src/main/java/org/jline/console/impl/ConsoleEngineImpl.java @@ -87,7 +87,7 @@ public ConsoleEngineImpl(ScriptEngine engine, Printer printer, Supplier wo this(null, engine, printer, workDir, configPath); } - @SuppressWarnings("unchecked") + @SuppressWarnings({"unchecked", "this-escape"}) public ConsoleEngineImpl( Set commands, ScriptEngine engine, diff --git a/console/src/main/java/org/jline/console/impl/SystemRegistryImpl.java b/console/src/main/java/org/jline/console/impl/SystemRegistryImpl.java index 04d04eb01..939227eca 100644 --- a/console/src/main/java/org/jline/console/impl/SystemRegistryImpl.java +++ b/console/src/main/java/org/jline/console/impl/SystemRegistryImpl.java @@ -81,6 +81,7 @@ public enum Pipe { private boolean commandGroups = true; private Function scriptDescription; + @SuppressWarnings("this-escape") public SystemRegistryImpl(Parser parser, Terminal terminal, Supplier workDir, ConfigurationPath configPath) { this.parser = parser; this.workDir = workDir; diff --git a/console/src/main/java/org/jline/widget/AutopairWidgets.java b/console/src/main/java/org/jline/widget/AutopairWidgets.java index b33aa23c9..1dca09e1e 100644 --- a/console/src/main/java/org/jline/widget/AutopairWidgets.java +++ b/console/src/main/java/org/jline/widget/AutopairWidgets.java @@ -68,6 +68,7 @@ public AutopairWidgets(LineReader reader) { this(reader, false); } + @SuppressWarnings("this-escape") public AutopairWidgets(LineReader reader, boolean addCurlyBrackets) { super(reader); if (existsWidget(AP_INSERT)) { diff --git a/console/src/main/java/org/jline/widget/AutosuggestionWidgets.java b/console/src/main/java/org/jline/widget/AutosuggestionWidgets.java index b2c2a8261..b4b17032e 100644 --- a/console/src/main/java/org/jline/widget/AutosuggestionWidgets.java +++ b/console/src/main/java/org/jline/widget/AutosuggestionWidgets.java @@ -22,6 +22,7 @@ public class AutosuggestionWidgets extends Widgets { private boolean enabled = false; + @SuppressWarnings("this-escape") public AutosuggestionWidgets(LineReader reader) { super(reader); if (existsWidget("_autosuggest-forward-char")) { diff --git a/console/src/main/java/org/jline/widget/TailTipWidgets.java b/console/src/main/java/org/jline/widget/TailTipWidgets.java index 935e5652f..28876f9cf 100644 --- a/console/src/main/java/org/jline/widget/TailTipWidgets.java +++ b/console/src/main/java/org/jline/widget/TailTipWidgets.java @@ -124,6 +124,7 @@ public TailTipWidgets(LineReader reader, Function descFun, int this(reader, null, descriptionSize, tipType, descFun); } + @SuppressWarnings("this-escape") private TailTipWidgets( LineReader reader, Map tailTips, diff --git a/groovy/src/main/java/org/jline/script/GroovyCommand.java b/groovy/src/main/java/org/jline/script/GroovyCommand.java index cb7f52334..d827c6af0 100644 --- a/groovy/src/main/java/org/jline/script/GroovyCommand.java +++ b/groovy/src/main/java/org/jline/script/GroovyCommand.java @@ -51,6 +51,7 @@ public GroovyCommand(GroovyEngine engine, Printer printer) { this(null, engine, printer); } + @SuppressWarnings("this-escape") public GroovyCommand(Set commands, GroovyEngine engine, Printer printer) { this.engine = engine; this.printer = printer; diff --git a/pom.xml b/pom.xml index f7fe249c0..08a61f4cf 100644 --- a/pom.xml +++ b/pom.xml @@ -109,7 +109,7 @@ 1.1.8 2.0.6 3.0.2 - 4.0.7 + 4.0.13 2.5.1 22.3.0 21.2.0 @@ -522,7 +522,7 @@ com.diffplug.spotless spotless-maven-plugin - 2.28.0 + 2.37.0 @@ -684,11 +684,6 @@ org.graalvm.nativeimage native-image-maven-plugin - - - com.diffplug.spotless - spotless-maven-plugin - @@ -764,6 +759,21 @@ + + java11 + + [11,21) + + + + + com.diffplug.spotless + spotless-maven-plugin + + + + + license-check diff --git a/reader/src/main/java/org/jline/reader/impl/LineReaderImpl.java b/reader/src/main/java/org/jline/reader/impl/LineReaderImpl.java index 9b8a72188..57074f724 100644 --- a/reader/src/main/java/org/jline/reader/impl/LineReaderImpl.java +++ b/reader/src/main/java/org/jline/reader/impl/LineReaderImpl.java @@ -232,7 +232,7 @@ protected enum BellType { protected KillRing killRing = new KillRing(); - protected UndoTree undo = new UndoTree<>(this::setBuffer); + protected UndoTree undo; protected boolean isUndo; /** @@ -291,6 +291,7 @@ public LineReaderImpl(Terminal terminal, String appName) throws IOException { this(terminal, appName, null); } + @SuppressWarnings("this-escape") public LineReaderImpl(Terminal terminal, String appName, Map variables) { Objects.requireNonNull(terminal, "terminal can not be null"); this.terminal = terminal; @@ -309,6 +310,7 @@ public LineReaderImpl(Terminal terminal, String appName, Map var this.alternateOut = Curses.tputs(terminal.getStringCapability(Capability.exit_alt_charset_mode)); } + undo = new UndoTree<>(this::setBuffer); builtinWidgets = builtinWidgets(); widgets = new HashMap<>(builtinWidgets); bindingReader = new BindingReader(terminal.reader()); diff --git a/reader/src/main/java/org/jline/reader/impl/UndoTree.java b/reader/src/main/java/org/jline/reader/impl/UndoTree.java index 0303fdff5..3c9736e07 100644 --- a/reader/src/main/java/org/jline/reader/impl/UndoTree.java +++ b/reader/src/main/java/org/jline/reader/impl/UndoTree.java @@ -20,6 +20,7 @@ public class UndoTree { private final Node parent; private Node current; + @SuppressWarnings("this-escape") public UndoTree(Consumer s) { state = s; parent = new Node(null); diff --git a/reader/src/main/java/org/jline/reader/impl/history/DefaultHistory.java b/reader/src/main/java/org/jline/reader/impl/history/DefaultHistory.java index cbb509ca2..416c3039d 100644 --- a/reader/src/main/java/org/jline/reader/impl/history/DefaultHistory.java +++ b/reader/src/main/java/org/jline/reader/impl/history/DefaultHistory.java @@ -43,6 +43,7 @@ public class DefaultHistory implements History { public DefaultHistory() {} + @SuppressWarnings("this-escape") public DefaultHistory(LineReader reader) { attach(reader); } diff --git a/remote-telnet/src/main/java/org/jline/builtins/telnet/ConnectionData.java b/remote-telnet/src/main/java/org/jline/builtins/telnet/ConnectionData.java index dfbd10415..629a62605 100644 --- a/remote-telnet/src/main/java/org/jline/builtins/telnet/ConnectionData.java +++ b/remote-telnet/src/main/java/org/jline/builtins/telnet/ConnectionData.java @@ -81,6 +81,7 @@ public class ConnectionData { * @param sock Socket of the inbound connection. * @param cm the connection manager */ + @SuppressWarnings("this-escape") public ConnectionData(Socket sock, ConnectionManager cm) { socket = sock; connectionManager = cm; diff --git a/remote-telnet/src/main/java/org/jline/builtins/telnet/ConnectionManager.java b/remote-telnet/src/main/java/org/jline/builtins/telnet/ConnectionManager.java index fd7a70326..a4a1aa3b3 100644 --- a/remote-telnet/src/main/java/org/jline/builtins/telnet/ConnectionManager.java +++ b/remote-telnet/src/main/java/org/jline/builtins/telnet/ConnectionManager.java @@ -74,6 +74,7 @@ public abstract class ConnectionManager implements Runnable { private boolean lineMode = false; private boolean stopping = false; + @SuppressWarnings("this-escape") public ConnectionManager() { threadGroup = new ThreadGroup(toString() + "Connections"); closedConnections = new Stack(); diff --git a/terminal/src/main/java/org/jline/terminal/Attributes.java b/terminal/src/main/java/org/jline/terminal/Attributes.java index 07b7ff471..a33977fa4 100644 --- a/terminal/src/main/java/org/jline/terminal/Attributes.java +++ b/terminal/src/main/java/org/jline/terminal/Attributes.java @@ -137,6 +137,7 @@ public enum LocalFlag { public Attributes() {} + @SuppressWarnings("this-escape") public Attributes(Attributes attr) { copy(attr); } diff --git a/terminal/src/main/java/org/jline/terminal/Size.java b/terminal/src/main/java/org/jline/terminal/Size.java index 3279d77d6..f5ccd199c 100644 --- a/terminal/src/main/java/org/jline/terminal/Size.java +++ b/terminal/src/main/java/org/jline/terminal/Size.java @@ -15,6 +15,7 @@ public class Size { public Size() {} + @SuppressWarnings("this-escape") public Size(int columns, int rows) { this(); setColumns(columns); diff --git a/terminal/src/main/java/org/jline/terminal/impl/AbstractTerminal.java b/terminal/src/main/java/org/jline/terminal/impl/AbstractTerminal.java index d5a806c84..36dde577a 100644 --- a/terminal/src/main/java/org/jline/terminal/impl/AbstractTerminal.java +++ b/terminal/src/main/java/org/jline/terminal/impl/AbstractTerminal.java @@ -44,7 +44,7 @@ public abstract class AbstractTerminal implements Terminal { protected final Set bools = new HashSet<>(); protected final Map ints = new HashMap<>(); protected final Map strings = new HashMap<>(); - protected final ColorPalette palette = new ColorPalette(this); + protected final ColorPalette palette; protected Status status; protected Runnable onClose; @@ -52,11 +52,13 @@ public AbstractTerminal(String name, String type) throws IOException { this(name, type, null, SignalHandler.SIG_DFL); } + @SuppressWarnings("this-escape") public AbstractTerminal(String name, String type, Charset encoding, SignalHandler signalHandler) throws IOException { this.name = name; this.type = type != null ? type : "ansi"; this.encoding = encoding != null ? encoding : Charset.defaultCharset(); + this.palette = new ColorPalette(this); for (Signal signal : Signal.values()) { handlers.put(signal, signalHandler); } diff --git a/terminal/src/main/java/org/jline/terminal/impl/AbstractWindowsTerminal.java b/terminal/src/main/java/org/jline/terminal/impl/AbstractWindowsTerminal.java index b90d9628f..bd5d77740 100644 --- a/terminal/src/main/java/org/jline/terminal/impl/AbstractWindowsTerminal.java +++ b/terminal/src/main/java/org/jline/terminal/impl/AbstractWindowsTerminal.java @@ -82,6 +82,7 @@ public abstract class AbstractWindowsTerminal extends AbstractTerminal protected boolean focusTracking = false; private volatile boolean closing; + @SuppressWarnings("this-escape") public AbstractWindowsTerminal( Writer writer, String name, diff --git a/terminal/src/main/java/org/jline/terminal/impl/DumbTerminal.java b/terminal/src/main/java/org/jline/terminal/impl/DumbTerminal.java index 5c86095ec..a6006ffe2 100644 --- a/terminal/src/main/java/org/jline/terminal/impl/DumbTerminal.java +++ b/terminal/src/main/java/org/jline/terminal/impl/DumbTerminal.java @@ -40,6 +40,7 @@ public DumbTerminal(String name, String type, InputStream in, OutputStream out, this(name, type, in, out, encoding, SignalHandler.SIG_DFL); } + @SuppressWarnings("this-escape") public DumbTerminal( String name, String type, InputStream in, OutputStream out, Charset encoding, SignalHandler signalHandler) throws IOException { diff --git a/terminal/src/main/java/org/jline/terminal/impl/ExternalTerminal.java b/terminal/src/main/java/org/jline/terminal/impl/ExternalTerminal.java index d463794da..39fa27307 100644 --- a/terminal/src/main/java/org/jline/terminal/impl/ExternalTerminal.java +++ b/terminal/src/main/java/org/jline/terminal/impl/ExternalTerminal.java @@ -67,6 +67,7 @@ public ExternalTerminal( this(name, type, masterInput, masterOutput, encoding, signalHandler, paused, null, null); } + @SuppressWarnings("this-escape") public ExternalTerminal( String name, String type, diff --git a/terminal/src/main/java/org/jline/terminal/impl/LineDisciplineTerminal.java b/terminal/src/main/java/org/jline/terminal/impl/LineDisciplineTerminal.java index 3a31715af..a5576140a 100644 --- a/terminal/src/main/java/org/jline/terminal/impl/LineDisciplineTerminal.java +++ b/terminal/src/main/java/org/jline/terminal/impl/LineDisciplineTerminal.java @@ -91,6 +91,7 @@ public LineDisciplineTerminal(String name, String type, OutputStream masterOutpu this(name, type, masterOutput, encoding, SignalHandler.SIG_DFL); } + @SuppressWarnings("this-escape") public LineDisciplineTerminal( String name, String type, OutputStream masterOutput, Charset encoding, SignalHandler signalHandler) throws IOException { diff --git a/terminal/src/main/java/org/jline/terminal/impl/PosixPtyTerminal.java b/terminal/src/main/java/org/jline/terminal/impl/PosixPtyTerminal.java index 6047f2c19..db3913a99 100644 --- a/terminal/src/main/java/org/jline/terminal/impl/PosixPtyTerminal.java +++ b/terminal/src/main/java/org/jline/terminal/impl/PosixPtyTerminal.java @@ -55,6 +55,7 @@ public PosixPtyTerminal( this(name, type, pty, in, out, encoding, signalHandler, false); } + @SuppressWarnings("this-escape") public PosixPtyTerminal( String name, String type, diff --git a/terminal/src/main/java/org/jline/terminal/impl/PosixSysTerminal.java b/terminal/src/main/java/org/jline/terminal/impl/PosixSysTerminal.java index c07b6d6b2..e6fbacdf2 100644 --- a/terminal/src/main/java/org/jline/terminal/impl/PosixSysTerminal.java +++ b/terminal/src/main/java/org/jline/terminal/impl/PosixSysTerminal.java @@ -34,6 +34,7 @@ public class PosixSysTerminal extends AbstractPosixTerminal { protected final Map nativeHandlers = new HashMap<>(); protected final Task closer; + @SuppressWarnings("this-escape") public PosixSysTerminal( String name, String type, Pty pty, Charset encoding, boolean nativeSignals, SignalHandler signalHandler) throws IOException { diff --git a/terminal/src/main/java/org/jline/utils/ColorPalette.java b/terminal/src/main/java/org/jline/utils/ColorPalette.java index 7471760ba..22f52dbff 100644 --- a/terminal/src/main/java/org/jline/utils/ColorPalette.java +++ b/terminal/src/main/java/org/jline/utils/ColorPalette.java @@ -42,6 +42,7 @@ public ColorPalette(Terminal terminal) throws IOException { this(terminal, null); } + @SuppressWarnings("this-escape") public ColorPalette(Terminal terminal, String distance) throws IOException { this.terminal = terminal; this.distanceName = distance; diff --git a/terminal/src/main/java/org/jline/utils/Display.java b/terminal/src/main/java/org/jline/utils/Display.java index c172b92a1..b8fb88342 100644 --- a/terminal/src/main/java/org/jline/utils/Display.java +++ b/terminal/src/main/java/org/jline/utils/Display.java @@ -41,6 +41,7 @@ public class Display { protected final boolean delayedWrapAtEol; protected final boolean cursorDownIsNewLine; + @SuppressWarnings("this-escape") public Display(Terminal terminal, boolean fullscreen) { this.terminal = terminal; this.fullScreen = fullscreen; diff --git a/terminal/src/main/java/org/jline/utils/Status.java b/terminal/src/main/java/org/jline/utils/Status.java index cc1f50e26..d301d3df2 100644 --- a/terminal/src/main/java/org/jline/utils/Status.java +++ b/terminal/src/main/java/org/jline/utils/Status.java @@ -39,6 +39,7 @@ public static Status getStatus(Terminal terminal, boolean create) { return terminal instanceof AbstractTerminal ? ((AbstractTerminal) terminal).getStatus(create) : null; } + @SuppressWarnings("this-escape") public Status(AbstractTerminal terminal) { this.terminal = Objects.requireNonNull(terminal, "terminal can not be null"); this.supported = terminal.getStringCapability(Capability.change_scroll_region) != null