Skip to content

Commit

Permalink
JDK9 compatibility: removing explicit boxing, #48
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Nov 21, 2016
1 parent c768abb commit 12e5b85
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ public void write(int data) throws IOException {
} else if (';' == data) {
options.add(null);
} else if ('?' == data) {
options.add(new Character('?'));
options.add('?');
} else if ('=' == data) {
options.add(new Character('='));
options.add('=');
} else {
reset(processEscapeCommand(options, data));
}
Expand All @@ -107,7 +107,7 @@ public void write(int data) throws IOException {
buffer[pos++] = (byte) data;
if (!('0' <= data && data <= '9')) {
String strValue = new String(buffer, startOfValue, (pos - 1) - startOfValue, "UTF-8");
Integer value = new Integer(strValue);
Integer value = Integer.parseInt(strValue);
options.add(value);
if (data == ';') {
state = LOOKING_FOR_NEXT_ARG;
Expand Down Expand Up @@ -144,7 +144,7 @@ public void write(int data) throws IOException {
buffer[pos++] = (byte) data;
if (';' == data) {
String strValue = new String(buffer, startOfValue, (pos - 1) - startOfValue, "UTF-8");
Integer value = new Integer(strValue);
Integer value = Integer.parseInt(strValue);
options.add(value);
startOfValue = pos;
state = LOOKING_FOR_OSC_PARAM;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public void write(int data) throws IOException {
buffer[pos++] = (byte) data;
if (!('0' <= data && data <= '9')) {
String strValue = new String(buffer, startOfValue, (pos - 1) - startOfValue, "UTF-8");
Integer value = new Integer(strValue);
Integer value = Integer.parseInt(strValue);
options.add(value);
if (data == ';') {
state = LOOKING_FOR_NEXT_ARG;
Expand Down Expand Up @@ -223,7 +223,7 @@ public void write(int data) throws IOException {
buffer[pos++] = (byte) data;
if (';' == data) {
String strValue = new String(buffer, startOfValue, (pos - 1) - startOfValue, "UTF-8");
Integer value = new Integer(strValue);
Integer value = Integer.parseInt(strValue);
options.add(value);
startOfValue = pos;
state = LOOKING_FOR_OSC_PARAM;
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/org/jline/example/PasswordReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public static void main(String[] args) throws IOException {
.terminal(terminal).build();

Character mask = (args.length == 0)
? new Character((char) 0)
: new Character(args[0].charAt(0));
? (char) 0
: args[0].charAt(0);

String line;
do {
Expand Down

0 comments on commit 12e5b85

Please sign in to comment.