<< Back to previous view

[CONTRIB-99] Bug in clojure.contrib.json/read-json Created: 01/Oct/10  Updated: 26/Jan/11

Status: In Progress
Project: Clojure-Contrib
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect
Reporter: Anonymous Assignee: Anthony Simpson
Resolution: Unresolved Votes: 0
Labels: None


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)
user=> (clojure.contrib.json/read-json "")
java.lang.IllegalArgumentException: Value out of range for char: -1 (NO_SOURCE_FILE:0)

What is the expected output? What do you see instead?


(if eof-error?
  (throw (EOFException. "JSON error (end-of-file)"))

What version are you using?

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

Comment by Assembla Importer [ 19/Oct/10 12:20 AM ]

Converted from http://www.assembla.com/spaces/clojure/tickets/99

Comment by Anthony Simpson [ 06/Jan/11 7:05 PM ]

This appears to no longer be applicable.

Clojure 1.3.0-master-SNAPSHOT
user=> (require 'clojure.contrib.json)
user=> (clojure.contrib.json/read-json "")
EOFException JSON error (end-of-file) clojure.contrib.json/read-json-reader (json.clj:115)

Comment by Rasmus Svensson [ 26/Jan/11 6:26 AM ]

Could this be a duplicate of http://dev.clojure.org/jira/browse/CONTRIB-91 ?

Generated at Sat Mar 25 08:59:17 CDT 2017 using JIRA 4.4#649-r158309.