Clojure-Contrib

Bug in clojure.contrib.json/read-json

Details

  • Type: Defect Defect
  • Status: In Progress In Progress
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

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:

(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

Activity

Hide
Rasmus Svensson added a comment -

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

Show
Rasmus Svensson added a comment - Could this be a duplicate of http://dev.clojure.org/jira/browse/CONTRIB-91 ?
Hide
Anthony Simpson added a comment -

This appears to no longer be applicable.

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

Show
Anthony Simpson added a comment - This appears to no longer be applicable. Clojure 1.3.0-master-SNAPSHOT user=> (require 'clojure.contrib.json) nil user=> (clojure.contrib.json/read-json "") EOFException JSON error (end-of-file) clojure.contrib.json/read-json-reader (json.clj:115)
Hide
Assembla Importer added a comment -
Show
Assembla Importer added a comment - Converted from http://www.assembla.com/spaces/clojure/tickets/99

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated: