Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Remove reflection warnings #2

Open
wants to merge 1 commit into from

1 participant

Hugo Duncan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 23, 2013
  1. Hugo Duncan
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 7 deletions.
  1. +3 −2 src/dynapath/defaults.clj
  2. +5 −5 src/dynapath/util.clj
5 src/dynapath/defaults.clj
View
@@ -10,7 +10,8 @@
`(do ~@body)))
(let [base-url-classloader (assoc base-readable-addable-classpath
- :classpath-urls #(seq (.getURLs %)))]
+ :classpath-urls #(seq
+ (.getURLs ^URLClassLoader %)))]
(extend URLClassLoader
DynamicClasspath
(assoc base-url-classloader
@@ -23,7 +24,7 @@
(extend DynamicClassLoader
DynamicClasspath
(assoc base-url-classloader
- :add-classpath-url (fn [cl url]
+ :add-classpath-url (fn [^DynamicClassLoader cl url]
(.addURL cl url))))
(when-resolves sun.misc.Launcher
10 src/dynapath/util.clj
View
@@ -27,11 +27,11 @@ If no ClassLoader is provided, RT/baseLoader is assumed."
([]
(all-classpath-urls (clojure.lang.RT/baseLoader)))
([cl]
- (->> (iterate #(.getParent %) cl)
- (take-while identity)
- reverse
- (mapcat classpath-urls)
- distinct)))
+ (->> (iterate #(.getParent ^ClassLoader %) cl)
+ (take-while identity)
+ reverse
+ (mapcat classpath-urls)
+ distinct)))
(defn add-classpath-url
"Attempts to add a url to the given ClassLoader, returning true on success.
Something went wrong with that request. Please try again.