Skip to content

Commit c4a7b2c

Browse files
vieirojerboaa
authored andcommitted
8327476: Upgrade JLine to 3.26.1
Backport-of: bb391d7a3656eda8864b777a9561a9e7e71a47a9
1 parent 79faa19 commit c4a7b2c

File tree

116 files changed

+4880
-3037
lines changed

Some content is hidden

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

116 files changed

+4880
-3037
lines changed

src/jdk.internal.le/share/classes/jdk/internal/org/jline/keymap/BindingReader.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002-2018, the original author or authors.
2+
* Copyright (c) 2002-2018, 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.
@@ -66,7 +66,7 @@ public <T> T readBinding(KeyMap<T> keys, KeyMap<T> local, boolean block) {
6666
T o = null;
6767
int[] remaining = new int[1];
6868
boolean hasRead = false;
69-
for (;;) {
69+
for (; ; ) {
7070
if (local != null) {
7171
o = local.getBound(opBuffer, remaining);
7272
}
@@ -78,8 +78,7 @@ public <T> T readBinding(KeyMap<T> keys, KeyMap<T> local, boolean block) {
7878
if (remaining[0] >= 0) {
7979
runMacro(opBuffer.substring(opBuffer.length() - remaining[0]));
8080
opBuffer.setLength(opBuffer.length() - remaining[0]);
81-
}
82-
else {
81+
} else {
8382
long ambiguousTimeout = keys.getAmbiguousTimeout();
8483
if (ambiguousTimeout > 0 && peekCharacter(ambiguousTimeout) != NonBlockingReader.READ_EXPIRED) {
8584
o = null;
@@ -234,5 +233,4 @@ public String getCurrentBuffer() {
234233
public String getLastBinding() {
235234
return lastBinding;
236235
}
237-
238236
}

src/jdk.internal.le/share/classes/jdk/internal/org/jline/keymap/KeyMap.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002-2016, the original author or authors.
2+
* Copyright (c) 2002-2016, 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.
@@ -8,8 +8,6 @@
88
*/
99
package jdk.internal.org.jline.keymap;
1010

11-
import java.io.IOException;
12-
import java.io.StringWriter;
1311
import java.util.ArrayList;
1412
import java.util.Collection;
1513
import java.util.Comparator;
@@ -218,7 +216,6 @@ public static Collection<String> range(String range) {
218216
return seqs;
219217
}
220218

221-
222219
public static String esc() {
223220
return "\033";
224221
}
@@ -264,7 +261,6 @@ public static String key(Terminal terminal, Capability capability) {
264261
// Methods
265262
//
266263

267-
268264
public T getUnicode() {
269265
return unicode;
270266
}
@@ -306,9 +302,7 @@ private static <T> void doGetBoundKeys(KeyMap<T> keyMap, String prefix, Map<Stri
306302
}
307303
for (int c = 0; c < keyMap.mapping.length; c++) {
308304
if (keyMap.mapping[c] instanceof KeyMap) {
309-
doGetBoundKeys((KeyMap<T>) keyMap.mapping[c],
310-
prefix + (char) (c),
311-
bound);
305+
doGetBoundKeys((KeyMap<T>) keyMap.mapping[c], prefix + (char) (c), bound);
312306
} else if (keyMap.mapping[c] != null) {
313307
bound.put(prefix + (char) (c), (T) keyMap.mapping[c]);
314308
}
@@ -456,5 +450,4 @@ private static <T> void bind(KeyMap<T> map, CharSequence keySeq, T function, boo
456450
}
457451
}
458452
}
459-
460453
}

src/jdk.internal.le/share/classes/jdk/internal/org/jline/reader/Binding.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002-2016, the original author or authors.
2+
* Copyright (c) 2002-2016, 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.
@@ -14,9 +14,8 @@
1414
* @see Macro
1515
* @see Reference
1616
* @see Widget
17-
* @see jdk.internal.org.jline.keymap.KeyMap
17+
* @see org.jline.keymap.KeyMap
1818
*
1919
* @author <a href="mailto:[email protected]">Guillaume Nodet</a>
2020
*/
21-
public interface Binding {
22-
}
21+
public interface Binding {}

src/jdk.internal.le/share/classes/jdk/internal/org/jline/reader/Buffer.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002-2017, the original author or authors.
2+
* Copyright (c) 2002-2017, 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.
@@ -84,4 +84,8 @@ public interface Buffer {
8484

8585
void copyFrom(Buffer buffer);
8686

87+
/**
88+
* Clear any internal buffer.
89+
*/
90+
void zeroOut();
8791
}

src/jdk.internal.le/share/classes/jdk/internal/org/jline/reader/Candidate.java

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002-2019, the original author or authors.
2+
* Copyright (c) 2002-2019, 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.
@@ -47,7 +47,15 @@ public Candidate(String value) {
4747
* @param complete the complete flag
4848
* @param sort the sort flag
4949
*/
50-
public Candidate(String value, String displ, String group, String descr, String suffix, String key, boolean complete, int sort) {
50+
public Candidate(
51+
String value,
52+
String displ,
53+
String group,
54+
String descr,
55+
String suffix,
56+
String key,
57+
boolean complete,
58+
int sort) {
5159
this.value = Objects.requireNonNull(value);
5260
this.displ = Objects.requireNonNull(displ);
5361
this.group = group;
@@ -69,7 +77,8 @@ public Candidate(String value, String displ, String group, String descr, String
6977
* @param key the key
7078
* @param complete the complete flag
7179
*/
72-
public Candidate(String value, String displ, String group, String descr, String suffix, String key, boolean complete) {
80+
public Candidate(
81+
String value, String displ, String group, String descr, String suffix, String key, boolean complete) {
7382
this(value, displ, group, descr, suffix, key, complete, 0);
7483
}
7584

@@ -159,11 +168,10 @@ public int sort() {
159168
return sort;
160169
}
161170

162-
163171
@Override
164172
public int compareTo(Candidate o) {
165173
// If both candidates have same sort, use default behavior
166-
if( sort == o.sort() ) {
174+
if (sort == o.sort()) {
167175
return value.compareTo(o.value);
168176
} else {
169177
return Integer.compare(sort, o.sort());
@@ -180,7 +188,7 @@ public boolean equals(Object o) {
180188

181189
@Override
182190
public int hashCode() {
183-
return Objects.hash(value);
191+
return Objects.hashCode(value);
184192
}
185193

186194
@Override

src/jdk.internal.le/share/classes/jdk/internal/org/jline/reader/Completer.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002-2018, the original author or authors.
2+
* Copyright (c) 2002-2018, 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.
@@ -18,8 +18,7 @@
1818
* @author <a href="mailto:[email protected]">Guillaume Nodet</a>
1919
* @since 2.3
2020
*/
21-
public interface Completer
22-
{
21+
public interface Completer {
2322
/**
2423
* Populates <i>candidates</i> with a list of possible completions for the <i>command line</i>.
2524
*

src/jdk.internal.le/share/classes/jdk/internal/org/jline/reader/CompletingParsedLine.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002-2018, the original author or authors.
2+
* Copyright (c) 2002-2018, 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.
@@ -10,7 +10,7 @@
1010

1111
/**
1212
* An extension of {@link ParsedLine} that, being aware of the quoting and escaping rules
13-
* of the {@link jdk.internal.org.jline.reader.Parser} that produced it, knows if and how a completion candidate
13+
* of the {@link org.jline.reader.Parser} that produced it, knows if and how a completion candidate
1414
* should be escaped/quoted.
1515
*
1616
* @author Eric Bottard
@@ -22,5 +22,4 @@ public interface CompletingParsedLine extends ParsedLine {
2222
int rawWordCursor();
2323

2424
int rawWordLength();
25-
2625
}

src/jdk.internal.le/share/classes/jdk/internal/org/jline/reader/CompletionMatcher.java

Lines changed: 8 additions & 4 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.
@@ -23,8 +23,13 @@ public interface CompletionMatcher {
2323
* @param errors number of errors accepted in matching
2424
* @param originalGroupName value of JLineReader variable original-group-name
2525
*/
26-
void compile(Map<LineReader.Option, Boolean> options, boolean prefix, CompletingParsedLine line
27-
, boolean caseInsensitive, int errors, String originalGroupName);
26+
void compile(
27+
Map<LineReader.Option, Boolean> options,
28+
boolean prefix,
29+
CompletingParsedLine line,
30+
boolean caseInsensitive,
31+
int errors,
32+
String originalGroupName);
2833

2934
/**
3035
*
@@ -44,5 +49,4 @@ void compile(Map<LineReader.Option, Boolean> options, boolean prefix, Completing
4449
* @return a common prefix of matched candidates
4550
*/
4651
String getCommonPrefix();
47-
4852
}

src/jdk.internal.le/share/classes/jdk/internal/org/jline/reader/EOFError.java

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,10 @@
11
/*
2-
* Licensed to the Apache Software Foundation (ASF) under one
3-
* or more contributor license agreements. See the NOTICE file
4-
* distributed with this work for additional information
5-
* regarding copyright ownership. The ASF licenses this file
6-
* to you under the Apache License, Version 2.0 (the
7-
* "License"); you may not use this file except in compliance
8-
* with the License. You may obtain a copy of the License at
2+
* Copyright (c) 2023, the original author(s).
93
*
10-
* http://www.apache.org/licenses/LICENSE-2.0
4+
* This software is distributable under the BSD license. See the terms of the
5+
* BSD license in the documentation provided with this software.
116
*
12-
* Unless required by applicable law or agreed to in writing,
13-
* software distributed under the License is distributed on an
14-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15-
* KIND, either express or implied. See the License for the
16-
* specific language governing permissions and limitations
17-
* under the License.
7+
* https://opensource.org/licenses/BSD-3-Clause
188
*/
199
package jdk.internal.org.jline.reader;
2010

@@ -45,7 +35,7 @@ public String getMissing() {
4535
return missing;
4636
}
4737

48-
public int getOpenBrackets(){
38+
public int getOpenBrackets() {
4939
return openBrackets;
5040
}
5141

src/jdk.internal.le/share/classes/jdk/internal/org/jline/reader/Editor.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002-2019, the original author or authors.
2+
* Copyright (c) 2002-2019, 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.
@@ -13,6 +13,8 @@
1313

1414
public interface Editor {
1515
public void open(List<String> files) throws IOException;
16+
1617
public void run() throws IOException;
18+
1719
public void setRestricted(boolean restricted);
1820
}

0 commit comments

Comments
 (0)