mirror of
https://github.com/stleary/JSON-java.git
synced 2025-08-06 04:45:34 -04:00
Make nextString throw a JSONException instead of a NumberFormatException for malformed input.
This commit is contained in:
parent
612dafc750
commit
dfa651e777
@ -278,7 +278,11 @@ public class JSONTokener {
|
|||||||
sb.append('\r');
|
sb.append('\r');
|
||||||
break;
|
break;
|
||||||
case 'u':
|
case 'u':
|
||||||
sb.append((char)Integer.parseInt(this.next(4), 16));
|
try {
|
||||||
|
sb.append((char)Integer.parseInt(this.next(4), 16));
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
throw this.syntaxError("Illegal escape.");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case '"':
|
case '"':
|
||||||
case '\'':
|
case '\'':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user