Way to statically initialize a class before or during MethodHandle creation, Unsafe crashes JVM
Jochen Theodorou
blackdrag at gmx.org
Mon Nov 19 03:20:59 PST 2012
Am 16.11.2012 20:43, schrieb Jochen Theodorou:
> Am 16.11.2012 17:31, schrieb Remi Forax:
> [...]
>> <clinit> is called the first time you call a constructor, a static
>> method or get/set the value of a static field.
>
> Remi I am aware of that, but I cannot simply call a static method, or
> create an instance of a class that I don't know. As for a static
> field... that might be save actually, only... what if there is no static
> field? The example I gave has three at least, but the class could have
> been written in Java, then there would be no such field and I still need
> that information from after cinit.
>
> I am looking of course for a general purpose solution here....
seems like Class.forName in the long form is the best for me.
bye Jochen
--
Jochen "blackdrag" Theodorou - Groovy Project Tech Lead
blog: http://blackdragsview.blogspot.com/
german groovy discussion newsgroup: de.comp.lang.misc
For Groovy programming sources visit http://groovy-lang.org
More information about the mlvm-dev
mailing list