Re: unreflectGetter and static class initialization

2012-10-30 Thread Remi Forax
On 10/30/2012 09:59 AM, Jochen Theodorou wrote: > Am 29.10.2012 17:29, schrieb Remi Forax: > [...] >> In my opinion, the best is to use Unsafe.ensureClassInitialized() the >> first time you call the BSM, it should be enough. > That one I did not know so far, interesting. My current work around is >

Re: unreflectGetter and static class initialization

2012-10-30 Thread Jochen Theodorou
Am 29.10.2012 22:13, schrieb Christian Thalinger: [...] > What version of Groovy uses JSR 292? starting Groovy 2.0 you can enable invokedynamic. Though I use it only for method calls there and the implementation has still many quirks. Soon we will release Groovy 2.1, in which invokedynamic will

Re: unreflectGetter and static class initialization

2012-10-30 Thread Jochen Theodorou
Am 29.10.2012 17:29, schrieb Remi Forax: [...] > In my opinion, the best is to use Unsafe.ensureClassInitialized() the > first time you call the BSM, it should be enough. That one I did not know so far, interesting. My current work around is to go with the fallback internal old MOP path... which

Re: unreflectGetter and static class initialization

2012-10-30 Thread Jochen Theodorou
Am 29.10.2012 17:03, schrieb Christian Thalinger: [...] > ...or move to JDK 8 until 7u with an updated 292 is released. Doesn't > the NoClassDefFoundError bite you anyway? you want me earnestly to tell the Groovy users that invokedynamic on JDK7 is useless ;) It is difficult enough to let people

Re: unreflectGetter and static class initialization

2012-10-29 Thread Guillaume Laforge
Hi Christian, On Mon, Oct 29, 2012 at 10:13 PM, Christian Thalinger < christian.thalin...@oracle.com> wrote: > [...] > > I'm sure that Jochen will be happy to move to jdk8 but I'm also sure > > that all Groovy users will not be happy to do the same :) > > What version of Groovy uses JSR 292? > G

Re: unreflectGetter and static class initialization

2012-10-29 Thread Christian Thalinger
On Oct 29, 2012, at 9:29 AM, Remi Forax wrote: > On 10/29/2012 05:03 PM, Christian Thalinger wrote: >> >> On Oct 24, 2012, at 3:32 PM, John Rose > > wrote: >> >>> On Oct 24, 2012, at 1:08 PM, Jochen Theodorou wrote: >>> what do you suggest as workaround? >>

Re: unreflectGetter and static class initialization

2012-10-29 Thread Remi Forax
On 10/29/2012 05:45 PM, Julien Ponge wrote: > I once heard that there might me plans to push Unsafe to the public APIs... > Does anybody have informations about this? sun.misc.Unsafe is already supported by a lot of Java compatible (or not) environment, so it's a kind of de facto standard. Now,

Re: unreflectGetter and static class initialization

2012-10-29 Thread Julien Ponge
I once heard that there might me plans to push Unsafe to the public APIs... Does anybody have informations about this? - Julien Le 29 oct. 2012 à 17:29, Remi Forax a écrit : > On 10/29/2012 05:03 PM, Christian Thalinger wrote: >> >> On Oct 24, 2012, at 3:32 PM, John Rose >

Re: unreflectGetter and static class initialization

2012-10-29 Thread Remi Forax
On 10/29/2012 05:03 PM, Christian Thalinger wrote: > > On Oct 24, 2012, at 3:32 PM, John Rose > wrote: > >> On Oct 24, 2012, at 1:08 PM, Jochen Theodorou wrote: >> >>> what do you suggest as workaround? >> >> You could force the class to be initialized when the MH is

Re: unreflectGetter and static class initialization

2012-10-29 Thread Christian Thalinger
On Oct 24, 2012, at 3:32 PM, John Rose wrote: > On Oct 24, 2012, at 1:08 PM, Jochen Theodorou wrote: > >> what do you suggest as workaround? > > You could force the class to be initialized when the MH is created. This can > be done with Class.forName. It would not exactly give you the seman

Re: unreflectGetter and static class initialization

2012-10-24 Thread John Rose
On Oct 24, 2012, at 1:08 PM, Jochen Theodorou wrote: > what do you suggest as workaround? You could force the class to be initialized when the MH is created. This can be done with Class.forName. It would not exactly give you the semantics you want, since the init would happen early. Or, you

Re: unreflectGetter and static class initialization

2012-10-24 Thread Jochen Theodorou
Am 24.10.2012 21:50, schrieb John Rose: [...] > > Yes, it's a bug, and there is a fix for this integrated into JDK8: > http://hg.openjdk.java.net/jdk8/jdk8/jdk/log?rev=7023639 what do you suggest as workaround? bye Jochen ___ mlvm-dev mailing list mlvm

Re: unreflectGetter and static class initialization

2012-10-24 Thread John Rose
On Oct 24, 2012, at 12:16 PM, Jochen Theodorou wrote: > while working routing property access in Groovy through invokedynamic I > stumbled upon one confusing part... If I have a static field and use > Lookup#unreflectGetter to get a handle and then execute that handle, > then it seems as if the

unreflectGetter and static class initialization

2012-10-24 Thread Jochen Theodorou
Hi, while working routing property access in Groovy through invokedynamic I stumbled upon one confusing part... If I have a static field and use Lookup#unreflectGetter to get a handle and then execute that handle, then it seems as if the class containing that field is not initialized. If I fir