X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Ftterminal%2FECMA48.java;h=eb13c0b4d35e43176e86568a65e6ef936042b58f;hb=a39c5665a6cd98ce87de4075962b1af9dd53aa25;hp=ce3570b43cdb0b60718171d3b2f797abfcb967e4;hpb=978a5d8f650488c8840d54ccc3032599ca50a084;p=fanfix.git diff --git a/src/jexer/tterminal/ECMA48.java b/src/jexer/tterminal/ECMA48.java index ce3570b..eb13c0b 100644 --- a/src/jexer/tterminal/ECMA48.java +++ b/src/jexer/tterminal/ECMA48.java @@ -1114,7 +1114,7 @@ public class ECMA48 implements Runnable { private void resetTabStops() { tabStops.clear(); for (int i = 0; (i * 8) <= rightMargin; i++) { - tabStops.add(new Integer(i * 8)); + tabStops.add(Integer.valueOf(i * 8)); } } @@ -1629,6 +1629,7 @@ public class ECMA48 implements Runnable { * @param keypress keypress received from the local user * @return string to transmit to the remote side */ + @SuppressWarnings("fallthrough") private String keypressToString(final TKeypress keypress) { if ((fullDuplex == false) && (!keypress.isFnKey())) { @@ -2367,13 +2368,13 @@ public class ECMA48 implements Runnable { switch (currentState.glLockshift) { case G1_GR: - assert (false); + throw new IllegalArgumentException("programming bug"); case G2_GR: - assert (false); + throw new IllegalArgumentException("programming bug"); case G3_GR: - assert (false); + throw new IllegalArgumentException("programming bug"); case G2_GL: // LS2 @@ -2394,10 +2395,10 @@ public class ECMA48 implements Runnable { switch (currentState.grLockshift) { case G2_GL: - assert (false); + throw new IllegalArgumentException("programming bug"); case G3_GL: - assert (false); + throw new IllegalArgumentException("programming bug"); case G1_GR: // LS1R @@ -2652,7 +2653,7 @@ public class ECMA48 implements Runnable { */ private void param(final byte ch) { if (csiParams.size() == 0) { - csiParams.add(new Integer(0)); + csiParams.add(Integer.valueOf(0)); } Integer x = csiParams.get(csiParams.size() - 1); if ((ch >= '0') && (ch <= '9')) { @@ -2661,8 +2662,8 @@ public class ECMA48 implements Runnable { csiParams.set(csiParams.size() - 1, x); } - if (ch == ';') { - csiParams.add(new Integer(0)); + if ((ch == ';') && (csiParams.size() < 16)) { + csiParams.add(Integer.valueOf(0)); } } @@ -4094,12 +4095,12 @@ public class ECMA48 implements Runnable { if (collectBuffer.charAt(0) == '>') { extendedFlag = 1; if (collectBuffer.length() >= 2) { - i = Integer.parseInt(args.toString()); + i = Integer.parseInt(args); } } else if (collectBuffer.charAt(0) == '=') { extendedFlag = 2; if (collectBuffer.length() >= 2) { - i = Integer.parseInt(args.toString()); + i = Integer.parseInt(args); } } else { // Unknown code, bail out @@ -4541,7 +4542,7 @@ public class ECMA48 implements Runnable { args = collectBuffer.substring(0, collectBuffer.length() - 2); } - String [] p = args.toString().split(";"); + String [] p = args.split(";"); if (p.length > 0) { if ((p[0].equals("0")) || (p[0].equals("2"))) { if (p.length > 1) {