From 09d6fafb09462ab4c7f9a46e6a478f893907e529 Mon Sep 17 00:00:00 2001 From: Alex Miller Date: Wed, 27 Nov 2024 14:32:21 -0600 Subject: [PATCH] DJSON-56 - in nextToken let invalid char < 32 flow out to specific parsers for better errors --- README.md | 3 +++ src/main/clojure/clojure/data/json.clj | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3503642..fe17344 100644 --- a/README.md +++ b/README.md @@ -150,6 +150,8 @@ Developer Information Change Log ---------------------------------------- +* Next + * Fix: [DJSON-56] During `read`, better error messages for chars < 32 * Release [2.5.1] on 2024-Nov-26 * Fix: `read` of JSON number followed by EOF can break subsequent read on supplier PBR from seeing EOF * Fix: `read` docstring updated to specify minimum buffer size when PushbackReader supplied (64) @@ -251,6 +253,7 @@ Change Log [DJSON-61]: https://clojure.atlassian.net/browse/DJSON-61 [DJSON-57]: https://clojure.atlassian.net/browse/DJSON-57 +[DJSON-56]: https://clojure.atlassian.net/browse/DJSON-56 [DJSON-54]: https://clojure.atlassian.net/browse/DJSON-54 [DJSON-53]: https://clojure.atlassian.net/browse/DJSON-53 [DJSON-52]: https://clojure.atlassian.net/browse/DJSON-52 diff --git a/src/main/clojure/clojure/data/json.clj b/src/main/clojure/clojure/data/json.clj index 2eb1588..8afcd14 100644 --- a/src/main/clojure/clojure/data/json.clj +++ b/src/main/clojure/clojure/data/json.clj @@ -330,7 +330,7 @@ (int c) (codepoint-case (int c) :whitespace (recur (.readChar stream)) - -1 -1)))) + c)))) (defn invalid-array-exception [] (Exception. "JSON error (invalid array)"))