Clojure

clojure.java.io URL Coercion throws java.lang.ClassCastException

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: Release 1.3
  • Component/s: None
  • 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

Activity

Hide
Assembla Importer added a comment -
Show
Assembla Importer added a comment - stu said: [file:cK6UTSZw4r345CeJe5cbLA]
Hide
Assembla Importer added a comment -

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

Show
Assembla Importer added a comment - stu said: Updating tickets (#139, #278, #285, #368, #443, #430)
Hide
Assembla Importer added a comment -

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

Show
Assembla Importer added a comment - stu said: Updating tickets (#139, #278, #285, #368, #443, #430)

People

  • Assignee:
    Unassigned
    Reporter:
    Anonymous
Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: