This code snippet blows up with a NullPointerException
public class TestClj {
public static void main(String[] args) throws Exception {
System.out.println( clojure.lang.Compiler.load(new
java.io.StringReader("42")) );
}
}
Exception in thread "main" java.lang.ExceptionInInitializerError
at clojure.lang.Namespace.<init>(Namespace.java:32)
at clojure.lang.Namespace.findOrCreate(Namespace.java:122)
at clojure.lang.Compiler.<clinit>(Compiler.java:181)
at TestClj.main(TestClj.java:4)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
at clojure.lang.RT.<clinit>(RT.java:295)
... 4 more
Caused by: java.lang.NullPointerException
at clojure.lang.RT.baseLoader(RT.java:1495)
at clojure.lang.RT.load(RT.java:377)
at clojure.lang.RT.load(RT.java:371)
at clojure.lang.RT.doInit(RT.java:406)
at clojure.lang.RT.<clinit>(RT.java:292)
... 4 more
This is caused by the fact that the static initializer for
Compiler.LOADER is getting initialized _after_ a few other static Vars
that call Namespace.findOrCreate, which assumes that Compiler.LOADER
has already been initialized.
The fix I found to work is by simply moving the definition of LOADER
just before the definition of SOURCE.
Can someone please fix this in master? (I would have just fixed it
myself, but I didn't know about the whole contributor agreement
stuff...)
Thanks,
Jonathan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---