Bug in clojure.contrib.json/read-json
Pulled this from clojure assembla ticket #436 to clojure-contrib
See clojure-436
What (small set of) steps will reproduce the problem?
$ java -cp lib/clojure-1.2.0.jar:lib/clojure-contrib-1.2.0.jar clojure.main
Clojure 1.2.0
user=> (require 'clojure.contrib.json)
nil
user=> (clojure.contrib.json/read-json "")
java.lang.IllegalArgumentException: Value out of range for char: -1 (NO_SOURCE_FILE:0)
user=>
What is the expected output? What do you see instead?
Expected:
What version are you using?
1.2
Was this discussed on the group? If so, please provide a link to the discussion
[13:51] <_na_ka_na_> Hey guys I think there's a bug in clojure.contrib.json at line 116
[13:51] <_na_ka_na_> in clojure 1.2
[13:52] <_na_ka_na_> it has a (char i) and then checks for (= i -1) ... but (char -1) fails
[13:52] <_na_ka_na_> where can I report it ?
[13:53] <LauJensen> _na_ka_na_: assembla/support
See clojure-436
What (small set of) steps will reproduce the problem?
$ java -cp lib/clojure-1.2.0.jar:lib/clojure-contrib-1.2.0.jar clojure.main
Clojure 1.2.0
user=> (require 'clojure.contrib.json)
nil
user=> (clojure.contrib.json/read-json "")
java.lang.IllegalArgumentException: Value out of range for char: -1 (NO_SOURCE_FILE:0)
user=>
What is the expected output? What do you see instead?
Expected:
(if eof-error?
(throw (EOFException. "JSON error (end-of-file)"))
eof-value)
What version are you using?
1.2
Was this discussed on the group? If so, please provide a link to the discussion
[13:51] <_na_ka_na_> Hey guys I think there's a bug in clojure.contrib.json at line 116
[13:51] <_na_ka_na_> in clojure 1.2
[13:52] <_na_ka_na_> it has a (char i) and then checks for (= i -1) ... but (char -1) fails
[13:52] <_na_ka_na_> where can I report it ?
[13:53] <LauJensen> _na_ka_na_: assembla/support
Leave a comment
on 2010-10-18 15:20 *
By AnthonySimpson
Assigned to set to AnthonySimpson
Status changed from New to Accepted