<< Back to previous view

[CLJ-1034] "Conflicting data-reader mapping" triggered when the same data_readers.clj is on the classpath twice Created: 26/Jul/12  Updated: 01/Sep/12  Resolved: 01/Sep/12

Status: Closed
Project: Clojure
Component/s: None
Affects Version/s: None
Fix Version/s: Release 1.5

Type: Defect Priority: Minor
Reporter: Phil Hagelberg Assignee: Unassigned
Resolution: Completed Votes: 10
Labels: None

Attachments: File clj_1034_data_readers_fix.diff    
Approval: Ok


If you have two data_readers.clj files on the classpath that agree with one another about the mapping of a given literal, Clojure still claims there is a conflict.

Comment by Justin Kramer [ 13/Aug/12 9:59 AM ]

This comes up when using checkout dependencies in Leiningen. If the checked-out project contains data_readers.clj, Clojure will throw an exception.

To reproduce:

user=> (spit "/tmp/data_readers.clj" "{foo/bar foo.core/bar}")
user=> (with-redefs [clojure.core/data-reader-urls (constantly [(java.net.URL. "file:/tmp/data_readers.clj")])] (#'clojure.core/load-data-readers))
{foo/bar #'foo.core/bar}
user=> (with-redefs [clojure.core/data-reader-urls (constantly [(java.net.URL. "file:/tmp/data_readers.clj")])] (#'clojure.core/load-data-readers))
ExceptionInfo Conflicting data-reader mapping clojure.core/ex-info (core.clj:4227)

Comment by Justin Kramer [ 13/Aug/12 10:21 AM ]

Attached clj_1034_data_readers_fix.diff with simple fix: checks that new mappings actually point to different vars before claiming a conflict.

Generated at Mon Sep 25 03:08:31 CDT 2017 using JIRA 4.4#649-r158309.