misc cleanup
[fanfix.git] / src / jexer / tterminal / ECMA48.java
index ce3570b43cdb0b60718171d3b2f797abfcb967e4..a4197fb9f20557e31b1a9d6c8cf024244153467b 100644 (file)
@@ -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')) {
@@ -2662,7 +2663,7 @@ public class ECMA48 implements Runnable {
         }
 
         if (ch == ';') {
-            csiParams.add(new Integer(0));
+            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) {