Skip to content

Commit d02ad34

Browse files
committed
8327476: Upgrade JLine to 3.26.1
Reviewed-by: mdoerr Backport-of: aaa90b3005c85852971203ce6feb88e7091e167b
1 parent 9c26323 commit d02ad34

File tree

125 files changed

+5521
-3586
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+5521
-3586
lines changed

src/jdk.internal.le/aix/classes/jdk/internal/org/jline/terminal/impl/jna/JDKNativePty.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,16 @@
2727
import java.io.IOException;
2828
import jdk.internal.org.jline.terminal.Attributes;
2929
import jdk.internal.org.jline.terminal.Size;
30+
import jdk.internal.org.jline.terminal.spi.SystemStream;
3031
import jdk.internal.org.jline.terminal.spi.TerminalProvider;
3132

3233
class JDKNativePty {
3334

34-
static JnaNativePty current(TerminalProvider.Stream console) throws IOException {
35+
static JnaNativePty current(TerminalProvider provider, SystemStream systemStream) throws IOException {
3536
throw new UnsupportedOperationException("Not supported.");
3637
}
3738

38-
static JnaNativePty open(Attributes attr, Size size) throws IOException {
39+
static JnaNativePty open(TerminalProvider provider, Attributes attr, Size size) throws IOException {
3940
throw new UnsupportedOperationException("Not supported.");
4041
}
4142

src/jdk.internal.le/linux/classes/jdk/internal/org/jline/terminal/impl/jna/JDKNativePty.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,17 @@
2828
import jdk.internal.org.jline.terminal.Attributes;
2929
import jdk.internal.org.jline.terminal.Size;
3030
import jdk.internal.org.jline.terminal.impl.jna.linux.LinuxNativePty;
31+
import jdk.internal.org.jline.terminal.spi.SystemStream;
3132
import jdk.internal.org.jline.terminal.spi.TerminalProvider;
3233

3334
class JDKNativePty {
3435

35-
static JnaNativePty current(TerminalProvider.Stream console) throws IOException {
36-
return LinuxNativePty.current(console);
36+
static JnaNativePty current(TerminalProvider provider, SystemStream systemStream) throws IOException {
37+
return LinuxNativePty.current(provider, systemStream);
3738
}
3839

39-
static JnaNativePty open(Attributes attr, Size size) throws IOException {
40-
return LinuxNativePty.open(attr, size);
40+
static JnaNativePty open(TerminalProvider provider, Attributes attr, Size size) throws IOException {
41+
return LinuxNativePty.open(provider, attr, size);
4142
}
4243

4344
static int isatty(int fd) {

src/jdk.internal.le/linux/classes/jdk/internal/org/jline/terminal/impl/jna/linux/CLibrary.java

Lines changed: 202 additions & 204 deletions
Large diffs are not rendered by default.

src/jdk.internal.le/linux/classes/jdk/internal/org/jline/terminal/impl/jna/linux/LinuxNativePty.java

Lines changed: 40 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002-2020, the original author or authors.
2+
* Copyright (c) 2002-2020, the original author(s).
33
*
44
* This software is distributable under the BSD license. See the terms of the
55
* BSD license in the documentation provided with this software.
@@ -11,15 +11,17 @@
1111
import java.io.FileDescriptor;
1212
import java.io.IOException;
1313

14-
//import com.sun.jna.LastErrorException;
15-
//import com.sun.jna.Native;
16-
//import com.sun.jna.Platform;
1714
import jdk.internal.org.jline.terminal.Attributes;
1815
import jdk.internal.org.jline.terminal.Size;
1916
import jdk.internal.org.jline.terminal.impl.jna.JnaNativePty;
2017
import jdk.internal.org.jline.terminal.impl.jna.LastErrorException;
18+
import jdk.internal.org.jline.terminal.spi.SystemStream;
2119
import jdk.internal.org.jline.terminal.spi.TerminalProvider;
2220

21+
//import com.sun.jna.LastErrorException;
22+
//import com.sun.jna.Native;
23+
//import com.sun.jna.Platform;
24+
2325
import static jdk.internal.org.jline.terminal.impl.jna.linux.CLibrary.TCSADRAIN;
2426
import static jdk.internal.org.jline.terminal.impl.jna.linux.CLibrary.TIOCGWINSZ;
2527
import static jdk.internal.org.jline.terminal.impl.jna.linux.CLibrary.TIOCSWINSZ;
@@ -33,44 +35,63 @@ public class LinuxNativePty extends JnaNativePty {
3335

3436
public interface UtilLibrary {// extends com.sun.jna.Library {
3537

36-
void openpty(int[] master, int[] slave, byte[] name, CLibrary.termios t, CLibrary.winsize s) throws LastErrorException;
38+
void openpty(int[] master, int[] slave, byte[] name, CLibrary.termios t, CLibrary.winsize s)
39+
throws LastErrorException;
3740

3841
// UtilLibrary INSTANCE = Native.load("util", UtilLibrary.class);
3942
UtilLibrary INSTANCE = new UtilLibraryImpl();
4043
}
4144

42-
public static LinuxNativePty current(TerminalProvider.Stream consoleStream) throws IOException {
43-
switch (consoleStream) {
45+
public static LinuxNativePty current(TerminalProvider provider, SystemStream systemStream) throws IOException {
46+
switch (systemStream) {
4447
case Output:
45-
return new LinuxNativePty(-1, null, 0, FileDescriptor.in, 1, FileDescriptor.out, ttyname(0));
48+
return new LinuxNativePty(
49+
provider, systemStream, -1, null, 0, FileDescriptor.in, 1, FileDescriptor.out, ttyname(0));
4650
case Error:
47-
return new LinuxNativePty(-1, null, 0, FileDescriptor.in, 2, FileDescriptor.err, ttyname(0));
51+
return new LinuxNativePty(
52+
provider, systemStream, -1, null, 0, FileDescriptor.in, 2, FileDescriptor.err, ttyname(0));
4853
default:
49-
throw new IllegalArgumentException("Unsupport stream for console: " + consoleStream);
54+
throw new IllegalArgumentException("Unsupported stream for console: " + systemStream);
5055
}
5156
}
5257

53-
public static LinuxNativePty open(Attributes attr, Size size) throws IOException {
58+
public static LinuxNativePty open(TerminalProvider provider, Attributes attr, Size size) throws IOException {
5459
int[] master = new int[1];
5560
int[] slave = new int[1];
5661
byte[] buf = new byte[64];
57-
UtilLibrary.INSTANCE.openpty(master, slave, buf,
58-
attr != null ? new termios(attr) : null,
59-
size != null ? new winsize(size) : null);
62+
UtilLibrary.INSTANCE.openpty(
63+
master, slave, buf, attr != null ? new termios(attr) : null, size != null ? new winsize(size) : null);
6064
int len = 0;
6165
while (buf[len] != 0) {
6266
len++;
6367
}
6468
String name = new String(buf, 0, len);
65-
return new LinuxNativePty(master[0], newDescriptor(master[0]), slave[0], newDescriptor(slave[0]), name);
69+
return new LinuxNativePty(
70+
provider, null, master[0], newDescriptor(master[0]), slave[0], newDescriptor(slave[0]), name);
6671
}
6772

68-
public LinuxNativePty(int master, FileDescriptor masterFD, int slave, FileDescriptor slaveFD, String name) {
69-
super(master, masterFD, slave, slaveFD, name);
73+
public LinuxNativePty(
74+
TerminalProvider provider,
75+
SystemStream systemStream,
76+
int master,
77+
FileDescriptor masterFD,
78+
int slave,
79+
FileDescriptor slaveFD,
80+
String name) {
81+
super(provider, systemStream, master, masterFD, slave, slaveFD, name);
7082
}
7183

72-
public LinuxNativePty(int master, FileDescriptor masterFD, int slave, FileDescriptor slaveFD, int slaveOut, FileDescriptor slaveOutFD, String name) {
73-
super(master, masterFD, slave, slaveFD, slaveOut, slaveOutFD, name);
84+
public LinuxNativePty(
85+
TerminalProvider provider,
86+
SystemStream systemStream,
87+
int master,
88+
FileDescriptor masterFD,
89+
int slave,
90+
FileDescriptor slaveFD,
91+
int slaveOut,
92+
FileDescriptor slaveOutFD,
93+
String name) {
94+
super(provider, systemStream, master, masterFD, slave, slaveFD, slaveOut, slaveOutFD, name);
7495
}
7596

7697
@Override
@@ -118,5 +139,4 @@ public static String ttyname(int slave) {
118139
}
119140
return new String(buf, 0, len);
120141
}
121-
122142
}

src/jdk.internal.le/macosx/classes/jdk/internal/org/jline/terminal/impl/jna/JDKNativePty.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,17 @@
2828
import jdk.internal.org.jline.terminal.Attributes;
2929
import jdk.internal.org.jline.terminal.Size;
3030
import jdk.internal.org.jline.terminal.impl.jna.osx.OsXNativePty;
31+
import jdk.internal.org.jline.terminal.spi.SystemStream;
3132
import jdk.internal.org.jline.terminal.spi.TerminalProvider;
3233

3334
class JDKNativePty {
3435

35-
static JnaNativePty current(TerminalProvider.Stream console) throws IOException {
36-
return OsXNativePty.current(console);
36+
static JnaNativePty current(TerminalProvider provider, SystemStream systemStream) throws IOException {
37+
return OsXNativePty.current(provider, systemStream);
3738
}
3839

39-
static JnaNativePty open(Attributes attr, Size size) throws IOException {
40-
return OsXNativePty.open(attr, size);
40+
static JnaNativePty open(TerminalProvider provider, Attributes attr, Size size) throws IOException {
41+
return OsXNativePty.open(provider, attr, size);
4142
}
4243

4344
static int isatty(int fd) {

0 commit comments

Comments
 (0)