aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source
diff options
context:
space:
mode:
authorEduardo Julian2018-05-06 10:42:34 -0400
committerEduardo Julian2018-05-06 10:42:34 -0400
commit0b53bcc87ad3563daedaa64306d0bbe6df01ca49 (patch)
treeaa901037cc4414ce8696d9f0c38b8f5ab4ff3d91 /stdlib/source
parente65e734e5df3746ffb7df2cc9fa33826e0083fcd (diff)
- When loading classes in "lux/host.jvm.lux" using "java.lang,Class::forName", now using the 3-arg variant of that method to avoid initializing the class when loading it. It helps avoid some problems later on.
Diffstat (limited to 'stdlib/source')
-rw-r--r--stdlib/source/lux/host.jvm.lux3
1 files changed, 2 insertions, 1 deletions
diff --git a/stdlib/source/lux/host.jvm.lux b/stdlib/source/lux/host.jvm.lux
index 8bc565545..fea1a108e 100644
--- a/stdlib/source/lux/host.jvm.lux
+++ b/stdlib/source/lux/host.jvm.lux
@@ -1841,7 +1841,8 @@
(def: (load-class class-name)
(-> Text (Either Text (primitive "java.lang.Class" [(Ex [a] a)])))
- (try ("jvm invokestatic:java.lang.Class:forName:java.lang.String" class-name)))
+ (let [system-class-loader ("jvm invokestatic:java.lang.ClassLoader:getSystemClassLoader:")]
+ (try ("jvm invokestatic:java.lang.Class:forName:java.lang.String,boolean,java.lang.ClassLoader" class-name false system-class-loader))))
(def: (class-kind [class-name _])
(-> Class-Declaration (Meta Class-Kind))