<< Back to previous view

[CLJ-430] clojure.java.io URL Coercion throws java.lang.ClassCastException Created: 02/Sep/10  Updated: 11/Oct/10  Resolved: 11/Oct/10

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

Type: Defect
Reporter: Anonymous Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None

Approval: Ok

 Description   

I noticed a bug in the clojure.java.io namespace at Line 57 in extend-protocol Coercions URL

URL
   (as-url [u] u)
   (as-file [u]
     (if (= "file" (.getProtocol u))
       (as-file (.getPath u))
--      (throw (IllegalArgumentException. "Not a file: " u))))
++      (throw (IllegalArgumentException. (str "Not a file: " u)))))
</code></pre>
Right now it throws the error:
<pre><code>
Caused by: java.lang.ClassCastException: java.net.URL cannot be cast to java.lang.Throwable
        at clojure.java.io $fn__7354.invoke(io.clj:56)
        at clojure.java.io $fn__7328$G__7323__7333.invoke(io.clj:34)

Clojure version: 1.2



 Comments   
Comment by Assembla Importer [ 11/Oct/10 2:25 PM ]

Converted from http://www.assembla.com/spaces/clojure/tickets/430
Attachments:
0430-java-io-url-coercion.patch - https://www.assembla.com/spaces/clojure/documents/cK6UTSZw4r345CeJe5cbLA/download/cK6UTSZw4r345CeJe5cbLA

Comment by Assembla Importer [ 11/Oct/10 2:25 PM ]

stu said: [file:cK6UTSZw4r345CeJe5cbLA]

Comment by Assembla Importer [ 11/Oct/10 2:25 PM ]

stu said: Updating tickets (#139, #278, #285, #368, #443, #430)

Comment by Assembla Importer [ 11/Oct/10 2:25 PM ]

stu said: Updating tickets (#139, #278, #285, #368, #443, #430)

Generated at Tue Sep 02 12:01:13 CDT 2014 using JIRA 4.4#649-r158309.