Am 26.09.2012 13:37, schrieb Steve Amerige:
> Hi Jochen (or do you prefer Blackdrag :-),
Jochen, blackdrag, theo... I am used to all of them ;)
> Thanks for your reply. My motivation for decompiling Groovy .class
> files is part of an internal training course that I'm preparing in which
> I can more clearly expose access details as they relate to the "private"
> and other modifiers as they are used on and within classes. Exposing
> access details for Groovy constructs such as "public", "private",
> "protected", the ".@" operator, the "@PackageScope" transformation,
> etc., can be helpful and I am thinking that looking at decompiled Groovy
> code might be useful in this regard.
but frankly I am not sure it is good to show the bytecode or the
decompiled code for this. Take for example a private method... Since
many of our calls go either through Reflection or through runtime
generated classes we don't call the private method directly. Instead our
custom call site caching will select a helper method this$... which is
marked as public and synthetic to make the call. In there you find a
direct method call. But the call to the private method may not be
direct. If it really goes through our custom callsite caching you see
only something like getCallSiteArray[x].invoke(), where x is the index
of the method in the call site array, representing our cache. With a
Groovy >=1.8.0 you will also see the primopts path, which may contain a
direct method call to that method and does not use the helper method at all.
What I am trying to say is that the decompiled code, even if the
decompiler is halfway good, will produce a lot of code for a small
snippet of Groovy code and 90% of that code is not interesting.
I am just wondering if you will really reach your goal that way. on the
other hand, if the goal of that internal training is to show each and
every dirty little detail Groovy does, then this is surely ok... though
you could maybe go with disassembled bytecode then ;)