if (sf.isSignedNumeric() && sb.charAt(sb.length() - 1) == '-') {
if (sf.isSignedNumeric() && sb.length() > 0 && sb.charAt(sb.length() - 1) == '-') {
   protected void readFormatTable(ByteArrayOutputStream baosp,int readType,                                    CodePage codePage) {      ScreenField sf;      boolean isSigned = false;      char c;      if (masterMDT) {         StringBuffer sb = new StringBuffer();         for (int x = 0; x < sizeFields; x++) {            isSigned = false;            sf = screenFields[x];            if (sf.mdt || (readType == CMD_READ_INPUT_FIELDS)) {               sb.setLength(0);               sb.append(sf.getText());               if (readType == CMD_READ_MDT_FIELDS ||                     readType == CMD_READ_MDT_IMMEDIATE_ALT) {                  int len = sb.length() - 1;                  // we strip out all '\u0020' and less                  while (len >= 0 &&                     (sb.charAt(len) <= ' ' || sb.charAt(len) >= '\uff20' )) {                     sb.deleteCharAt(len--);                  }               }//               System.out.println("field " + sf.toString());//               System.out.println(">" + sb.toString() + "<");//               System.out.println(" field is all nulls");               if (sf.isSignedNumeric() && sb.charAt(sb.length() - 1) == '-') {                  isSigned = true;                  sb.setLength(sb.length() - 1);               }               int len3 = sb.length();               if (len3 > 0 || (readType == CMD_READ_MDT_FIELDS ||                       readType == CMD_READ_MDT_IMMEDIATE_ALT)) {                  if ((readType == CMD_READ_MDT_FIELDS ||                       readType == CMD_READ_MDT_IMMEDIATE_ALT)) {                     baosp.write(17);   // start of field data                     baosp.write(sf.startRow()+1);                     baosp.write(sf.startCol()+1);                  }//                  int len = sb.length();                  for (int k = 0; k < len3; k++) {                     c = sb.charAt(k);                     // here we have to check for special instances of the                     //    characters in the string field.  Attribute bytes                     //    are encoded with an offset of \uff00                     //    This is a hack !!!!!!!!!!!                     //    See ScreenField object for a description                     if (c < ' ' || c >= '\uff20') {                        // if it is an offset attribute byte we just pass                        //    it straight on to the output stream                        if (c >= '\uff20' && c <= '\uff3f') {                           baosp.write(c - '\uff00');                        }                        else                           baosp.write(codePage.getEBCDIC(' '));                     }                     else {                        if (isSigned && k == len3 - 1) {                           baosp.write(0xd0 | (0x0f & c));                        }                        else                           baosp.write(codePage.uni2ebcdic(c));                     }                  }               }            }         }      }   }