src/jdk.jdi/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java

Print this page
rev 10552 : 8055723[core]: Replace concat String to append in StringBuilder parameters
Contributed-by: Otavio Santana <otaviojava@java.net>


  90           retval.append("\\n");
  91           continue;
  92         case '\f':
  93           retval.append("\\f");
  94           continue;
  95         case '\r':
  96           retval.append("\\r");
  97           continue;
  98         case '\"':
  99           retval.append("\\\"");
 100           continue;
 101         case '\'':
 102           retval.append("\\\'");
 103           continue;
 104         case '\\':
 105           retval.append("\\\\");
 106           continue;
 107         default:
 108           if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
 109             String s = "0000" + Integer.toString(ch, 16);
 110             retval.append("\\u" + s.substring(s.length() - 4, s.length()));
 111           } else {
 112             retval.append(ch);
 113           }
 114           continue;
 115       }
 116     }
 117     return retval.toString();
 118   }
 119 
 120   /**
 121    * Returns a detailed message for the Error when it is thrown by the
 122    * token manager to indicate a lexical error.
 123    * Parameters :
 124    *    EOFSeen     : indicates if EOF caused the lexical error
 125    *    curLexState : lexical state in which this error occurred
 126    *    errorLine   : line number when the error occurred
 127    *    errorColumn : column number when the error occurred
 128    *    errorAfter  : prefix that was seen before this error occurred
 129    *    curchar     : the offending character
 130    * Note: You can customize the lexical error message by modifying this method.




  90           retval.append("\\n");
  91           continue;
  92         case '\f':
  93           retval.append("\\f");
  94           continue;
  95         case '\r':
  96           retval.append("\\r");
  97           continue;
  98         case '\"':
  99           retval.append("\\\"");
 100           continue;
 101         case '\'':
 102           retval.append("\\\'");
 103           continue;
 104         case '\\':
 105           retval.append("\\\\");
 106           continue;
 107         default:
 108           if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
 109             String s = "0000" + Integer.toString(ch, 16);
 110             retval.append("\\u").append(s.substring(s.length() - 4, s.length()));
 111           } else {
 112             retval.append(ch);
 113           }
 114           continue;
 115       }
 116     }
 117     return retval.toString();
 118   }
 119 
 120   /**
 121    * Returns a detailed message for the Error when it is thrown by the
 122    * token manager to indicate a lexical error.
 123    * Parameters :
 124    *    EOFSeen     : indicates if EOF caused the lexical error
 125    *    curLexState : lexical state in which this error occurred
 126    *    errorLine   : line number when the error occurred
 127    *    errorColumn : column number when the error occurred
 128    *    errorAfter  : prefix that was seen before this error occurred
 129    *    curchar     : the offending character
 130    * Note: You can customize the lexical error message by modifying this method.