From 0b53bcc87ad3563daedaa64306d0bbe6df01ca49 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 6 May 2018 10:42:34 -0400 Subject: - 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. --- stdlib/source/lux/host.jvm.lux | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'stdlib') 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)) -- cgit v1.2.3