Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Very basic question regarding example on p135/136 of the GIA book

 
Craig Treptow
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I'm going through the book "Groovy In Action" using Eclipse. On page, 135,136, I wanted to see the benchmark run. So, I have this:

The caller:



and the class:



However, the error I see is:



I'm at a loss. I believe I am passing an Integer and a closure.

What am I missing?

Thanks in advance!

Craig
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unfortunately, you're also declaring methods in essentially random places.
 
Craig Treptow
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:Unfortunately, you're also declaring methods in essentially random places.


Sorry, I'm not following. This is the full content of what I am referring to as the caller:

Aha! I think I see what you mean now.

Caller:



And the class:



Success!

Thanks for making me step away and take another look!

Craig
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And what I'm saying is that your Chapter5 class is wrong, and the code I posted above isn't. The calling code isn't relevant.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic