Skip to content

Commit 0768f8e

Browse files
author
Jeff Valk
committed
Further improve dynamic classpath modification robustness
When setting the context classloader, set this to newly created DynamicClassLoader, then modify the highest visible modifiable ancestor. The previous code, introduced in e3de281, set the context classloader to the highest modifiable ancestor. This worked when launching via the `clojure` executable, but caused visibility problems when launching with `lein`.
1 parent bb3042f commit 0768f8e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/orchard/java/classpath.clj

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@
7171
ensuring that a modifiable classloader is available."
7272
[^URL url]
7373
(let [loader (or (modifiable-classloader)
74-
(set-classloader!
75-
(modifiable-classloader (clojure.lang.DynamicClassLoader.
76-
(clojure.lang.RT/baseLoader)))))]
74+
(modifiable-classloader
75+
(set-classloader! (clojure.lang.DynamicClassLoader.
76+
(clojure.lang.RT/baseLoader)))))]
7777
(when (dp/add-classpath-url loader url)
7878
url)))
7979

0 commit comments

Comments
 (0)