RE: Spam Challenge I have a Casio EXILIM as well as Cameron :)
Jul 13

Simple gotchas with debugging Groovy

Groovy, Tech Add comments

As I write more Groovy, I find that simple errors come… and my brain does the usual:

It reads what it thinks is there, NOT what is on the screen

One example is:

The misplaced ${ }

As I move things in and out of strings, I sometimes forget to get rid of the ${ } escapes:

name = “Dion”

println ${name}

# should of course be println name

It would be great if you had the error:

“${ } out of escaped string at ‘${name}’ on line 3″

however you get something like:

Caught: groovy.lang.MissingMethodException: No signature of method test.$() is applicable for argument types: (test$_run_closure1) values: [test$_run_closure1@a9c09e]groovy.lang.MissingMethodException: No signature of method test.$() is applicable for argument types: (test$_run_closure1) values: [test$_run_closure1@a9c09e]

NOTE: I know that the Groovy guys haven’t gotten to the “get the debugging stuff working” phase yet… or as James calls it “debug hell” :)

3 Responses to “Simple gotchas with debugging Groovy”

  1. James Strachan Says:

    Agreed – this should be super-easy to add as a check, since method names shouldn’t start with $ :)

  2. James Strachan Says:

    Now fixed in CVS HEAD – you’ll get a much better error message now when you make this typo :)

  3. mosK Says:

    http://www.penis-enlargement-dream.com

Leave a Reply

Spam is a pain, I am sorry to have to do this to you, but can you answer the question below?

Q: Type in the word 'cricket'