jheldmann (5) [Avatar] Offline
#1
Hi,
I tried Listing 7.26 on Groovy 1.0 (and later versions) and got an assertion failure at the last assertion. Printing the log.toString() value shows

before Whatever.ctor()
after Whatever.ctor()
before Whatever.outer()
after Whatever.outer()

I wonder, where the tracing of Whatever.inner() has gone...

Best regards
Jo.
Mittie (397) [Avatar] Offline
#2
Re: changed behaviour for intercepting methods (Listing 7.26)
Hi Jo,
are you sure about the Groovy version?

regards
Dierk
jheldmann (5) [Avatar] Offline
#3
Re: changed behaviour for intercepting methods (Listing 7.26)
Hi Dierk,
yes, I'm sure.
I tried it again just now with two versions of Groovy:
Groovy Version: 1.0 JVM: 1.6.0_03-b05
Groovy Version: 1.1-beta-3 JVM: 1.6.0_03-b05

regards
Jo.
Mittie (397) [Avatar] Offline
#4
Re: changed behaviour for intercepting methods (Listing 7.26)
Hm,

JVM 1.6 was not officially supported for Groovy 1.0 (but it should work anyways...).
I'll investigate further - but I'm currently busy with GroovyDevCon and GrailsExchange in London.

ciao
Dierk
jheldmann (5) [Avatar] Offline
#5
Re: changed behaviour for intercepting methods (Listing 7.26)
Hi,

I just tried it again, this time with
Groovy Version: 1.0 JVM: 1.5.0_10-b03
and it didn't work too.
So JVM 1.6 doesn't seem to be the reason.
Probably the difference is in the Groovy version you used for writing the book and the 1.0 (and later) version.

Regards
Jo.
Mittie (397) [Avatar] Offline
#6
Re: changed behaviour for intercepting methods (Listing 7.26)
Hi,

the book examples were all tested with Groovy 1.0 and JVM 1.4. I just checked again and it works.
I also tested with 1.5 and it works. I just tested both with Groovy-1.1-b3 and it works as well.

It seems there is something wrong with your setup but I have no guess what that should be.

regards
Dierk
jheldmann (5) [Avatar] Offline
#7
Re: changed behaviour for intercepting methods (Listing 7.26)
Hi,

it is really strange.
I tried it at home with Linux (Groovy Version: 1.1-beta-3 JVM: 1.6.0-b105) and
again in the office with Windows XP (Groovy Version: 1.0 JVM: 1.4.2_08-b03, Groovy Version: 1.1-beta-3 JVM: 1.4.2_08-b03), but neither worked smilie
I have no idea about the reason.
Has anybody else the same problem?

Regards
Jo.
Mittie (397) [Avatar] Offline
#8
Re: changed behaviour for intercepting methods (Listing 7.26)
maybe it's time to relay this to user@groovy.codehaus.org to reach a wider audience.

cheers
Dierk
jheldmann (5) [Avatar] Offline
#9
Re: changed behaviour for intercepting methods (Listing 7.26)
Hi,

I should have looked in the mailing list earlier, there is a thread about this issue:

http://www.nabble.com/Implementation-seems-changed-in-groovy.lang.Interceptor-t3863366.html

Obviously there was a change, so calls on "this." are not intercepted (like in my observations).
Now I don't understand, why the call of "inner" is intercepted in your environment...

Regards
Jo.
Mittie (397) [Avatar] Offline
#10
Re: changed behaviour for intercepting methods (Listing 7.26)
Sorry, my fault.

Looks like I got confused with my 10+ Groovy versions and updating the various environment variables consistently.

raised http://groovy.canoo.com/errata/erratum/show/26

thanks a lot for posting
Dierk