aspose file tools*
The moose likes Groovy and the fly likes suggestion for reducing code-test-debug cyclye Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Languages » Groovy
Bookmark "suggestion for reducing code-test-debug cyclye" Watch "suggestion for reducing code-test-debug cyclye" New topic
Author

suggestion for reducing code-test-debug cyclye

Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8898

I am using groovy since few weeks. While it reduces key strokes reducing code time, the debugging time has gone up. For e.g. If you pass string to preparedstatement.setLong it will throw runtime exception. The stack trace thrown by groovy is hardly helpful, it does not tell me which line caused the problem. I will have to spend lot of my time to detect this. If I were using Java compiler would have caught this problem, no need to run the program to find this.

What do other handle these situations ?


Groovy
Matthew Taylor
Rancher

Joined: Jun 13, 2004
Posts: 110
The stacktrace should tell you what line in your code the problem originated from, it just won't be the first thing the stacktrace shows you. Because there are so many layers in Groovy, it probably showed you a MissingMethodException or something because it was looking for a setLong method that accepted a String.

Whenever I get a stacktrace like that, I usually pick a unique word from my packaging and search through the stacktrace for it. That way I can find the first line in my code that caused the problem. For example if all my Groovy code is in com.mcdonalds.burgerapp, I'll search the stacktrace for mcdonalds.
[ October 22, 2008: Message edited by: Matthew Taylor ]

Grails Consultant
http://dangertree.net
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: suggestion for reducing code-test-debug cyclye
 
Similar Threads
Groovy Versus Java for the authors of Groovy in Action
Groovy embedded in Java and maintenance
Question on the Groovy book
How do I read the compile time error messages?
Is Groovy just a syntax suger