src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java

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


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




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