Welcome! Please see the About page for a little more info on how this works.

0 votes
in IO by

clojure.java.io/resource assumes the current Thread's context ClassLoader will be non-null. if the Thread's context ClassLoader is null then it NPEs

(resource n (.getContextClassLoader (Thread/currentThread)))

the javadocs indicate it may reasonably be null, and i'm seeing a case in the wild where it's non-null - https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#getContextClassLoader--

clojure.java.io/resource should perhaps default to using (ClassLoader/getSystemClassLoader) when the context ClassLoader is null

1 Answer

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJ-2431 (reported by alex+import)
...