Rémi Forax schrieb: > Jochen Theodorou a écrit : >> Rémi Forax schrieb: [...] > I don't clearly understand what is your problem. > MethodHandles are classes from java.dyn or sun.dyn and thus loaded by > the bootstrap classloader > so in my opinion, they will not have influence on Class.forName.
in an environment where there is only one loader anyway, there is no problem at all. But in case of running a groovy program from the command line, the bootstrap loader contains almost nothing. Almost all libs are loaded through a different loader and is below the bootstrap loader. So if Class.forName selects the bootstrap loader you will have all kinds of bad effects. Like for example a sql driver that cannot be found, but was added at runtime by manipulating the runtime classpath. *Our* loader then knows this one, but if Class.forName doesn't select it, it does not help. And I am also thinking about java standard deserialization here. That is very much fun with such a structure, especially since you have to subclass ObjectInputStream to let it know your classloader. so as long as Class#forName(String) does not select the classloader of the caller class, because some reflective or other layers are in between, it won't do. bye blackdrag -- Jochen "blackdrag" Theodorou The Groovy Project Tech Lead (http://groovy.codehaus.org) http://blackdragsview.blogspot.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "JVM Languages" group. To post to this group, send email to jvm-languages@googlegroups.com To unsubscribe from this group, send email to jvm-languages+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jvm-languages?hl=en -~----------~----~----~----~------~----~------~--~---