Quantcast

[grails-dev] current work on the compilers resolve code

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[grails-dev] current work on the compilers resolve code

Jochen Theodorou
Hi all

during my work on the compiler I had a rethinking about
http://jira.codehaus.org/browse/GRAILS-4

I stumbled over the same NoClassDefFoundException in combination with
static mehods, but now I can explain it. a static method call is done
with these arguments: String name, String method, Object[] arguments.
name is the name of the class used to make the call on. As we need a
class to actually do the call the Invoker asks the classloader to load
the class for that name. That alone might be ok, but the classloader
used for this is the classloader used to load the Invoker class!
normally this isn't the same ClassLoader that is used to create the
script. This *has to* fail in most cases. A compiler side colution is
not to use the static method call, but to use the normal method call and
let it call on class. That is working in current groovy. And my next
commit for groovy will ensure that for now.

so sorry for the big time it took, but look forward to patch very soon.
I hope I can make it till sunday. The patch is in the endphase, but due
to the fundamental structure changes I made I have many corner cases to
debug. Also you can look forward into a file that does resolve all types
used in a script and that does compile scripts of these types if needed.
I am also (nearly) sure no compilation errors are swallowed any more.

end of status report

bye blackdrag
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [grails-dev] current work on the compilers resolve code

graemer
Thanks for the update Jochen and all the hard work you're putting in
it is much appreciated! :-)

Sounds like a problem I encountered with static methods at work
actually, so it should solve my work-related issues to

Cheers,
Graeme

On 09/11/05, Jochen Theodorou <[hidden email]> wrote:

> Hi all
>
> during my work on the compiler I had a rethinking about
> http://jira.codehaus.org/browse/GRAILS-4
>
> I stumbled over the same NoClassDefFoundException in combination with
> static mehods, but now I can explain it. a static method call is done
> with these arguments: String name, String method, Object[] arguments.
> name is the name of the class used to make the call on. As we need a
> class to actually do the call the Invoker asks the classloader to load
> the class for that name. That alone might be ok, but the classloader
> used for this is the classloader used to load the Invoker class!
> normally this isn't the same ClassLoader that is used to create the
> script. This *has to* fail in most cases. A compiler side colution is
> not to use the static method call, but to use the normal method call and
> let it call on class. That is working in current groovy. And my next
> commit for groovy will ensure that for now.
>
> so sorry for the big time it took, but look forward to patch very soon.
> I hope I can make it till sunday. The patch is in the endphase, but due
> to the fundamental structure changes I made I have many corner cases to
> debug. Also you can look forward into a file that does resolve all types
> used in a script and that does compile scripts of these types if needed.
> I am also (nearly) sure no compilation errors are swallowed any more.
>
> end of status report
>
> bye blackdrag
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [grails-dev] current work on the compilers resolve code

Steven Devijver-2
In reply to this post by Jochen Theodorou
Hey Jochen,

Thanks for fixing this problem man. This has been a big nutcracker  
for me, it did kind of shattered my dreams of doing dynamic static  
methods in Grails. If you can get this fixed we're going to rule the  
world.


Steven



On 09 Nov 2005, at 23:54, Jochen Theodorou wrote:

> Hi all
>
> during my work on the compiler I had a rethinking about http://
> jira.codehaus.org/browse/GRAILS-4
>
> I stumbled over the same NoClassDefFoundException in combination  
> with static mehods, but now I can explain it. a static method call  
> is done with these arguments: String name, String method, Object[]  
> arguments. name is the name of the class used to make the call on.  
> As we need a class to actually do the call the Invoker asks the  
> classloader to load the class for that name. That alone might be  
> ok, but the classloader used for this is the classloader used to  
> load the Invoker class! normally this isn't the same ClassLoader  
> that is used to create the script. This *has to* fail in most  
> cases. A compiler side colution is not to use the static method  
> call, but to use the normal method call and let it call on class.  
> That is working in current groovy. And my next commit for groovy  
> will ensure that for now.
>
> so sorry for the big time it took, but look forward to patch very  
> soon. I hope I can make it till sunday. The patch is in the  
> endphase, but due to the fundamental structure changes I made I  
> have many corner cases to debug. Also you can look forward into a  
> file that does resolve all types used in a script and that does  
> compile scripts of these types if needed. I am also (nearly) sure  
> no compilation errors are swallowed any more.
>
> end of status report
>
> bye blackdrag

Loading...