private IllegalArgumentException error(String message) { return PatternUtils.error(message, tokens, current); }
private IllegalArgumentException error(String message) { return PatternUtils.error(message, tokens, current); }
@SuppressWarnings("PMD.PreserveStackTrace") private static char parse(String num, int radix, String mode, String str, int pos) { try { return (char) Integer.parseInt(num, radix); } catch (NumberFormatException e) { throw error("invalid " + mode + " escape sequence", str, pos); } }
@SuppressWarnings("PMD.PreserveStackTrace") private static char parse(String num, int radix, String mode, String str, int pos) { try { return (char) Integer.parseInt(num, radix); } catch (NumberFormatException e) { throw error("invalid " + mode + " escape sequence", str, pos); } }
++i; if (i >= str.length()) { throw error("dangling escape", str, i); throw error("invalid octal escape sequence", str, i); case 'x': if (i + 3 > str.length()) { throw error("invalid hexadecimal escape sequence", str, i); case 'u': if (i + 5 > str.length()) { throw error("invalid unicode escape sequence", str, i);
++i; if (i >= str.length()) { throw error("dangling escape", str, i); throw error("invalid octal escape sequence", str, i); case 'x': if (i + 3 > str.length()) { throw error("invalid hexadecimal escape sequence", str, i); case 'u': if (i + 5 > str.length()) { throw error("invalid unicode escape sequence", str, i);